Beispiel #1
0
#pragma warning disable 1591
        protected override void OnRemove(int index, object value)
        {
            ObjectDescription ep = (ObjectDescription)value;

            if (ep.Element != null)
            {
                ep.Element.ParentNode.RemoveChild(ep.Element);
                ep.Element = null;
            }
            if (owner != null)
            {
                ep.SetParent(null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets the node types allowed in this extension.
        /// </summary>
        /// <returns>
        /// The allowed node types.
        /// </returns>
        /// <remarks>
        /// This method only works when the add-in description to which the extension belongs has been
        /// loaded from an add-in registry.
        /// </remarks>
        public ExtensionNodeTypeCollection GetAllowedNodeTypes()
        {
            ObjectDescription ob = GetExtendedObject();
            ExtensionPoint    ep = ob as ExtensionPoint;

            if (ep != null)
            {
                return(ep.NodeSet.GetAllowedNodeTypes());
            }

            ExtensionNodeDescription node = ob as ExtensionNodeDescription;

            if (node != null)
            {
                ExtensionNodeType nt = node.GetNodeType();
                if (nt != null)
                {
                    return(nt.GetAllowedNodeTypes());
                }
            }
            return(new ExtensionNodeTypeCollection());
        }
Beispiel #3
0
 /// <summary>
 /// Insert an object.
 /// </summary>
 /// <param name='index'>
 /// Insertion index.
 /// </param>
 /// <param name='ep'>
 /// The object.
 /// </param>
 public void Insert(int index, ObjectDescription ep)
 {
     List.Insert(index, ep);
 }
Beispiel #4
0
 /// <summary>
 /// Add an object.
 /// </summary>
 /// <param name='ep'>
 /// The object.
 /// </param>
 public void Add(ObjectDescription ep)
 {
     List.Add(ep);
 }
Beispiel #5
0
 /// <summary>
 /// Checks if an object is present in the collection.
 /// </summary>
 /// <param name='ob'>
 /// Object to check.
 /// </param>
 public bool Contains(ObjectDescription ob)
 {
     return(List.Contains(ob));
 }
Beispiel #6
0
 /// <summary>
 /// Removes an object.
 /// </summary>
 /// <param name='ep'>
 /// Object to remove.
 /// </param>
 public void Remove(ObjectDescription ep)
 {
     List.Remove(ep);
 }