示例#1
0
        /// <summary>
        /// Display CalendarViewDialog to gather search criteria then
        /// open the ContentsForm and display search results.
        /// </summary>
        /// <param name="sender">The parameter is not used.</param>
        /// <param name="e">The parameter is not used.</param>
        private void MnuFindAppointments_Click(object sender, EventArgs e)
        {
            List <ItemId> appts = null;

            FindAppointmentsDialog.ShowDialog(this.CurrentService, ref appts);

            if (appts != null)
            {
                ItemsContentForm.Show("CalendarView results.", appts, this.CurrentService, this);
            }
        }
示例#2
0
        /// <summary>
        /// Allow the user to input an ItemId and display its properites
        /// in FolderContentsForm.
        /// </summary>
        /// <param name="sender">The parameter is not used.</param>
        /// <param name="e">The parameter is not used.</param>
        private void MnuOpenItemById_Click(object sender, EventArgs e)
        {
            ItemId itemId = null;

            if (ItemIdDialog.ShowDialog(out itemId, this.CurrentService) == DialogResult.OK)
            {
                List <ItemId> item = new List <ItemId>();
                item.Add(itemId);

                ItemsContentForm.Show(
                    "Displaying item by ItemId",
                    item,
                    this.CurrentService,
                    this);
            }
        }
示例#3
0
        private void openItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lvItems.SelectedItems.Count > 0)
            {
                ItemTag oItemTag = null;
                oItemTag = (ItemTag)lvItems.SelectedItems[0].Tag;

                List <ItemId> item = new List <ItemId>();
                item.Add(oItemTag.Id);

                ItemsContentForm.Show(
                    "Displaying recurrence item",
                    item,
                    _CurrentService,
                    this);
            }
        }
        private void lstErrors_DoubleClick(object sender, EventArgs e)
        {
            if (lstErrors.SelectedItems.Count > 0)
            {
                string sItem  = lstErrors.SelectedItems[0].Text;
                ItemId itemId = new ItemId(sItem);

                List <ItemId> item = new List <ItemId>();
                item.Add(itemId);

                ItemsContentForm.Show(
                    "Displaying item by ItemId",
                    item,
                    this.CurrentService,
                    this);
            }
        }
示例#5
0
        private void DisplayItem()
        {
            if (lvItems.SelectedItems.Count > 0)
            {
                //string sId = lvItems.SelectedItems[3].Text.Trim();
                string sId     = lvItems.SelectedItems[0].SubItems[3].Text;
                ItemId oItemId = new ItemId(sId);


                List <ItemId> item = new List <ItemId>();
                item.Add(oItemId);

                ItemsContentForm.Show(
                    "Displaying item",
                    item,
                    _CurrentService,
                    this);
            }
        }
示例#6
0
        private void mnuGetConversationItems_Click(object sender, EventArgs e)
        {
            List <ItemId> oConversationItems = new List <ItemId>();

            PropertySet    oPropertySet    = null;
            ConversationId oConversationId = null;
            FolderId       oFolderId       = null;

            ConversationIdDialog oConversationIdDialog = new ConversationIdDialog();

            oConversationIdDialog.ShowDialog();

            this.Cursor = Cursors.WaitCursor;

            if (oConversationIdDialog.ChoseOK == true)
            {
                oPropertySet    = oConversationIdDialog.CurrentPropertySet;
                oConversationId = oConversationIdDialog.CurrentConversationId;
                oFolderId       = oConversationIdDialog.CurrentFolderId;

                List <FolderId> folder = new List <FolderId>();
                folder.Add(oFolderId);

                // Identify the folders to ignore.
                Collection <FolderId> foldersToIgnore =
                    new  Collection <FolderId>()
                {
                    WellKnownFolderName.DeletedItems, WellKnownFolderName.Drafts
                };

                ConversationResponse oResponses = null;
                oResponses = CurrentService.GetConversationItems(
                    oConversationId,
                    oPropertySet,
                    null,
                    foldersToIgnore,
                    ConversationSortOrder.TreeOrderDescending
                    );

                //Console.WriteLine("SyncState: " + oResponses.SyncState); // Get the synchronization state of the conversation.


                try {
                    foreach (ConversationNode node in oResponses.ConversationNodes) // Process each node of conversation items.
                    {
                        //Console.WriteLine("Parent conversation index: " + node.ParentConversationIndex);
                        //Console.WriteLine("Conversation index: " + node.ConversationIndex);
                        //Console.WriteLine("Conversation node items:");

                        // Process each item in the conversation node.
                        foreach (Item item in node.Items)
                        {
                            //Console.WriteLine("   Item ID: " + item.Id.UniqueId);
                            //Console.WriteLine("   Subject: " + item.Subject);
                            //Console.WriteLine("   Received: " + item.DateTimeReceived);
                            oConversationItems.Add(item.Id);
                        }
                    }
                }
                catch (ServerBusyException srBusyException)  // 2013+
                {
                    Console.WriteLine(srBusyException);
                }
                // This exception may occur if there is an error with the service.
                catch (ServiceResponseException srException)
                {
                    Console.WriteLine(srException);
                }
                this.Cursor = Cursors.Default;

                ItemsContentForm.Show(
                    "Displaying item by Conversation",
                    oConversationItems,
                    this.CurrentService,
                    this);
            }
        }