internal void MergeWith(string thisAddinId, ExtensionNodeSet other) { foreach (ExtensionNodeType nt in other.NodeTypes) { if (nt.AddinId != thisAddinId && !NodeTypes.Contains(nt)) { NodeTypes.Add(nt); } } NodeSets.MergeWith(thisAddinId, other.NodeSets); }
/// <summary> /// Copies data from another node set /// </summary> /// <param name='nset'> /// Node set from which to copy /// </param> public void CopyFrom(ExtensionNodeSet nset) { id = nset.id; NodeTypes.Clear(); foreach (ExtensionNodeType nt in nset.NodeTypes) { ExtensionNodeType cnt = new ExtensionNodeType(); cnt.CopyFrom(nt); NodeTypes.Add(cnt); } NodeSets.Clear(); foreach (string ns in nset.NodeSets) { NodeSets.Add(ns); } missingNodeSetId = nset.missingNodeSetId; }
internal override void Read(BinaryXmlReader reader) { path = reader.ReadStringValue("path"); name = reader.ReadStringValue("name"); if (!reader.IgnoreDescriptionData) { description = reader.ReadStringValue("description"); } rootAddin = reader.ReadStringValue("rootAddin"); addins = (List <string>)reader.ReadValue("addins", new List <string> ()); nodeSet = (ExtensionNodeSet)reader.ReadValue("NodeSet"); conditions = (ConditionTypeDescriptionCollection)reader.ReadValue("Conditions", new ConditionTypeDescriptionCollection(this)); defaultInsertBefore = reader.ReadStringValue("defaultInsertBefore"); defaultInsertAfter = reader.ReadStringValue("defaultInsertAfter"); if (nodeSet != null) { nodeSet.SetParent(this); } }
void GetAllowedNodeTypes(Hashtable visitedSets, ExtensionNodeTypeCollection col) { if (Id.Length > 0) { if (visitedSets.Contains(Id)) { return; } visitedSets [Id] = Id; } // Gets all allowed node types, including those defined in node sets // It only works for descriptions generated from a registry foreach (ExtensionNodeType nt in NodeTypes) { col.Add(nt); } AddinDescription desc = ParentAddinDescription; if (desc == null || desc.OwnerDatabase == null) { return; } foreach (string[] ns in NodeSets.InternalList) { string startAddin = ns [1]; if (startAddin == null || startAddin.Length == 0) { startAddin = desc.AddinId; } ExtensionNodeSet nset = desc.OwnerDatabase.FindNodeSet(ParentAddinDescription.Domain, startAddin, ns[0]); if (nset != null) { nset.GetAllowedNodeTypes(visitedSets, col); } } }
internal void SetNodeSet(ExtensionNodeSet nset) { // Used only by the addin updater nodeSet = nset; nodeSet.SetParent(this); }