public void ShowWalker(UIApplication uiapp) { if (walkerWindow == null) { WalkerHandler handler = new WalkerHandler(uiapp); ExternalEvent exEvent = ExternalEvent.Create(handler); walkerWindow = new WalkerWindow(exEvent, handler); walkerWindow.Closed += WindowClosed; walkerWindow.Show(); } }
public Result OnStartup(UIControlledApplication application) { thisApp = this; walkerWindow = null; try { application.CreateRibbonTab(tabName); } catch { } AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); RibbonPanel rp = application.CreateRibbonPanel(tabName, "BCF"); string currentAssembly = System.Reflection.Assembly.GetAssembly(this.GetType()).Location; BitmapSource walkerImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(Properties.Resources.walker.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); PushButton walkerButton = rp.AddItem(new PushButtonData("smartBCF", "smartBCF", currentAssembly, "HOK.SmartBCF.BCFCommand")) as PushButton; walkerButton.LargeImage = walkerImage; return(Result.Succeeded); }
public void WindowClosed(object sender, System.EventArgs e) { walkerWindow = null; }