本文整理汇总了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;
}
示例2: MailSelection
public MailSelection()
{
_outlookApplication = new Application();
_ns = _outlookApplication.GetNamespace("MAPI");
_inspector = _outlookApplication.ActiveInspector();
_explorer = _outlookApplication.ActiveExplorer();
Logger.LogInfo("EMAILTRACKING: Initialised Mail Selection");
}
示例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();
}
}
示例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);
}
}
示例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);
}
}