当前位置: 首页>>代码示例>>C#>>正文


C# Application.ActiveExplorer方法代码示例

本文整理汇总了C#中Application.ActiveExplorer方法的典型用法代码示例。如果您正苦于以下问题:C# Application.ActiveExplorer方法的具体用法?C# Application.ActiveExplorer怎么用?C# Application.ActiveExplorer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Application的用法示例。


在下文中一共展示了Application.ActiveExplorer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalDavSynchronizerToolBar

    public CalDavSynchronizerToolBar (Application application, ComponentContainer componentContainer, object missing)
    {
      _componentContainer = componentContainer;

      var toolBar = application.ActiveExplorer().CommandBars.Add ("CalDav Synchronizer", MsoBarPosition.msoBarTop, false, true);

      var toolBarBtnOptions = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing);
      toolBarBtnOptions.Style = MsoButtonStyle.msoButtonIconAndCaption;
      toolBarBtnOptions.Caption = "Options";
      toolBarBtnOptions.FaceId = 222; // builtin icon: hand hovering above a property list
      toolBarBtnOptions.Tag = "View or set CalDav Synchronizer options";

      toolBarBtnOptions.Click += ToolBarBtn_Options_OnClick;

      _toolBarBtnSyncNow = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing);
      _toolBarBtnSyncNow.Style = MsoButtonStyle.msoButtonIconAndCaption;
      _toolBarBtnSyncNow.Caption = "Synchronize";
      _toolBarBtnSyncNow.FaceId = 107; // builtin icon: lightning hovering above a calendar table
      _toolBarBtnSyncNow.Tag = "Synchronize now";
      _toolBarBtnSyncNow.Click += ToolBarBtn_SyncNow_OnClick;

      var toolBarBtnAboutMe = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing);
      toolBarBtnAboutMe.Style = MsoButtonStyle.msoButtonIconAndCaption;
      toolBarBtnAboutMe.Caption = "About";
      toolBarBtnAboutMe.FaceId = 487; // builtin icon: blue round sign with "i" letter
      toolBarBtnAboutMe.Tag = "About CalDav Synchronizer";
      toolBarBtnAboutMe.Click += ToolBarBtn_About_OnClick;

      toolBar.Visible = true;
    }
开发者ID:PierreMarieBaty,项目名称:outlookcaldavsynchronizer,代码行数:30,代码来源:CalDavSynchronizerToolBar.cs

示例2: MailSelection

		public MailSelection()
		{
            _outlookApplication = new Application();
            _ns = _outlookApplication.GetNamespace("MAPI");
            _inspector = _outlookApplication.ActiveInspector();
            _explorer = _outlookApplication.ActiveExplorer();
			Logger.LogInfo("EMAILTRACKING: Initialised Mail Selection");
		}
开发者ID:killbug2004,项目名称:WSProf,代码行数:8,代码来源:MailSelection.cs

示例3: MailNavigator

 public MailNavigator(Application app, MAPIFolder folder)
 {
     this.OutlookApp = app;
     this.Explorer =app.ActiveExplorer();
     this.Folder = folder;
     if (Explorer.CurrentFolder == folder && Explorer.Selection.Count > 0)
     {
         this.Current = new OutlookItem(this.Explorer.Selection[1]);
     }
     else
     {
         MoveTOStart();
     }
 }
开发者ID:varunkho,项目名称:ReadOut,代码行数:14,代码来源:MailNavigator.cs

示例4: AddCompareShortcutToShortcutsPane

        public static void AddCompareShortcutToShortcutsPane(Application application)
        {
            try
            {
                Explorer explorer = application.ActiveExplorer();
                using (new ComRelease(explorer))
                {
                    if (explorer == null)
                    {
                        // not an error this happens when sending via simple mapi
                        return;
                    }
                    Panes panes = explorer.Panes;
                    using (new ComRelease(panes))
                    {
                        var outlookBar = (_OutlookBarPane) panes["OutlookBar"];
                        using (new ComRelease(outlookBar))
                        {
                            OutlookBarGroup outlookBarGroup = outlookBar.CurrentGroup;
                            using (new ComRelease(outlookBarGroup))
                            {
                                OutlookBarShortcuts outlookBarShortcuts = outlookBarGroup.Shortcuts;
                                if (outlookBarShortcuts == null)
                                {
                                    return;
                                }
                                using (new ComRelease(outlookBarShortcuts))
                                {
                                    string linkPath = GetLinkPath();
                                    string targetpath = Path.Combine(OptionApi.GetString("ProgramLocation"), DvExeName);
                                    CreateLink(targetpath, linkPath);

                                    RemoveUnwantedShortcuts(outlookBarShortcuts);

                                    long index = GetShortcutIndex(ShortcutName, outlookBarShortcuts);
                                    if (index != -1)
                                    {
                                        OutlookBarShortcut shortcut = outlookBarShortcuts[index];
                                        using (new ComRelease(shortcut))
                                        {
                                            var target = (string) shortcut.Target;
                                            if (string.Compare(linkPath, target, true) == 0)
                                            {
                                                shortcut.SetIcon(GetIconPath());
                                                return;
                                            }

                                            // Remove the existing shortcut if target is wrong
                                            RemoveShortcut(ShortcutName, outlookBarShortcuts);
                                        }
                                    }

                                    // If we got here then either there wasn't a shorcut set up
                                    // or the target was not correct for this product

                                    if (index > outlookBarShortcuts.Count)
                                    {
                                        index = outlookBarShortcuts.Count;
                                    }
                                    else if (index == -1)
                                    {
                                        index = outlookBarShortcuts.Count + 1;
                                    }

                                    OutlookBarShortcut newShortcut = outlookBarShortcuts.Add(linkPath, ShortcutName,
                                                                                             index);
                                    using (new ComRelease(newShortcut))
                                    {
                                        newShortcut.SetIcon(GetIconPath());
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:81,代码来源:ShortcutHelper.cs

示例5: RemoveShortcut

        public static void RemoveShortcut(Application application)
        {
            try
            {
                Explorer explorer = application.ActiveExplorer();
                using (new ComRelease(explorer))
                {
                    if (explorer == null)
                    {
                        // not an error this happens when sending via simple mapi
                        return;
                    }
                    Panes panes = explorer.Panes;
                    using (new ComRelease(panes))
                    {
                        var outlookBar = (_OutlookBarPane) panes["OutlookBar"];
                        using (new ComRelease(outlookBar))
                        {
                            OutlookBarGroup outlookBarGroup = outlookBar.CurrentGroup;
                            using (new ComRelease(outlookBarGroup))
                            {
                                OutlookBarShortcuts outlookBarShortcuts = outlookBarGroup.Shortcuts;
                                if (outlookBarShortcuts == null)
                                {
                                    return;
                                }

                                using (new ComRelease(outlookBarShortcuts))
                                {
                                    RemoveShortcut(ShortcutName, outlookBarShortcuts);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logger.LogError(e);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:41,代码来源:ShortcutHelper.cs


注:本文中的Application.ActiveExplorer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。