views:

20

answers:

0

i try to create task for another users Task class needs Contasct with StringList format. How can i do that. i think that i do what i need to make it? Look please

 StringList list = new StringList();
            foreach (string item in obj.RecipientsList)
            {
                list.Add(item);

            }

 public class MyOutLookTasks : IOutLook<MyTasks>
    {
        public ExchangeService service { get; set; }
        public MyOutLookTasks(string UserName, string PassWord)
        {
            service = Exchange.GenerateService(UserName, PassWord);
        }
        #region IOutLook<MyTasks> Members

        public bool Set(MyTasks obj)
        {

            StringList list = new StringList();
            foreach (string item in obj.RecipientsList)
            {
                list.Add(item);

            }
            Task task = new Task(service)
            {
                Body = obj.Body,
                Subject = obj.Subject,
                StartDate = obj.StartDate, 
                Contacts = list  // I ADDED CONTACT !!!!!!!!!!!!!!!!!!!!!!!!!!
            };
            task.Save(WellKnownFolderName.Tasks);
            return true;
        }

        #endregion
    }

FOR Button Event


 protected void btnCreateTask_Click(object sender, EventArgs e)
        {
            OutLookManager outlookMngr = new OutLookManager();
            bool isOk = outlookMngr.Generate<MyTasks>(new MyTecOutLookTasks(UserName, PassWord), new MyTasks()
            {
                Subject = "yusuf deneme",
                Body = "Test",
                DueDate = new DateTime(2010, 10, 20, 11, 15, 0),
                RecipientsList = new List<string>() { "[email protected]",
                                                       "[email protected]",
                                                       "[email protected]" },
                ReminderSet = true,
                EnumSchedulePlusPriority = MySchedulePlusPriority.High,
                ReminderTime = new DateTime(2010, 10, 20, 11, 25, 0),
                StartDate = new DateTime(2010, 10, 20, 11, 20, 0)

            });