static MetaModel parseMetaModel(XmlDocument doc) { XmlNode metamodelNode = doc.GetElementsByTagName("metamodel").Item(0); string version = metamodelNode.Attributes["version"].Value; MetaModel metamodel = new MetaModel(version); XmlNodeList children = metamodelNode.ChildNodes; for (int i = 0; i < children.Count; i++) { Package package = parsePackage(children[i]); metamodel.AddPackage(package); } Dictionary <string, List <Connector> > .KeyCollection targetsName = targetElements.Keys; foreach (string targetName in targetsName) { Element target = null; if (declaredElements.TryGetValue(targetName, out target)) { //Console.WriteLine(target.GetPath() + " = " + targetName); foreach (Connector connector in targetElements[targetName]) { connector.Target = target; Connector clone = (Connector)connector.Clone(); clone.ParentElement = target; clone.Target = target; clone.UID = connector.ParentElement.Name + "." + clone.UID + "R"; // in order to not get the wrong connector target.AddTargetConnector(clone); } } else { //Console.WriteLine(version + " : *** WARNING *** \t Can't find type : " + targetName); } } return(metamodel); }