Logical Operators

Hello,

I have an if statement where I want it to be true if two or more conditions = true.  I tried using the && operator but VS2012 just complains stating that;

Error      1              Operator '&&' cannot be applied to operands of type 'bool' and 'Microsoft.Exchange.WebServices.Data.DelegateFolderPermissionLevel'         

I have tried three ways:

if (item.Permissions.CalendarFolderPermissionLevel != DelegateFolderPermissionLevel.Editor && item.Permissions.InboxFolderPermissionLevel != DelegateFolderPermissionLevel.Editor)

                {

                    item.Permissions.CalendarFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;

                }

And

         if (item.Permissions.CalendarFolderPermissionLevel && item.Permissions.InboxFolderPermissionLevel != DelegateFolderPermissionLevel.Editor)
                {
                    item.Permissions.CalendarFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;

                }

and

	if (item.Permissions.CalendarFolderPermissionLevel && item.Permissions.InboxFolderPermissionLevel != DelegateFolderPermissionLevel.Editor)
                {
                    item.Permissions.CalendarFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;

                }


Could not find anything useful on the net.  How would I go about writing such a statement?  It works fine with just the one statement..



Many Thanks in advance.

Kind Regards

Mikell		
August 29th, 2013 5:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics