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