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; }
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); }
int IVsLiteTreeList.GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode) { var node = changeList[(int)index]; pfCanRecurse = 0; pptlNode = null; return(VSConstants.E_FAIL); }
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; }
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); }
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); //} }
/// <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; } }
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(")"); } } }
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); } } }
public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode) { pfCanRecurse = Changes[index].CanRecurse; pptlNode = (IVsLiteTreeList)Changes[index].GetChildren(); return VSConstants.S_OK; }
int IVsLibrary2.GetLibList(LIB_PERSISTTYPE lptType, out IVsLiteTreeList ppList) { throw new NotImplementedException(); }
int IVsObjectList2.LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex) { throw new NotImplementedException(); }
public int GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode) { pfCanRecurse = Changes[index].CanRecurse; pptlNode = (IVsLiteTreeList)Changes[index].GetChildren(); return(VSConstants.S_OK); }
public int LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex) { 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); }
int IVsLibrary.GetLibList(LIB_PERSISTTYPE lptType, out IVsLiteTreeList pplist) { pplist = null; return VSConstants.E_NOTIMPL; }
int IVsObjectList2.GetExpandedList(uint index, out int pfCanRecurse, out IVsLiteTreeList pptlNode) { throw new NotImplementedException(); }
int IVsObjectList2.LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex) { throw new NotImplementedException(); }
int IVsLibrary.GetLibList(LIB_PERSISTTYPE lptType, out IVsLiteTreeList pplist) { pplist = null; return(VSConstants.E_NOTIMPL); }
public int LocateExpandedList(IVsLiteTreeList ExpandedList, out uint iIndex) { throw new NotImplementedException(); }
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; }