public static RepositoryItem FromElement(Element element)
 {
     return(new RepositoryItem(
                ItemId.ForElement(element.ElementID),
                ItemId.ForPackage(element.PackageID),
                element.Name,
                element.Stereotype,
                new Dictionary <string, string>()
                ));
 }
        public static RepositoryItem FromPackage(Package package)
        {
            ItemId id       = ItemId.ForPackage(package.PackageID);
            ItemId parentId = ItemId.ForPackage(package.ParentID);
            string name     = package.Name;
            string stereotype;
            var    taggedValues = new Dictionary <string, string>();

            if (package.Element != null)
            {
                stereotype = package.Element.Stereotype;
                foreach (TaggedValue taggedValue in package.Element.TaggedValues)
                {
                    taggedValues[taggedValue.Name] = taggedValue.Value;
                }
            }
            else
            {
                stereotype = string.Empty;
            }
            return(new RepositoryItem(id, parentId, name, stereotype, taggedValues));
        }
Example #3
0
 private object GetLibraryById(int id)
 {
     return(WrapItem(repository.GetItemById(ItemId.ForPackage(id))));
 }