public string GetComponentId() { return(Href.Split('/')[2]); }
public string GetId() { return(Href.Split('/').LastOrDefault()); }
public string GetFileId() { return(Href.Split('/')[4]); }
void CompareClasses(Action <Func <IEnumerable <XElement>, IEnumerable <object> >, Func <string, string> > compare) { compare( elements => { XName umlPackage = elements.First().GetNamespaceOfPrefix("uml").GetName("Package"); XName umlModel = elements.First().GetNamespaceOfPrefix("uml").GetName("Model"); var allClassElements = from c in elements let Href = GetAttributeValue(c, "href", string.Empty) where c.Name != "nestedClassifier" && (GetXmiType(c) == "uml:Class" || GetXmiType(c) == "uml:AssociationClass") && string.IsNullOrEmpty(Href) let Name = string.IsNullOrEmpty(Href) ? GetName(c) : Href.Split(new char[] { '#' }).Last() let OwningPackageName = GetOwningPackageName(c) orderby OwningPackageName, Name select new { Name, ElementKind = (GetXmiType(c) == "uml:Class") ? "Class" : "AssociationClass", Href, Visibility = GetVisibility(c), IsAbstract = GetIsAbstract(c), IsActive = GetIsActive(c), IsLeaf = GetIsLeaf(c), OwningPackageName }; return(from e in allClassElements.Distinct() select new { e.Name, e.ElementKind, e.Visibility, e.IsAbstract, e.IsActive, e.IsLeaf, e.OwningPackageName, }); }, folderClause => { return(string.Format(@"select c.Name, c.IsAbstract, c.IsActive, c.IsLeaf, c.ElementKind, c.Visibility, p.Name as OwningPackageName from [Microsoft.Uml2].[Classes] as c left join [Microsoft.Uml2].[Packages] as p on c.OwningPackage = p.Id And c.Folder = p.Folder join [Microsoft.Uml2].[UmlResources] ur on ur.Id = c.ResourceId join [Microsoft.Uml2].[UmlResourceStems] us on ur.Stem = us.Id where (c.ElementKind='Class' or c.ElementKind='AssociationClass') and c.{0} and c.Class is Null order by OwningPackageName, c.Name", folderClause)); }); }
public string GetSiteId() { return(Href.Split('/')[2]); }