Beispiel #1
0
        public void OnSendList(Office.Core.IRibbonControl control)
        {
            if (control != null)
            {
                try
                {
                    Outlook.Inspector inspector =
                        (Outlook.Inspector)control.Context;
                    String coffeeText = GetTextFromTaskPane(inspector);

                    // Create a new email from the input parameters, and send it.
                    Outlook._MailItem mi =
                        (Outlook._MailItem)
                        Globals.ThisAddIn.Application.CreateItem(
                            Outlook.OlItemType.olMailItem);
                    mi.Subject = _orderName;
                    mi.Body    = coffeeText;
                    mi.To      = _mailAddressee;
                    mi.Send();

                    // Update the count of orders in the form region.
                    UserInterfaceContainer uiContainer =
                        Globals.ThisAddIn._uiElements.GetUIContainerForInspector(
                            inspector);
                    CultureInfo cultureInfo = new CultureInfo("en-us");
                    uiContainer.FormRegionControls.SetControlText(
                        _ordersTextBoxName, (++_orderCount).ToString(cultureInfo));
                }
                catch (COMException ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
                }
            }
        }
Beispiel #2
0
        public bool GetVisible(Office.Core.IRibbonControl control)
        {
            if (control == null)
            {
                return(false);
            }

            // Match up this control instance (determined by its inspector) in
            // the collection, and return the current value of the cached
            // visibility state.
            Outlook.Inspector      inspector   = control.Context as Outlook.Inspector;
            UserInterfaceContainer uiContainer =
                Globals.ThisAddIn._uiElements.GetUIContainerForInspector(inspector);

            return(uiContainer.IsControlVisible);
        }
Beispiel #3
0
        public bool GetVisible(Office.Core.IRibbonControl control)
        {
            if (control == null)
            {
                return(false);
            }

            // 在集合中匹配此控件实例(取决于其检查器),
            // 并返回缓存可见性状态的
            // 当前值。
            Outlook.Inspector      inspector   = control.Context as Outlook.Inspector;
            UserInterfaceContainer uiContainer =
                Globals.ThisAddIn._uiElements.GetUIContainerForInspector(inspector);

            return(uiContainer.IsControlVisible);
        }
Beispiel #4
0
        public void OnToggleTaskPane(
            Office.Core.IRibbonControl control, bool isPressed)
        {
            // Toggle the visibility of the custom taskpane.
            if (control != null)
            {
                // Find the inspector for this ribbon, so that we can find the
                // corresponding task pane from our collection.
                Outlook.Inspector inspector =
                    (Outlook.Inspector)control.Context;
                Office.Core.CustomTaskPane taskpane =
                    Globals.ThisAddIn._uiElements.GetTaskPaneForInspector(
                        inspector);

                // If we've been called before we've had a chance to add this
                // Inspector/task pane to the collection, we can add it now.
                if (taskpane == null)
                {
                    taskpane = Globals.ThisAddIn.CreateTaskPane(inspector);
                }

                taskpane.Visible = isPressed;
            }
        }
Beispiel #5
0
        public void OnToggleTaskPane(
            Office.Core.IRibbonControl control, bool isPressed)
        {
            // 切换自定义任务窗格的可见性。
            if (control != null)
            {
                // 查找此功能区的检查器,以便我们能够从集合中找到
                // 对应的任务窗格。
                Outlook.Inspector inspector =
                    (Outlook.Inspector)control.Context;
                Office.Core.CustomTaskPane taskpane =
                    Globals.ThisAddIn._uiElements.GetTaskPaneForInspector(
                        inspector);

                // 如果我们在有机会将此
                // 检查器/任务窗格添加到集合中之前已被调用,则我们可以现在添加窗格。
                if (taskpane == null)
                {
                    taskpane = Globals.ThisAddIn.CreateTaskPane(inspector);
                }

                taskpane.Visible = isPressed;
            }
        }
Beispiel #6
0
 public void Username_TextChanged(Microsoft.Office.Core.IRibbonControl control, string text)
 {
     Username = text;
 }
Beispiel #7
0
 public void ToCir(Microsoft.Office.Core.IRibbonControl control) => FindReplace(lat, cir);
Beispiel #8
0
 public void ToLat(Microsoft.Office.Core.IRibbonControl control) => FindReplace(cir, lat);
Beispiel #9
0
 public Bitmap OnDo1GetImage(Microsoft.Office.Core.IRibbonControl control) => Resources.Do1_128px;
Beispiel #10
0
 public void OnDo1Click(Microsoft.Office.Core.IRibbonControl control)
 {
     MessageBox.Show(Resources.Do1Action);
 }
Beispiel #11
0
 public string GetPassword(Microsoft.Office.Core.IRibbonControl control)
 {
     return(!string.IsNullOrWhiteSpace(EncodedPassword) ? "**********" : string.Empty);
 }
Beispiel #12
0
        public void TestSettings(Microsoft.Office.Core.IRibbonControl control)
        {
            Func <bool> func = () => _clickToCall.RingTest(_credential, IPAddress.Parse(PhoneIP));

            CheckAndCall(func);
        }
Beispiel #13
0
 public void PhoneIP_TextChanged(Microsoft.Office.Core.IRibbonControl control, string text)
 {
     PhoneIP = text;
 }
Beispiel #14
0
 public string GetPhoneIP(Microsoft.Office.Core.IRibbonControl control)
 {
     return(PhoneIP);
 }
Beispiel #15
0
 public string GetUsername(Microsoft.Office.Core.IRibbonControl control)
 {
     return(Username);
 }
Beispiel #16
0
 public void PasswordDialog(Microsoft.Office.Core.IRibbonControl control)
 {
     var passForm = new PasswordForm();
     var result   = passForm.ShowDialog();
 }
Beispiel #17
0
 public Bitmap GetLatImg(Microsoft.Office.Core.IRibbonControl control) => Resources.lat;
Beispiel #18
0
 public Bitmap GetCirImg(Microsoft.Office.Core.IRibbonControl control) => Resources.cir;