コード例 #1
0
        private void OutlookItems_ItemRemove()
        {
            IEnumerable <Outlook.TaskItem> taskEnumerator  = outlookItems.Cast <Outlook.TaskItem>();
            List <Outlook.TaskItem>        outlookTaskList = new List <Outlook.TaskItem>(taskEnumerator);
            IEnumerable <OutlookTask>      toDeleteSubset  = taskAndCategoryLoader.Tasks.Where(task => !outlookTaskList.Exists(element => element.EntryID.Equals(task.EntryId)));

            for (int index = 0; index < toDeleteSubset.Count(); index++)
            {
                OutlookTask taskToDelete = toDeleteSubset.ElementAt(index);
                taskAndCategoryLoader.Tasks.Remove(taskToDelete);
                TaskRemove?.Invoke(taskToDelete);
            }
        }