示例#1
0
        }// QueryDataObject

        //-------------------------------------------------
        // GetDisplayInfo
        //
        // This function is called by MMC whenever it needs to
        // display a node in the scope pane.
        //-------------------------------------------------
        public void GetDisplayInfo(ref SCOPEDATAITEM sdi)
        {
            // First let's find this node we want info on....
            CNode NodeWeWant = CNodeManager.GetNode((int)sdi.lParam);

            NodeWeWant.GetDisplayInfo(ref sdi);
        }// GetDisplayInfo
示例#2
0
        }// RefreshDisplayName

        //-------------------------------------------------
        // GetDisplayInfo
        //
        // This function is called by MMC whenever it needs to
        // display a node in the scope pane.
        //-------------------------------------------------
        internal void GetDisplayInfo(ref SCOPEDATAITEM sdi)
        {
            // See if they want the display name
            if ((sdi.mask & SDI.STR) > 0)
            {
                sdi.displayname = Marshal.StringToCoTaskMemUni(DisplayName);
            }

            // The snapin was set up so the cookie is the same
            // value as the image index
            if ((sdi.mask & SDI.IMAGE) > 0)
            {
                sdi.nImage = Cookie;
            }

            // We're using the same image for the "open" image as
            // we are the "closed" image
            if ((sdi.mask & SDI.OPENIMAGE) > 0)
            {
                sdi.nOpenImage = Cookie;
            }

            // We shouldn't need to set this.... but if we need to...
            if ((sdi.mask & SDI.STATE) > 0)
            {
                sdi.nState = 0;
            }

            // If we're inquiring about children....
            if ((sdi.mask & SDI.CHILDREN) > 0)
            {
                sdi.cChildren = NumChildren;
            }
        }// GetDisplayInfo
示例#3
0
        }// GetColumnWidth

        //-------------------------------------------------
        // RefreshDisplayName
        //
        // Our nodes will call this when they need their display
        // name refreshed
        //-------------------------------------------------
        protected void RefreshDisplayName()
        {
            SCOPEDATAITEM sdi = new SCOPEDATAITEM();

            sdi.mask        = SDI.STR;
            sdi.displayname = (IntPtr)(-1);
            sdi.ID          = HScopeItem;

            CNodeManager.SetItem(sdi);
        }// RefreshDisplayName
        }// InsertItem

        static internal int SetItem(SCOPEDATAITEM sdi)
        {
            // Need to make this a pointer
            IntPtr p = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SCOPEDATAITEM)));

            Marshal.StructureToPtr(sdi, p, false);

            int nRet = (int)SendMessage(m_hMessageWnd, WM_SETITEM, p, IntPtr.Zero);

            Marshal.FreeHGlobal(p);
            return(nRet);
        }// SetItem
示例#5
0
        }// InsertChildren

        internal void InsertSpecificChild(int iChild)
        {
            SCOPEDATAITEM sdi = new SCOPEDATAITEM();

            CNode nChild = CNodeManager.GetNode(iChild);

            sdi.mask = SDI.STR |
                       SDI.PARAM |
                       SDI.PARENT |
                       SDI.IMAGE |
                       SDI.OPENIMAGE |
                       SDI.CHILDREN;

            // The image index is going to be the same as the cookie value
            sdi.nImage = CResourceStore.GetIconCookie(nChild.IconHandle);
            // The open image is the same as the closed image
            sdi.nOpenImage = sdi.nImage;
            sdi.relativeID = m_iHScopeItem;
            // We set displayname to -1 to initiate a callback for the string
            // (We need to do it this way... it's an MMCism)
            sdi.displayname = (IntPtr)(-1);

            sdi.lParam = nChild.Cookie;

            // The children field is set to either 0 or 1 (if it has children or not)
            sdi.cChildren = (nChild.NumChildren == 0)?0:1;

            // Once the item has been inserted, we're given the HScopeItem value for the node
            // MMC uses this value to uniquely identify the node. We'll store it for future
            // use.
            nChild.HScopeItem = CNodeManager.InsertItem(sdi);

            // We'll also put in the parent's HScopeItem
            nChild.m_iParentHScopeItem = HScopeItem;

            // Also, we can be slick and expand this child's node too

            // We don't care about perf savings after startup... do the expansion now
            // Also, if we have a non MMC host, we're not sure how it will behave
            // if it doesn't have all the nodes. Let's force the expand if we're not
            // running under MMC
            if (m_fInitialCreationDone || CNodeManager.Console is INonMMCHost)
            {
                // Expand this child
                CNodeManager.ExpandNodeNamespace(nChild.HScopeItem);
            }
            else if (Cookie == 0)
            {
                Thread t = new Thread(new ThreadStart(nChild.LazyExpand));
                t.Start();
            }
        }// InsertSpecificChild
示例#6
0
 public void AddExtension(CLSID a, ref SCOPEDATAITEM b)
 {
 }
示例#7
0
 public void GetItem(ref SCOPEDATAITEM a)
 {
 }
示例#8
0
        }// Expand

        public void InsertItem(ref SCOPEDATAITEM a)
        {
            // We'll make the cookie the same as the HScope Item
            a.ID = a.lParam;
        }// InsertItem