internal static UmlPackageSpec Convert(CcLibrarySpec ccLibrarySpec)
        {
            var umlPackageSpec = new UmlPackageSpec
            {
                Stereotype   = "CCLibrary",
                Name         = ccLibrarySpec.Name,
                TaggedValues = new[]
                {
                    new UmlTaggedValueSpec("businessTerm", ccLibrarySpec.BusinessTerms),
                    new UmlTaggedValueSpec("copyright", ccLibrarySpec.Copyrights),
                    new UmlTaggedValueSpec("owner", ccLibrarySpec.Owners),
                    new UmlTaggedValueSpec("reference", ccLibrarySpec.References),
                    new UmlTaggedValueSpec("status", ccLibrarySpec.Status),
                    new UmlTaggedValueSpec("uniqueIdentifier", ccLibrarySpec.UniqueIdentifier)
                    {
                        DefaultValue = GenerateUniqueIdentifierDefaultValue(ccLibrarySpec)
                    },
                    new UmlTaggedValueSpec("versionIdentifier", ccLibrarySpec.VersionIdentifier),
                    new UmlTaggedValueSpec("baseURN", ccLibrarySpec.BaseURN),
                    new UmlTaggedValueSpec("namespacePrefix", ccLibrarySpec.NamespacePrefix),
                },
                DiagramType = UmlDiagramType.Class,
            };

            return(umlPackageSpec);
        }
Ejemplo n.º 2
0
 public ICcLibrary UpdateCcLibrary(ICcLibrary ccLibrary, CcLibrarySpec specification)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 public ICcLibrary CreateCcLibrary(CcLibrarySpec specification)
 {
     throw new NotImplementedException();
 }
 private static string GenerateUniqueIdentifierDefaultValue(CcLibrarySpec ccLibrarySpec)
 {
     return(Guid.NewGuid().ToString());
 }
 /// <summary>
 /// Updates a CCLibrary to match the given <paramref name="specification"/>.
 /// <param name="ccLibrary">A CCLibrary.</param>
 /// <param name="specification">A new specification for the given CCLibrary.</param>
 /// <returns>The updated CCLibrary. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public ICcLibrary UpdateCcLibrary(ICcLibrary ccLibrary, CcLibrarySpec specification)
 {
     return(new UpccCcLibrary(UmlPackage.UpdatePackage(((UpccCcLibrary)ccLibrary).UmlPackage, CcLibrarySpecConverter.Convert(specification))));
 }
 /// <summary>
 /// Creates a CCLibrary based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a CCLibrary.</param>
 /// <returns>The newly created CCLibrary.</returns>
 /// </summary>
 public ICcLibrary CreateCcLibrary(CcLibrarySpec specification)
 {
     return(new UpccCcLibrary(UmlPackage.CreatePackage(CcLibrarySpecConverter.Convert(specification))));
 }