Пример #1
0
 public void SetMetaValue(string xmlns, string name, object value)
 {
     if (ExtensionProperties == null)
     {
         ExtensionProperties = new Dictionary <string, Dictionary <string, object> >();
     }
     ExtensionPropertyHelper.SetExtensionProperty(ExtensionProperties, xmlns, name, value);
 }
Пример #2
0
    public ObjectExtensionPropertyInfo(
        [NotNull] ObjectExtensionInfo objectExtension,
        [NotNull] Type type,
        [NotNull] string name)
    {
        ObjectExtension = Check.NotNull(objectExtension, nameof(objectExtension));
        Type            = Check.NotNull(type, nameof(type));
        Name            = Check.NotNull(name, nameof(name));

        Configuration = new Dictionary <object, object>();
        Attributes    = new List <Attribute>();
        Validators    = new List <Action <ObjectExtensionPropertyValidationContext> >();

        Attributes.AddRange(ExtensionPropertyHelper.GetDefaultAttributes(Type));
        DefaultValue = TypeHelper.GetDefaultValue(Type);
        Lookup       = new ExtensionPropertyLookupConfiguration();
    }
Пример #3
0
        public ExtensionPropertyConfiguration(
            [NotNull] EntityExtensionConfiguration entityExtensionConfiguration,
            [NotNull] Type type,
            [NotNull] string name)
        {
            EntityExtensionConfiguration = Check.NotNull(entityExtensionConfiguration, nameof(entityExtensionConfiguration));
            Type = Check.NotNull(type, nameof(type));
            Name = Check.NotNull(name, nameof(name));

            Configuration = new Dictionary <string, object>();
            Attributes    = new List <Attribute>();
            Validators    = new List <Action <ObjectExtensionPropertyValidationContext> >();

            Entity = new ExtensionPropertyEntityConfiguration();
            UI     = new ExtensionPropertyUiConfiguration();
            Api    = new ExtensionPropertyApiConfiguration();

            Attributes.AddRange(ExtensionPropertyHelper.GetDefaultAttributes(Type));
            DefaultValue = TypeHelper.GetDefaultValue(Type);
        }
Пример #4
0
 Dictionary <string, object> IHaveMetadata.GetMetadata(string ns)
 {
     return(ExtensionPropertyHelper.GetExtensionProperties(ExtensionProperties, ns));
 }
Пример #5
0
 public object GetMetaValue(string xmlns, string name)
 {
     return(ExtensionPropertyHelper.GetExtensionProperty(ExtensionProperties, xmlns, name));
 }
Пример #6
0
 public object GetDefaultValue()
 {
     return(ExtensionPropertyHelper.GetDefaultValue(Type, DefaultValueFactory, DefaultValue));
 }