Ejemplo n.º 1
0
        public static KnownExtendedProperties Instance()
        {
            if (ThisInstance == null)
            {
                ThisInstance = new KnownExtendedProperties();
            }

            return(ThisInstance);
        }
Ejemplo n.º 2
0
        public static string GetComments(ServiceObject owner, PropertyDefinitionBase propDef)
        {
            ExtendedPropertyDefinition exPropDef = propDef as ExtendedPropertyDefinition;

            if (exPropDef != null)
            {
                return(GetComments(KnownExtendedProperties.Instance().GetKnownExtendedPropertyInfo(
                                       exPropDef)));
            }

            return(string.Empty);
        }
Ejemplo n.º 3
0
        public static string GetAlternateNames(PropertyDefinitionBase propDef)
        {
            ExtendedPropertyDefinition exPropDef = propDef as ExtendedPropertyDefinition;

            if (exPropDef != null)
            {
                return(GetAlternateNames(KnownExtendedProperties.Instance().GetKnownExtendedPropertyInfo(
                                             exPropDef)));
            }

            return(string.Empty);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Get property information for a schema property or extended property
        /// using a ServiceObject and a PropertyDefinitionBase.
        /// </summary>
        /// <param name="owner">The ServiceObject whose owns the property to interpret.</param>
        /// <param name="propDef">Property definition used to get type and value information
        /// from.</param>
        public PropertyInterpretation(ServiceObject owner, PropertyDefinitionBase propDef)
        {
            Name      = GetPropertyName(propDef);
            Value     = GetPropertyValue(owner, propDef, out TypeName);
            SmartView = GetSmartView(owner, propDef);

            ExtendedPropertyDefinition exPropDef = propDef as ExtendedPropertyDefinition;

            if (exPropDef != null)
            {
                KnownExtendedPropertyInfo?propInfo = KnownExtendedProperties.Instance().GetKnownExtendedPropertyInfo(
                    exPropDef);

                if (propInfo.HasValue)
                {
                    AlternateNames = GetAlternateNames(propInfo.Value);
                    Comments       = GetComments(propInfo.Value);
                }
            }
        }