private void DeleteNode() { try { // Prompt. if (PromptForDelete()) { using (new LongRunningMonitor(Snapin)) { // Let the derived class respond. Delete(); // Remove from parent and remove from the display. m_parentNode.RemoveChild(this); Snapin.Unregister(this); DeleteItem(); } } } catch (Exception e) { new ExceptionDialog(e, "Cannot delete '" + m_displayName + "'.").ShowDialog(Snapin); } }
private void Insert(SnapinNode parent, IntPtr nextHScopeItem) { GetImageIndices(); Snapin.EnsureImages(); IConsoleNameSpace2 ns = Snapin.ConsoleNamespace; ScopeDataItem item = new ScopeDataItem(); item.Mask = (uint)ScopeDataItemFlags.Str | (uint)ScopeDataItemFlags.Param | (uint)ScopeDataItemFlags.Next | (uint)ScopeDataItemFlags.Image | (uint)ScopeDataItemFlags.OpenImage | (uint)ScopeDataItemFlags.Children; item.Image = m_closedImageIndex; item.OpenImage = m_openImageIndex; item.RelativeId = nextHScopeItem; item.DisplayName = (IntPtr)(-1); item.Param = Cookie; item.Children = HasChildren() ? 1 : 0; // Expand the parent node before adding the child. ns.Expand(parent.HScopeItem); ns.InsertItem(ref item); HScopeItem = item.Id; m_parentHScopeItem = parent.HScopeItem; m_parentNode = parent; }
protected void DeleteChildNode(SnapinNode node) { // Delete the item and unregister the node. node.DeleteItem(); Snapin.Unregister(node); RemoveChild(node); }
private void DeleteChildNodes() { foreach (SnapinNode node in m_childNodes) { // Delete the item and unregister the node. node.DeleteItem(); Snapin.Unregister(node); } m_childNodes.Clear(); }
public LongRunningMonitor(Snapin snapin) { if (snapin == null) { throw new ArgumentNullException("snapin"); } m_snapin = snapin; // DO NOT call DoEvents() in this method. This causes re-entracy problems in IComponent.Notify() // and IComponentData.Notify() in the snap-in. m_snapin.Cursor = Cursors.WaitCursor; // Display an hourglass. // Need to set the current cursor as well, otherwise the above has no effect. Cursor.Current = Cursors.WaitCursor; }
protected SnapinNode(Snapin snapin) { m_snapin = snapin; m_parentNode = this; m_cookie = snapin.Register(this); m_hScopeItem = IntPtr.Zero; m_parentHScopeItem = IntPtr.Zero; m_childNodes = new ArrayList(8); m_nodeSelected = false; m_control = new NodeControl(this); // Add images. m_closedImageIndex = snapin.AddImage(Constants.Icon.DefaultClosed); m_openImageIndex = snapin.AddImage(Constants.Icon.DefaultOpen); }
public void Refresh(bool childNodesChanged) { if (childNodesChanged) { ResetChildNodes(); } ImageChanged(); if (m_snapin.CurrentScopeNode == this) { Snapin.Refresh(); RefreshChildItems(); RefreshResults(); } else { RefreshChildItems(); } }
public OcxNode(Snapin snapin, System.Guid ocxGuid, bool createNew) : base(snapin) { m_ocxGuid = ocxGuid; m_createNew = createNew; }
public Component(Snapin snapin) { m_snapin = snapin; }
private bool PromptForDelete() { return(Snapin.MessageBox(GetDeletePromptText(), "Confirm deletion", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK); }
internal virtual void OnAddResultPaneImages(IImageList il) { Snapin.EnsureImages(); Snapin.Images.LoadImageList(il, 0); }
protected int AddResultImage(string image) { return(Snapin.AddImage(image)); }
protected ResultNode(Snapin snapin) : base(snapin) { m_resultSelected = false; }