コード例 #1
0
        private void AddLookupTextProperty(ExtensionPropertyConfiguration propertyInfo)
        {
            var lookupTextPropertyName = $"{propertyInfo.Name}_Text";
            var lookupTextPropertyInfo = Properties.GetOrAdd(
                lookupTextPropertyName,
                () => new ExtensionPropertyConfiguration(this, typeof(string), lookupTextPropertyName)
                );

            lookupTextPropertyInfo.DisplayName = propertyInfo.DisplayName;
        }
コード例 #2
0
        private static void NormalizeProperty(ExtensionPropertyConfiguration propertyInfo)
        {
            if (!propertyInfo.Api.OnGet.IsAvailable)
            {
                propertyInfo.UI.OnTable.IsVisible = false;
            }

            if (!propertyInfo.Api.OnCreate.IsAvailable)
            {
                propertyInfo.UI.OnCreateForm.IsVisible = false;
            }

            if (!propertyInfo.Api.OnUpdate.IsAvailable)
            {
                propertyInfo.UI.OnEditForm.IsVisible = false;
            }
        }
コード例 #3
0
 public static void ApplyPropertyConfigurationToTypes(
     ExtensionPropertyConfiguration propertyConfig,
     Type[] types)
 {
     lock (SyncLock)
     {
         ObjectExtensionManager.Instance
         .AddOrUpdateProperty(
             types,
             propertyConfig.Type,
             propertyConfig.Name,
             property =>
         {
             property.Attributes.Clear();
             property.Attributes.AddRange(propertyConfig.Attributes);
             property.DisplayName = propertyConfig.DisplayName;
             property.Validators.AddRange(propertyConfig.Validators);
             property.DefaultValue        = propertyConfig.DefaultValue;
             property.DefaultValueFactory = propertyConfig.DefaultValueFactory;
             property.Lookup = propertyConfig.UI.Lookup;
         }
             );
     }
 }