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