Hi,
I am not able to understand why TriggerCollection.Contains() always returns False in case Monthly Trigger even if the trigger is present. In other trigger types the collection returns correct value.
Please see the following code used by me to determine the correctness.
Please reply if i am missing anything or a way to solve this.
I am not able to understand why TriggerCollection.Contains() always returns False in case Monthly Trigger even if the trigger is present. In other trigger types the collection returns correct value.
Please see the following code used by me to determine the correctness.
DateTime dt = new DateTime(1992, 06, 19, 00, 00, 00);
TaskService ts = new TaskService();
TaskDefinition td = ts.NewTask();
td.Triggers.Add(new TimeTrigger(dt));// Time Trigger
if (td.Triggers.Contains(td.Triggers[0]))
Console.WriteLine("Returns Time TRigger");
td.Triggers.Add(new MonthlyTrigger { StartBoundary = dt, DaysOfMonth = new[] { 1} });// Time Trigger
Console.WriteLine(td.Triggers.Count);
if (td.Triggers.Contains(td.Triggers[1]))
Console.WriteLine("Returns Monthly Trigger");
Console.ReadKey();
/////////////////////////////
Output
----------------------------
Returns Time TRigger
2
It should return True in the case of Monthly Trigger also. Please reply if i am missing anything or a way to solve this.