0

Hi I am trying to display all non sensitive appointments in EWS (I can get all appointments fine, but even with restricted permissions I can still see private appointments which I shouldn't be able to see!)

This is basically what I want to do:

       if ( appointment.Sensitivity  == "Normal")

    Console.WriteLine(appointment.Subject);
}

However I get operator '==' cannot be applied to operands of type 'Microsoft.Exchange.WebServices.Data.Sensitivity' and 'String'

Can someone please advise?

Corbin Spicer
  • 285
  • 1
  • 8
  • 26

2 Answers2

2

Compare it to the enum Microsoft.Exchange.WebServices.Data.Sensitivity rather than using ToString()

string message = appointment.Subject + " - " + appointment.Sensitivity;

if (appointment.Sensitivity == Sensitivity.Normal)
    Console.WriteLine(message);
Brett McKenzie
  • 545
  • 4
  • 12
0
string message = appointment.Subject + " - " + appointment.Sensitivity;

if (appointment.Sensitivity.ToString() == "Normal")
    Console.WriteLine(message);
cchana
  • 4,899
  • 3
  • 33
  • 43
Corbin Spicer
  • 285
  • 1
  • 8
  • 26