internal static UmlPackageSpec Convert(PrimLibrarySpec primLibrarySpec) { var umlPackageSpec = new UmlPackageSpec { Stereotype = "PRIMLibrary", Name = primLibrarySpec.Name, TaggedValues = new[] { new UmlTaggedValueSpec("businessTerm", primLibrarySpec.BusinessTerms), new UmlTaggedValueSpec("copyright", primLibrarySpec.Copyrights), new UmlTaggedValueSpec("owner", primLibrarySpec.Owners), new UmlTaggedValueSpec("reference", primLibrarySpec.References), new UmlTaggedValueSpec("status", primLibrarySpec.Status), new UmlTaggedValueSpec("uniqueIdentifier", primLibrarySpec.UniqueIdentifier) { DefaultValue = GenerateUniqueIdentifierDefaultValue(primLibrarySpec) }, new UmlTaggedValueSpec("versionIdentifier", primLibrarySpec.VersionIdentifier), new UmlTaggedValueSpec("baseURN", primLibrarySpec.BaseURN), new UmlTaggedValueSpec("namespacePrefix", primLibrarySpec.NamespacePrefix), }, DiagramType = UmlDiagramType.Class, }; return(umlPackageSpec); }
private static string GenerateUniqueIdentifierDefaultValue(PrimLibrarySpec primLibrarySpec) { return(Guid.NewGuid().ToString()); }
public IPrimLibrary UpdatePrimLibrary(IPrimLibrary primLibrary, PrimLibrarySpec specification) { throw new NotImplementedException(); }
public IPrimLibrary CreatePrimLibrary(PrimLibrarySpec specification) { throw new NotImplementedException(); }
/// <summary> /// Updates a PRIMLibrary to match the given <paramref name="specification"/>. /// <param name="primLibrary">A PRIMLibrary.</param> /// <param name="specification">A new specification for the given PRIMLibrary.</param> /// <returns>The updated PRIMLibrary. Depending on the implementation, this might be the same updated instance or a new instance!</returns> /// </summary> public IPrimLibrary UpdatePrimLibrary(IPrimLibrary primLibrary, PrimLibrarySpec specification) { return(new UpccPrimLibrary(UmlPackage.UpdatePackage(((UpccPrimLibrary)primLibrary).UmlPackage, PrimLibrarySpecConverter.Convert(specification)))); }
/// <summary> /// Creates a PRIMLibrary based on the given <paramref name="specification"/>. /// <param name="specification">A specification for a PRIMLibrary.</param> /// <returns>The newly created PRIMLibrary.</returns> /// </summary> public IPrimLibrary CreatePrimLibrary(PrimLibrarySpec specification) { return(new UpccPrimLibrary(UmlPackage.CreatePackage(PrimLibrarySpecConverter.Convert(specification)))); }