Ejemplo n.º 1
0
 public string GetComponentId()
 {
     return(Href.Split('/')[2]);
 }
Ejemplo n.º 2
0
 public string GetId()
 {
     return(Href.Split('/').LastOrDefault());
 }
Ejemplo n.º 3
0
 public string GetFileId()
 {
     return(Href.Split('/')[4]);
 }
Ejemplo n.º 4
0
        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));
            });
        }
Ejemplo n.º 5
0
 public string GetSiteId()
 {
     return(Href.Split('/')[2]);
 }