示例#1
0
 public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
 {
     var item = _items[index];
     pptlNode = item.Children;
     pfCanRecurse = item.IsExpandable ? 1 : 0;
     return VSConstants.S_OK;
 }
示例#2
0
        public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
        {
            var item = _items[index];

            pptlNode     = item.Children;
            pfCanRecurse = item.IsExpandable ? 1 : 0;
            return(VSConstants.S_OK);
        }
示例#3
0
        int IVsLiteTreeList.GetExpandedList(uint index,
                                            out int pfCanRecurse,
                                            out IVsLiteTreeList pptlNode)
        {
            var node = changeList[(int)index];

            pfCanRecurse = 0;
            pptlNode     = null;

            return(VSConstants.E_FAIL);
        }
示例#4
0
        public int LocateExpandedList(IVsLiteTreeList child, out uint iIndex)
        {
            for (int i = 0; i < Changes.Length; i++)
            {
                if (Changes[i].GetChildren() == child)
                {
                    iIndex = (uint)i;
                    return VSConstants.S_OK;
                }
            }

            iIndex = 0;
            return VSConstants.S_FALSE;
        }
示例#5
0
        public int LocateExpandedList(IVsLiteTreeList child, out uint iIndex)
        {
            for (int i = 0; i < Changes.Length; i++)
            {
                if (Changes[i].GetChildren() == child)
                {
                    iIndex = (uint)i;
                    return(VSConstants.S_OK);
                }
            }

            iIndex = 0;
            return(VSConstants.S_FALSE);
        }
示例#6
0
 private void AddLibList(TreeViewItem parent, string header, IVsLiteTreeList theList)
 {
     if (theList == null)
         return;
     uint count;
     ErrorHandler.Succeeded(theList.GetItemCount(out count));
     var root = new TreeViewItem { Header = header + " count = " + count };
     parent.Items.Add(root);
     //for (var i = 0; i< count; i++)
     //{
     //    string item;
     //    var rc = theList.GetText((uint) i, VSTREETEXTOPTIONS.TTO_DEFAULT, out item);
     //    root.Items.Add(item);
     //}
 }
示例#7
0
        /// <summary>
        ///     An item has been expanded, get the next list
        /// </summary>
        /// <param name="index"></param>
        /// <param name="pfCanRecurse"></param>
        /// <param name="ppIVsSimplePreviewChangesList"></param>
        /// <returns></returns>
        public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
        {
            ArgumentValidation.CheckForOutOfRangeException(index, 0, _changeList.Count - 1);

            pfCanRecurse = 0;
            if (!_changeList[(int)index].IsExpandable)
            {
                pptlNode = null;
                return(VSConstants.E_NOTIMPL);
            }
            else
            {
                var previewChangesList = new PreviewChangesList(_changeList[(int)index].ChildList, _previewData, _previewBuffer);
                pptlNode = previewChangesList;
                return(VSConstants.S_OK);
            }
        }
        /// <summary>
        ///     An item has been expanded, get the next list
        /// </summary>
        /// <param name="index"></param>
        /// <param name="pfCanRecurse"></param>
        /// <param name="ppIVsSimplePreviewChangesList"></param>
        /// <returns></returns>
        public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
        {
            ArgumentValidation.CheckForOutOfRangeException(index, 0, _changeList.Count - 1);

            pfCanRecurse = 0;
            if (!_changeList[(int)index].IsExpandable)
            {
                pptlNode = null;
                return VSConstants.E_NOTIMPL;
            }
            else
            {
                var previewChangesList = new PreviewChangesList(_changeList[(int)index].ChildList, _previewData, _previewBuffer);
                pptlNode = previewChangesList;
                return VSConstants.S_OK;
            }
        }
