Exemplo n.º 1
0
        protected override void InitFromConfigurationElement(ObjectSchemaConfigurationElementBase schemaConfig)
        {
            base.InitFromConfigurationElement(schemaConfig);

            ObjectSchemaConfigurationElement configElem = (ObjectSchemaConfigurationElement)schemaConfig;

            this.CodeNameKey = configElem.CodeNameKey;
            this.CodeNameValidationMethod = configElem.CodeNameValidationMethod;
            this.FullPathValidationMethod = configElem.FullPathValidationMethod;

            this.IsUsersContainer       = configElem.IsUsersContainer;
            this.IsUsersContainerMember = configElem.IsUsersContainerMember;
            this.ToSchemaObjectSnapshot = configElem.ToSchemaObjectSnapshot;

            SchemaPropertyGroupSettings groupSettings = SchemaPropertyGroupSettings.GetConfig();

            foreach (ObjectSchemaClassConfigurationElement schemaClass in configElem.Groups)
            {
                if (groupSettings.Groups.ContainsKey(schemaClass.GroupName))
                {
                    this.Properties.AppendPropertiesFromConfiguration(groupSettings.Groups[schemaClass.GroupName].AllProperties);
                }
            }

            this.Operations.LoadFromConfiguration(configElem.Operations);

            this.PermissionSet.LoadFromConfiguration(configElem.PermissionSet);
        }
Exemplo n.º 2
0
        public void LoadGroupPropertiesDefineSettings()
        {
            SchemaPropertyGroupSettings settings = SchemaPropertyGroupSettings.GetConfig();

            Console.WriteLine("Group count = {0}", settings.Groups.Count);
            Assert.IsTrue(settings.Groups.Count > 0);

            settings.Groups.ForEach <SchemaPropertyGroupConfigurationElement>(g => ConfigurationOutputHelper.Output(g, Console.Out));
        }
Exemplo n.º 3
0
        public void LoadPropertiesDefine()
        {
            SchemaPropertyGroupSettings settings = SchemaPropertyGroupSettings.GetConfig();

            foreach (SchemaPropertyGroupConfigurationElement group in settings.Groups)
            {
                SchemaPropertyDefineCollection propertiesDefine = new SchemaPropertyDefineCollection(group.AllProperties);

                Console.WriteLine("Group name: {0}", group.Name);

                propertiesDefine.ForEach(pd => pd.Output(Console.Out, 1));
            }
        }
Exemplo n.º 4
0
        private static List <SchemaPropertyDefineConfigurationElement> GetPropertyDefines(HashSet <string> groupNames)
        {
            List <SchemaPropertyDefineConfigurationElement> interests = new List <SchemaPropertyDefineConfigurationElement>();

            var settings = SchemaPropertyGroupSettings.GetConfig();

            foreach (var name in groupNames)
            {
                var grp = settings.Groups[name];
                if (grp != null)
                {
                    foreach (SchemaPropertyDefineConfigurationElement ppt in grp.AllProperties)
                    {
                        if (ppt.BatchMode == PropertyBatchMode.Normal && ppt.ReadOnly == false)
                        {
                            interests.Add(ppt);
                        }
                    }
                }
            }
            return(interests);
        }
Exemplo n.º 5
0
        public void SchemaPropertyGroupSettingsTest()
        {
            var groupSettings = SchemaPropertyGroupSettings.GetConfig();

            Assert.IsTrue(groupSettings.Groups.Count > 0);
        }