本文整理汇总了C#中Window.SetTabPicture方法的典型用法代码示例。如果您正苦于以下问题:C# Window.SetTabPicture方法的具体用法?C# Window.SetTabPicture怎么用?C# Window.SetTabPicture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.SetTabPicture方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEnable
public override void OnEnable()
{
base.OnEnable();
RegistryKey rk = Registry.CurrentUser.OpenSubKey(Connect.REGISTRY_BASE_PATH + "\\" + REGISTRY_EXTENDED_PATH);
bool windowIsVisible = false;
if (rk != null)
{
windowIsVisible = (1 == (int)rk.GetValue(REGISTRY_SETTING_NAME, 0));
rk.Close();
}
processPackage = new System.ComponentModel.BackgroundWorker();
processPackage.WorkerReportsProgress = true;
processPackage.WorkerSupportsCancellation = true;
processPackage.DoWork += new System.ComponentModel.DoWorkEventHandler(processPackage_DoWork);
processPackage.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(processPackage_ProgressChanged);
processPackage.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(processPackage_RunWorkerCompleted);
object programmableObject = null;
//This guid must be unique for each different tool window,
// but you may use the same guid for the same tool window.
//This guid can be used for indexing the windows collection,
// for example: applicationObject.Windows.Item(guidstr)
String guidstr = "{6679390F-A712-40EA-8729-E2184A1436BF}";
EnvDTE80.Windows2 windows2 = (EnvDTE80.Windows2)this.ApplicationObject.Windows;
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
toolWindow = windows2.CreateToolWindow2( this.AddInInstance, asm.Location, "BIDSHelper.SSIS.ExpressionListControl", "Expressions", guidstr, ref programmableObject);
expressionListWindow = (ExpressionListControl)programmableObject;
expressionListWindow.RefreshExpressions += new EventHandler(expressionListWindow_RefreshExpressions);
expressionListWindow.EditExpressionSelected += new EventHandler<EditExpressionSelectedEventArgs>(expressionListWindow_EditExpressionSelected);
// Set the picture displayed when the window is tab docked
// Clean build required when switching between VS 2005 and VS 2008
// during testing, otherwise we get some strange behaviour with this
IntPtr icon = BIDSHelper.Resources.Common.ExpressionListIcon.ToBitmap().GetHbitmap();
#if KATMAI || DENALI
toolWindow.SetTabPicture(icon.ToInt32());
#else
toolWindow.SetTabPicture(icon);
#endif
//if (windowIsVisible)
// toolWindow.Visible = true;
}
示例2: InitToolWindowPicture
void InitToolWindowPicture(Window toolWnd)
{
int majorVer = GetMajorAppVersion();
stdole.IPictureDisp olePic = GetIPictureFromResource(
"FindNext", /*makeTransparent=*/(majorVer == 8 ? false : true));
toolWnd.SetTabPicture(olePic);
}
示例3: CreateToolWindow
/// <summary>
/// Create tool window with the To Do list.
/// </summary>
private void CreateToolWindow()
{
if (_toolWindow != null)
{
_toolWindow.Activate();
}
else
{
object programmableObject = null;
_toolWindow = ((Windows2)_application.Windows).CreateToolWindow2(
_addIn, typeof(ToolWindowControl).Assembly.Location, typeof(ToolWindowControl).FullName, "TargetProcess Window",
"{A523C4AD-EA9B-4944-94AB-41313992B2EE}", ref programmableObject);
_toolWindow.SetTabPicture(ConvertImage.Convert(Resources.Icon));
var toolWindowControl = (ToolWindowControl)programmableObject;
toolWindowControl.Init(_application, _controller, _env);
_toolWindow.Visible = true;
}
}
示例4: SetTabPicture
public static void SetTabPicture(Window window, string iconResource)
{
window.SetTabPicture(Helper.GetResourceImage(iconResource));
}
示例5: CreateExplorerWindow
private void CreateExplorerWindow()
{
if (_explorerWindow != null)
{
_explorerWindow.Activate();
}
else
{
Windows2 windows2 = (Windows2)_applicationObject.Windows;
Assembly asm = Assembly.GetExecutingAssembly();
object customControl = null;
string className = "TracExplorer.Common.TracExplorerControl";
string caption = "Trac Explorer";
string asmLocation = asm.Location;
asmLocation = asmLocation.Replace("VSTrac.dll", "Common.dll");
_explorerWindow = windows2.CreateToolWindow2(_addInInstance, asmLocation, className,
caption, _explorerWindowGuid, ref customControl);
Image customToolWindowTabImage = GetCustomToolWindowTabImage();
_explorerWindow.SetTabPicture(Support.ImageToIPicture(customToolWindowTabImage));
if (customControl != null)
{
((TracExplorerControl)customControl).TracConnect = this;
}
_explorerWindow.Visible = true;
}
}