示例#9
0
            private static void PrintList(IVsLiteTreeList list, int indent = 0) {
                uint count;
                list.GetItemCount(out count);

                
                for (int i = 0; i < count; i++) {
                    string text;
                    list.GetText((uint)i, VSTREETEXTOPTIONS.TTO_DEFAULT, out text);
                    Console.Write("{1}new ExpectedPreviewItem(\"{0}\"", text, new string(' ', indent * 4));

                    int expandable;
                    list.GetExpandable((uint)i, out expandable);
                    if (expandable != 0) {
                        Console.WriteLine(", ");
                        int canRecurse;
                        IVsLiteTreeList subList;
                        list.GetExpandedList((uint)i, out canRecurse, out subList);

                        PrintList(subList, indent + 1);
                    }

                    VSTREEDISPLAYDATA[] data = new VSTREEDISPLAYDATA[1];
                    list.GetDisplayData((uint)i, data);

                    // TODO: Validate display data

                    uint changeCnt = 0;
                    list.GetListChanges(ref changeCnt, null);

                    VSTREELISTITEMCHANGE[] changes = new VSTREELISTITEMCHANGE[changeCnt];
                    list.GetListChanges(ref changeCnt, changes);

                    // TODO: Valiate changes

                    if (i != count - 1) {
                        Console.WriteLine("),");
                    } else {
                        Console.WriteLine(")");
                    }
                }
            }
示例#10
0
            private static void VerifyList(IVsLiteTreeList list, ExpectedPreviewItem[] expected) {
                uint count;
                list.GetItemCount(out count);

                Assert.AreEqual(expected.Length, (int)count);
                for (int i = 0; i < expected.Length; i++) {
                    string text;
                    list.GetText((uint)i, VSTREETEXTOPTIONS.TTO_DEFAULT, out text);
                    Assert.AreEqual(expected[i].Name, text);

                    int expandable;
                    list.GetExpandable((uint)i, out expandable);
                    if (expected[i].Children.Length != 0) {
                        Assert.AreEqual(1, expandable);
                        int canRecurse;
                        IVsLiteTreeList subList;
                        list.GetExpandedList((uint)i, out canRecurse, out subList);

                        VerifyList(subList, expected[i].Children);
                    } else {
                        Assert.AreEqual(0, expandable);
                    }
                }
            }
示例#11
0
 public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
 {
     pfCanRecurse = Changes[index].CanRecurse;
     pptlNode = (IVsLiteTreeList)Changes[index].GetChildren();
     return VSConstants.S_OK;
 }
示例#12
0
 int IVsLibrary2.GetLibList(LIB_PERSISTTYPE lptType, out IVsLiteTreeList ppList)
 {
     throw new NotImplementedException();
 }
示例#13
0
 int IVsObjectList2.LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex)
 {
     throw new NotImplementedException();
 }
示例#14
0
 public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
 {
     pfCanRecurse = Changes[index].CanRecurse;
     pptlNode     = (IVsLiteTreeList)Changes[index].GetChildren();
     return(VSConstants.S_OK);
 }
示例#15
0
 public int LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex)
 {
     throw new NotImplementedException();
 }
示例#16
0
 /// <summary>
 ///     Called during a ReAlign command if TF_CANTRELOCATE isn't set.  Return
 ///     E_FAIL if the list can't be located, in which case the list will be discarded.
 /// </summary>
 /// <param name="pIVsSimplePreviewChangesListChild"></param>
 /// <param name="piIndex"></param>
 /// <returns></returns>
 public int LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex)
 {
     // We do not need to do anything on LocateExpandedList.
     iIndex = 0;
     return(VSConstants.E_NOTIMPL);
 }
 int IVsLibrary.GetLibList(LIB_PERSISTTYPE lptType, out IVsLiteTreeList pplist)
 {
     pplist = null;
     return VSConstants.E_NOTIMPL;
 }
示例#18
0
 int IVsObjectList2.GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
 {
     throw new NotImplementedException();
 }
示例#19
0
 int IVsObjectList2.LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex)
 {
     throw new NotImplementedException();
 }
示例#20
0
 int IVsLibrary.GetLibList(LIB_PERSISTTYPE lptType, out IVsLiteTreeList pplist)
 {
     pplist = null;
     return(VSConstants.E_NOTIMPL);
 }
示例#21
0
 public int LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex) {
     throw new NotImplementedException();
 }
示例#22
0
 int IVsObjectList2.GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 ///     Called during a ReAlign command if TF_CANTRELOCATE isn't set.  Return
 ///     E_FAIL if the list can't be located, in which case the list will be discarded.
 /// </summary>
 /// <param name="pIVsSimplePreviewChangesListChild"></param>
 /// <param name="piIndex"></param>
 /// <returns></returns>
 public int LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex)
 {
     // We do not need to do anything on LocateExpandedList.
     iIndex = 0;
     return VSConstants.E_NOTIMPL;
 }