private static XmlSchemaAnnotation GetAttributeAnnotation(ICdtSup sup)
        {
            var xml = new XmlDocument();
            // Deviation from rule [R 9C95]: Generating only a subset of the defined annotations and added some additional annotations.
            var annNodes = new List <XmlNode>();

            AddAnnotation(xml, annNodes, "PropertyTermName", sup.Name);
            AddAnnotation(xml, annNodes, "RepresentationTermName", NDR.GetBasicTypeName(sup as UpccAttribute));
            AddAnnotation(xml, annNodes, "PrimitiveTypeName", NDR.GetBasicTypeName(sup as UpccAttribute));
            AddAnnotation(xml, annNodes, "DataTypeName", sup.Cdt.Name);
            AddAnnotation(xml, annNodes, "UniqueID", sup.UniqueIdentifier);
            AddAnnotation(xml, annNodes, "VersionID", sup.VersionIdentifier);
            AddAnnotation(xml, annNodes, "DictionaryEntryName", sup.DictionaryEntryName);
            AddAnnotation(xml, annNodes, "Definition", sup.Definition);
            AddAnnotations(xml, annNodes, "BusinessTermName", sup.BusinessTerms);
            AddAnnotation(xml, annNodes, "ModificationAllowedIndicator",
                          sup.ModificationAllowedIndicator.ToString().ToLower());
            AddAnnotation(xml, annNodes, "LanguageCode", sup.LanguageCode);
            AddAnnotation(xml, annNodes, "AcronymCode", "SUP");
            var ann = new XmlSchemaAnnotation();

            ann.Items.Add(new XmlSchemaDocumentation {
                Language = "en", Markup = annNodes.ToArray()
            });
            return(ann);
        }
        private void CreateChildren(Entry entry, ICdt cdt)
        {
            foreach (Entry subEntry in entry.SubEntries)
            {
                ICdtSup sup = GetSup(cdt, subEntry.Name);

                if (sup != null)
                {
                    AddToIndex(subEntry, sup);
                }
                else
                {
                    throw new MappingError("SUP '" + subEntry.Name + "' not found.");
                }
            }
        }
 public static BdtSupSpec CloneCdtSup(ICdtSup cdtSup)
 {
     return(new BdtSupSpec
     {
         Name = cdtSup.Name,
         Definition = cdtSup.Definition,
         LanguageCode = cdtSup.LanguageCode,
         BusinessTerms = new List <string>(cdtSup.BusinessTerms),
         BasicType = cdtSup.BasicType,
         UpperBound = cdtSup.UpperBound,
         LowerBound = cdtSup.LowerBound,
         ModificationAllowedIndicator = cdtSup.ModificationAllowedIndicator,
         UsageRules = new List <string>(cdtSup.UsageRules),
     }
            );
 }
示例#4
0
 /// <summary>
 /// Removes a(n) SUP from this CDT.
 /// <param name="cdtSup">A(n) SUP.</param>
 /// </summary>
 public void RemoveCdtSup(ICdtSup cdtSup)
 {
     UmlClass.RemoveAttribute(((UpccCdtSup)cdtSup).UmlAttribute);
 }
示例#5
0
 /// <summary>
 /// Updates a(n) SUP to match the given <paramref name="specification"/>.
 /// <param name="cdtSup">A(n) SUP.</param>
 /// <param name="specification">A new specification for the given SUP.</param>
 /// <returns>The updated SUP. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public ICdtSup UpdateCdtSup(ICdtSup cdtSup, CdtSupSpec specification)
 {
     return(new UpccCdtSup(UmlClass.UpdateAttribute(((UpccCdtSup)cdtSup).UmlAttribute, CdtSupSpecConverter.Convert(specification, Name)), this));
 }
示例#6
0
 public static string GetXsdAttributeNameFromSup(ICdtSup sup)
 {
     return(GetXsdAttributeName(sup));
 }
示例#7
0
 public AttributeOrSimpleElementToSupMapping(SourceItem sourceElement, ICdtSup targetSup)
     : base(sourceElement)
 {
     Sup = targetSup;
     Cdt = Sup.Cdt;
 }
        private static string GetAttributeName(ICdtSup sup)
        {
            string name = sup.Name + NDR.GetBasicTypeName(sup as UpccAttribute);

            return(name.Replace(".", ""));
        }
示例#9
0
        public static string GetXsdAttributeNameFromSup(ICdtSup sup)
        {
            string name = sup.Name + sup.BasicType.Name;

            return(name.Replace(".", String.Empty));
        }
示例#10
0
 public PotentialSup(ICdtSup originalCdtSup)
 {
     mOriginalCdtSup = originalCdtSup;
     mChecked        = false;
 }
示例#11
0
        private static string GetAttributeName(ICdtSup sup)
        {
            string name = sup.Name + sup.BasicType.Name;

            return(name.Replace(".", ""));
        }