public void Add(BizTalkBaseObject obj, bool allowDuplicates) { if (obj == null) { throw new InvalidOperationException("Cannot add null objects to collection"); } if (this.ItemExists(obj)) { string msg = "Warning! Attempted to add duplicate item name :" + obj.Name + " QName : " + obj.QualifiedName; TraceManager.SmartTrace.TraceError(msg); if (!allowDuplicates) { throw new InvalidOperationException("DUPLICATE ADDITION DETECTED : Cannot add duplicate items to collection. Attempted to add item name :" + obj.Name + " QName : " + obj.QualifiedName); } } ArtifactKey key; if (obj is BizTalkBaseObject) { if (!string.IsNullOrEmpty(obj.Name)) { this.InnerList.Add(obj); this.AddItemToCollection(obj); } } if (this.OnObjectAdded != null) { this.OnObjectAdded(obj); } }
internal bool ItemExists(BizTalkBaseObject obj) { if (this.Count == 0) { return(false); } foreach (ArtifactEntry entry in this) { if (entry.Contains(obj)) { return(true); } } return(false); }
private void LoadOrchCorrelationSets(XmlDocument doc, XmlNamespaceManager mgr) { //===================================== // load orchestration correlation sets //===================================== if (doc != null) { try { XmlNodeList csNodes = doc.SelectNodes(".//om:Element[@Type='CorrelationDeclaration']", mgr); foreach (XmlNode csNode in csNodes) { CorrelationSet cs = new CorrelationSet(); XmlAttribute scopeAtt = csNode.Attributes.GetNamedItem("ParentLink") as XmlAttribute; if (scopeAtt != null && string.Compare(scopeAtt.Value, "Scope_CorrelationDeclaration", true) == 0) { cs.Scope = csNode.ParentNode.SelectSingleNode("om:Property[@Name='Name']", mgr).Attributes.GetNamedItem("Value").Value; } cs.Name = csNode.SelectSingleNode("om:Property[@Name='Name']", mgr).Attributes.GetNamedItem("Value").Value; cs.TypeName = csNode.SelectSingleNode("om:Property[@Name='Type']", mgr).Attributes.GetNamedItem("Value").Value; XmlNode descNode = csNode.SelectSingleNode("om:Property[@Name='AnalystComments']", mgr); if (descNode != null) { cs.Description = descNode.Attributes.GetNamedItem("Value").Value; } BizTalkBaseObject definingType = this.correlationSetTypes[cs.TypeName]; if (definingType != null) { cs.DefiningTypeId = definingType.Id; } this.correlationSets.Add(cs, true); } } catch (Exception ex) { TraceManager.SmartTrace.TraceError(ex); } } }
/// <summary> /// Adds a new object to the list /// </summary> /// <param name="obj"></param> public void Add(BizTalkBaseObject obj) { if (obj != null && !this.InnerList.Contains(obj)) { this.InnerList.Add(obj); if (obj is BizTalkBaseObject) { if (!string.IsNullOrEmpty(obj.Name)) { this.indexByName.Add(obj.Name, obj); } } if (this.OnObjectAdded != null) { this.OnObjectAdded(obj); } } }
private void Assemblies_OnObjectAdded(BizTalkBaseObject obj) { this.assemblies.Add(obj); }
private void Maps_OnObjectAdded(BizTalkBaseObject obj) { this.maps.Add(obj); }
private void Orchestrations_OnObjectAdded(BizTalkBaseObject obj) { this.orchestrations.Add(obj); }
private void Pipelines_OnObjectAdded(BizTalkBaseObject obj) { this.pipelines.Add(obj); }
private void ReceivePorts_OnObjectAdded(BizTalkBaseObject obj) { this.receivePorts.Add(obj); }
private void Schemas_OnObjectAdded(BizTalkBaseObject obj) { this.schemas.Add(obj); }
private void SendPortGroups_OnObjectAdded(BizTalkBaseObject obj) { this.sendPortGroups.Add(obj); }
private void RoleLinks_OnObjectAdded(BizTalkBaseObject obj) { this.roles.Add(obj); }
/// <summary> /// Adds a new object to the list /// </summary> /// <param name="obj"></param> public void Add(BizTalkBaseObject obj) { this.Add(obj, false); }
public bool ItemExists(BizTalkBaseObject obj) { return(this.artifactEntries.ItemExists(obj)); }
private void AddItemToCollection(BizTalkBaseObject obj) { this.artifactEntries.AddItem(obj); }
internal void AddItem(BizTalkBaseObject obj) { ArtifactEntry entry = new ArtifactEntry(obj); this.Add(entry); }