Esempio n. 1
0
        // 用户已经更改自定义窗体区域中列表框内的
        // 选择。
        private void _coffeeList_Change()
        {
            UserInterfaceContainer uiContainer =
                Globals.ThisAddIn._uiElements.GetUIContainerForInspector(
                    _inspector);

            // 令外接程序服务功能区按钮可见。
            uiContainer.ShowRibbonControl(_mailServiceGroup);

            // 获取任务窗格中的用户控件,并将
            // 在窗体区域的列表框中选择的项目的文本复制到任务窗格的
            // 列表框。
            SimpleControl sc =
                (SimpleControl)uiContainer.TaskPane.ContentControl;

            sc._coffeeGroup.Visible = true;
            sc._coffeeList.Items.Add(_coffeeList.Text);
        }
        // The user has changed the selection in the listbox in the custom
        // form region.
        private void _coffeeList_Change()
        {
            UserInterfaceContainer uiContainer =
                Globals.ThisAddIn._uiElements.GetUIContainerForInspector(
                    _inspector);

            // Make the add-in service ribbon buttons visible.
            uiContainer.ShowRibbonControl(_mailServiceGroup);

            // Get the usercontrol in the task pane, and copy the text of the
            // item selected in the form region's listbox into the taskpane's
            // listbox.
            SimpleControl sc =
                (SimpleControl)uiContainer.TaskPane.ContentControl;

            sc._coffeeGroup.Visible = true;
            sc._coffeeList.Items.Add(_coffeeList.Text);
        }
Esempio n. 3
0
        private String GetTextFromTaskPane(Outlook.Inspector inspector)
        {
            String coffeeText = null;

            if (inspector != null)
            {
                // Get the usercontrol in the task pane.
                Office.Core.CustomTaskPane taskpane =
                    Globals.ThisAddIn._uiElements.GetTaskPaneForInspector(inspector);
                SimpleControl sc = (SimpleControl)taskpane.ContentControl;

                // Compose the mail body from the strings in the task pane listbox.
                StringBuilder builder = new StringBuilder();
                foreach (string s in sc._coffeeList.Items)
                {
                    builder.AppendLine(s);
                }
                coffeeText = builder.ToString();
            }

            return(coffeeText);
        }
Esempio n. 4
0
        private String GetTextFromTaskPane(Outlook.Inspector inspector)
        {
            String coffeeText = null;

            if (inspector != null)
            {
                // 获取任务窗格中的用户控件。
                Office.Core.CustomTaskPane taskpane =
                    Globals.ThisAddIn._uiElements.GetTaskPaneForInspector(inspector);
                SimpleControl sc = (SimpleControl)taskpane.ContentControl;

                // 在任务窗格列表框中使用字符串撰写邮件正文。
                StringBuilder builder = new StringBuilder();
                foreach (string s in sc._coffeeList.Items)
                {
                    builder.AppendLine(s);
                }
                coffeeText = builder.ToString();
            }

            return(coffeeText);
        }