示例#1
0
 /// <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];
 }
示例#2
0
 /// <summary>
 /// Invalidate the items of the given item id.
 /// </summary>
 internal void InvalidateItems(ItemId id)
 {
     hierarchyListeners.OnInvalidateItems(id.Value);
 }
示例#3
0
 /// <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;
 }
示例#4
0
 /// <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);
 }
示例#5
0
 /// <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;
 }
示例#6
0
 /// <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);
 }
示例#7
0
 public bool Equals(ItemId other)
 {
     return (other._id == _id);
 }
示例#8
0
 /// <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);
 }
示例#9
0
 /// <summary>
 /// Does this list contain the given item id?
 /// </summary>
 public bool Contains(ItemId id)
 {
     return (referenceItems != null) && referenceItems.Contains(id);
 }
示例#10
0
 /// <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;
 }
示例#11
0
        /// <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");
        }