public void AddConnection(string parent, string child, AtlasConnectionType type) { AtlasFeature parentFeature = GetFeature(parent); AtlasFeature childFeature = GetFeature(child); AddConnection(new AtlasConnection(parentFeature, childFeature, type)); }
public void ReadXml(XmlReader reader) { XmlSerializer featureSerializer = new XmlSerializer(typeof(AtlasFeature)); //Reading Features reader.ReadToFollowing("Features"); XmlReader featureReader = reader.ReadSubtree(); while (featureReader.ReadToFollowing("AtlasFeature")) { AddFeature((AtlasFeature)featureSerializer.Deserialize(featureReader)); } featureReader.Close(); reader.ReadToFollowing("RootFeature"); string rootName = reader.ReadElementContentAsString(); rootFeature = GetFeature(rootName); //Reading Connections if (!reader.Name.Equals("Connections")) { reader.ReadToFollowing("Connections"); } XmlReader connectionReader = reader.ReadSubtree(); while (connectionReader.ReadToFollowing("AtlasConnection")) { AtlasFeature child = GetFeature(reader["Child"]); AtlasFeature parent = GetFeature(reader["Parent"]); AtlasConnectionType type = (AtlasConnectionType)int.Parse(reader["Type"]); AddConnection(parent, child, type); } connectionReader.Close(); //Reading Constraints if (!reader.Name.Equals("Constraints")) { reader.ReadToFollowing("Constraints"); } XmlReader constraintReader = reader.ReadSubtree(); while (constraintReader.ReadToFollowing("AtlasConstraint")) { AtlasConstraintValidationQueue queue = new AtlasConstraintValidationQueue(constraintReader["Content"]); queue.Normalize(); AddConstraint(queue); } constraintReader.Close(); reader.Close(); }
public void AddFeature(AtlasFeature newFeature, AtlasFeature parentFeature, AtlasConnectionType type) { if (features.ContainsKey(newFeature.Name)) { throw new ArgumentException("Feature already exists"); } if (!features.ContainsKey(parentFeature.Name)) { throw new ArgumentException("Parent Feature does not exist"); } AddFeature(newFeature); AddConnection(parentFeature, newFeature, type); }
private void ReadClafer(ClaferClassNode clafer, AtlasFeature feature) { bool isAbstract = ReadAbstract(clafer.Derivations[0]); AtlasConnectionType type = ReadGCard(clafer.Derivations[1]); string name = ReadIdent(clafer.Derivations[2]); AtlasFeature newFeature = new AtlasFeature(name); newFeature.IsAbstract = isAbstract; atlas.AddFeature(newFeature, feature, type); ReadElements(clafer.Derivations[5], newFeature); }
public AtlasConnection(AtlasFeature parent, AtlasFeature child, AtlasConnectionType type) { this.parent = parent; this.child = child; this.type = type; }
public void AddConnection(AtlasFeature parent, AtlasFeature child, AtlasConnectionType type) { AddConnection(new AtlasConnection(parent, child, type)); }