/// <summary> /// Gets the next sibling of the given id. /// </summary> public ItemId GetNextSibling(ItemId id) { var list = GetReferenceItems(); var index = list.IndexOf(id); if (index < 0) return ItemId.Nil; index++; if (index >= list.Count) return ItemId.Nil; return list[index]; }
/// <summary> /// Invalidate the items of the given item id. /// </summary> internal void InvalidateItems(ItemId id) { hierarchyListeners.OnInvalidateItems(id.Value); }
/// <summary> /// Gets the build item that belong to the given item id. /// </summary> internal ProjectItem GetProjectItem(ItemId itemId) { string name; if (ErrorHandler.Succeeded(GetCanonicalName(itemId.Value, out name))) return GetProjectItem(name); return null; }
/// <summary> /// Gets the next sibling of the given item id using the base implementation. /// </summary> internal ItemId GetOriginalNextSibling(ItemId id) { object property; base.GetProperty(id.Value, (int)__VSHPROPID.VSHPROPID_NextSibling, out property); return ItemId.Get(property); }
/// <summary> /// Gets the name of the given item id using the base implementation. /// </summary> internal string GetOriginalName(ItemId id) { object property; base.GetProperty(id.Value, (int)__VSHPROPID.VSHPROPID_Name, out property); return property as string; }
/// <summary> /// Gets the first child of the given item id using the base implementation. /// </summary> internal ItemId GetOriginalFirstChild(ItemId id) { object property; base.GetProperty(id.Value, (int)__VSHPROPID.VSHPROPID_FirstChild, out property); return ItemId.Get(property); }
public bool Equals(ItemId other) { return (other._id == _id); }
/// <summary> /// Is the given item id a jar reference in this list? /// </summary> public bool IsJarReference(ItemId id) { GetReferenceItems(); // Force load return jarReferenceItems.Contains(id.Value); }
/// <summary> /// Does this list contain the given item id? /// </summary> public bool Contains(ItemId id) { return (referenceItems != null) && referenceItems.Contains(id); }
/// <summary> /// Is the given item a References node? /// </summary> internal bool IsReferencesContainer(ItemId itemId) { // Try cache first if (referenceContainerItemId.HasValue) { return referenceContainerItemId.Value.Equals(itemId); } // Do full lookup object property; base.GetProperty(itemId.Value, (int) __VSHPROPID.VSHPROPID_Name, out property); var name = property as string; if (name == ReferenceContainerNode.ReferencesNodeVirtualName) { referenceContainerItemId = itemId; return true; } return false; }
/// <summary> /// Is the given item a JarReference? /// </summary> internal bool IsJarReference(ItemId itemId) { /*object property; base.GetProperty(itemId.Value, (int)__VSHPROPID.VSHPROPID_Name, out property); var name = property as string; return (name != null) && (name.EndsWith(".jar", StringComparison.OrdinalIgnoreCase));*/ var projectItem = GetProjectItem(itemId.Value); return (projectItem != null) && (projectItem.ItemType == "JarReference"); }