Ejemplo n.º 1
0
        public static Layer Load(Property.Property property)
        {
            var layer = (Layer)Activator.CreateInstance(property.Connection);

            layer.property = property;
            return(layer);
        }
Ejemplo n.º 2
0
        private void BuildFolderProperties(DirectoryNode node)
        {
            _type = ResourceHelper.GetString("PropertiesPanel.Label.FolderProperties");

            Property.Property property;
            property = new Property.Property(ResourceHelper.GetString("PropertiesPanel.Label.Name"), Name, typeof(string), true);
            _properties.Add(property);
        }
Ejemplo n.º 3
0
        private static Property.Property ElementToProperty(XmlElement propertyEle, string fieldId)
        {
            String key   = XmlUtils.GetAttributeValue(propertyEle, "key");
            String value = XmlUtils.GetAttributeValue(propertyEle, "value");

            Property.Property property = new Property.Property(key, value);
            return(property);
        }
Ejemplo n.º 4
0
        private void BuildGenericProperties(TreeNode node)
        {
            string type = node.GetType().Name.Substring(0, node.GetType().Name.Length - 4);

            _type = type + " Properties";

            Property.Property property;
            property = new Property.Property(type + " Name", Name, typeof(string), true);
            _properties.Add(property);
        }
Ejemplo n.º 5
0
        private void BuildFileProperties(FileNode node)
        {
            _type = ResourceHelper.GetString("PropertiesPanel.Label.FileProperties");

            Property.Property property;
            property = new Property.Property(ResourceHelper.GetString("PropertiesPanel.Label.Name"), Name, typeof(string), true);
            _properties.Add(property);
            property = new Property.Property(ResourceHelper.GetString("PropertiesPanel.Label.Path"), node.BackingPath, typeof(string), true);
            _properties.Add(property);
        }
Ejemplo n.º 6
0
        private void BuildProjectProperties(ProjectNode node)
        {
            _type = ResourceHelper.GetString("PropertiesPanel.Label.ProjectProperties");

            Property.Property property;
            property = new Property.Property(ResourceHelper.GetString("PropertiesPanel.Label.Name"), _project.Name, typeof(string), true);
            _properties.Add(property);
            property = new Property.Property(ResourceHelper.GetString("PropertiesPanel.Label.Path"), _project.ProjectPath, typeof(string), true);
            _properties.Add(property);
            property = new Property.Property(ResourceHelper.GetString("PropertiesPanel.Label.Language"), _project.Language, typeof(string), true);
            _properties.Add(property);
        }
Ejemplo n.º 7
0
        private static InputField ElementToInputField(XmlElement fieldElm, string fieldId, string fieldName)
        {
            if (fieldElm == null)
            {
                return(null);
            }
            InputField inputField = (InputField)SchemaFactory.CreateField(FieldTypeEnum.INPUT);

            inputField.Id   = fieldId;
            inputField.Name = fieldName;
            //rules
            XmlElement rulesEle = XmlUtils.GetChildElement(fieldElm, "rules");

            if (rulesEle != null)
            {
                List <XmlElement> ruleEleList = XmlUtils.GetChildElements(rulesEle, "rule");
                foreach (XmlElement ruleEle in ruleEleList)
                {
                    Rule rule = ElementToRule(ruleEle, inputField.Id);
                    inputField.Add(rule);
                }
            }
            //property
            XmlElement propertiesEle = XmlUtils.GetChildElement(fieldElm, "properties");

            if (propertiesEle != null)
            {
                List <XmlElement> propertyEleList = XmlUtils.GetChildElements(propertiesEle, "property");
                foreach (XmlElement propertyEle in propertyEleList)
                {
                    Property.Property property = ElementToProperty(propertyEle, inputField.Id);
                    inputField.Add(property);
                }
            }
            //defaultValue
            XmlElement defaultValueEle = XmlUtils.GetChildElement(fieldElm, "default-value");

            if (defaultValueEle != null)
            {
                String dvalue = defaultValueEle.InnerText;
                inputField.SetDefaultValue(dvalue);
            }
            //value
            XmlElement value = XmlUtils.GetChildElement(fieldElm, "value");

            if (value != null)
            {
                inputField.Value = XmlUtils.GetElementValue(value);
            }
            return(inputField);
        }
Ejemplo n.º 8
0
        public static List <Property.Property> getPropertyList(PropertyType propertyType, bool bActiveOnly = false)
        {
            List <Property.Property> li = new List <Property.Property>();
            string    sQuery            = "SELECT * FROM property WHERE iPropertyTypeId = " + propertyType.PropertyTypeId + " AND (bActive = 1 or bActive = " + Convert.ToInt32(bActiveOnly) + ")";
            DataTable dtPropertys       = SQLDataAdapter.Query4DataTable(sQuery);

            foreach (DataRow row in dtPropertys.Rows)
            {
                Property.Property p = new Property.Property();
                p.PropertyId   = int.Parse(row["iPropertyId"].ToString());
                p.Name         = row["vProperty"].ToString();
                p.PropertyType = propertyType;
                li.Add(p);
            }
            return(li);
        }
Ejemplo n.º 9
0
        private static LabelField ElementToLabelField(XmlElement fieldElm, string fieldId, string fieldName)
        {
            if (fieldElm == null)
            {
                return(null);
            }
            LabelField labelField = (LabelField)SchemaFactory.CreateField(FieldTypeEnum.LABEL);

            labelField.Id   = fieldId;
            labelField.Name = fieldName;
            //rules
            XmlElement rulesEle = XmlUtils.GetChildElement(fieldElm, "rules");

            if (rulesEle != null)
            {
                List <XmlElement> ruleEleList = XmlUtils.GetChildElements(rulesEle, "rule");
                foreach (XmlElement ruleEle in ruleEleList)
                {
                    Rule rule = ElementToRule(ruleEle, labelField.Id);
                    labelField.Add(rule);
                }
            }
            //property
            XmlElement propertiesEle = XmlUtils.GetChildElement(fieldElm, "properties");

            if (propertiesEle != null)
            {
                List <XmlElement> propertyEleList = XmlUtils.GetChildElements(propertiesEle, "property");
                foreach (XmlElement propertyEle in propertyEleList)
                {
                    Property.Property property = ElementToProperty(propertyEle, labelField.Id);
                    labelField.Add(property);
                }
            }
            //labelGroup
            XmlElement labelGroupEle = XmlUtils.GetChildElement(fieldElm, "label-group");

            if (labelGroupEle != null)
            {
                LabelGroup labelGroup = ElementToLabelGroup(labelGroupEle, fieldId);
                labelField.SetLabelGroup(labelGroup);
            }
            return(labelField);
        }
Ejemplo n.º 10
0
 public Property.Property AddProperty(string key, string value)
 {
     Property.Property property = new Property.Property(key, value);
     this.Add(property);
     return property;
 }
Ejemplo n.º 11
0
 private static Property.Property ElementToProperty(XmlElement propertyEle, string fieldId)
 {
     String key = XmlUtils.GetAttributeValue(propertyEle, "key");
     String value = XmlUtils.GetAttributeValue(propertyEle, "value");
     Property.Property property = new Property.Property(key, value);
     return property;
 }
Ejemplo n.º 12
0
 public Property.Property AddProperty(string key, string value)
 {
     Property.Property property = new Property.Property(key, value);
     this.Add(property);
     return(property);
 }
Ejemplo n.º 13
0
 public void Add(Property.Property property)
 {
     this.properties.Add(property);
 }
Ejemplo n.º 14
0
        private static ComplexField ElementToComplexField(XmlElement fieldElm, string fieldId, string fieldName)
        {
            if (fieldElm == null)
            {
                return(null);
            }
            ComplexField complexField = (ComplexField)SchemaFactory.CreateField(FieldTypeEnum.COMPLEX);

            complexField.Id   = fieldId;
            complexField.Name = fieldName;
            XmlElement fieldsEle = XmlUtils.GetChildElement(fieldElm, "fields");

            if (fieldsEle != null)
            {
                List <XmlElement> fieldEleList = XmlUtils.GetChildElements(fieldsEle, "field");
                foreach (XmlElement subFieldEle in fieldEleList)
                {
                    Field fieldFromEle = ElementToField(subFieldEle);
                    complexField.Add(fieldFromEle);
                }
            }
            //rules
            XmlElement rulesEle = XmlUtils.GetChildElement(fieldElm, "rules");

            if (rulesEle != null)
            {
                List <XmlElement> ruleEleList = XmlUtils.GetChildElements(rulesEle, "rule");
                foreach (XmlElement ruleEle in ruleEleList)
                {
                    Rule rule = ElementToRule(ruleEle, complexField.Id);
                    complexField.Add(rule);
                }
            }
            //property
            XmlElement propertiesEle = XmlUtils.GetChildElement(fieldElm, "properties");

            if (propertiesEle != null)
            {
                List <XmlElement> propertyEleList = XmlUtils.GetChildElements(propertiesEle, "property");
                foreach (XmlElement propertyEle in propertyEleList)
                {
                    Property.Property property = ElementToProperty(propertyEle, complexField.Id);
                    complexField.Add(property);
                }
            }
            //default-complex-value
            XmlElement defaultComplexValueEle = XmlUtils.GetChildElement(fieldElm, "default-complex-values");

            if (defaultComplexValueEle != null)
            {
                List <XmlElement> defaultValuesSubFieldList = XmlUtils.GetChildElements(defaultComplexValueEle, "field");
                ComplexValue      defaultCvalue             = new ComplexValue();
                foreach (XmlElement subFiledValueEle in defaultValuesSubFieldList)
                {
                    Field field = ElementToField(subFiledValueEle);
                    defaultCvalue.Put(field);
                }
                complexField.SetDefaultValue(defaultCvalue);
            }
            //complex-value
            XmlElement complexValueEle = XmlUtils.GetChildElement(fieldElm, "complex-values");

            if (complexValueEle != null)
            {
                List <XmlElement> valuesSubFieldList = XmlUtils.GetChildElements(complexValueEle, "field");
                ComplexValue      cvalue             = new ComplexValue();
                foreach (XmlElement subFiledValueEle in valuesSubFieldList)
                {
                    Field field = ElementToField(subFiledValueEle);
                    cvalue.Put(field);
                }
                complexField.SetComplexValue(cvalue);
            }
            return(complexField);
        }
Ejemplo n.º 15
0
        private static MultiCheckField ElementToMultiCheckField(XmlElement fieldElm, string fieldId, string fieldName)
        {
            if (fieldElm == null)
            {
                return(null);
            }
            MultiCheckField multiCheckField = (MultiCheckField)SchemaFactory.CreateField(FieldTypeEnum.MULTICHECK);

            multiCheckField.Id   = fieldId;
            multiCheckField.Name = fieldName;
            //rules
            XmlElement rulesEle = XmlUtils.GetChildElement(fieldElm, "rules");

            if (rulesEle != null)
            {
                List <XmlElement> ruleEleList = XmlUtils.GetChildElements(rulesEle, "rule");
                foreach (XmlElement ruleEle in ruleEleList)
                {
                    Rule rule = ElementToRule(ruleEle, multiCheckField.Id);
                    multiCheckField.Add(rule);
                }
            }
            //option
            XmlElement optionsEle = XmlUtils.GetChildElement(fieldElm, "options");

            if (optionsEle != null)
            {
                List <XmlElement> optionEleList = XmlUtils.GetChildElements(optionsEle, "option");
                foreach (XmlElement optionEleEle in optionEleList)
                {
                    Option op = ElementToOption(optionEleEle, multiCheckField.Id);
                    multiCheckField.Add(op);
                }
            }
            //property
            XmlElement propertiesEle = XmlUtils.GetChildElement(fieldElm, "properties");

            if (propertiesEle != null)
            {
                List <XmlElement> propertyEleList = XmlUtils.GetChildElements(propertiesEle, "property");
                foreach (XmlElement propertyEle in propertyEleList)
                {
                    Property.Property property = ElementToProperty(propertyEle, multiCheckField.Id);
                    multiCheckField.Add(property);
                }
            }
            //defaultValue
            XmlElement defaultValuesEle = XmlUtils.GetChildElement(fieldElm, "default-values");

            if (defaultValuesEle != null)
            {
                List <XmlElement> defaultValueEleList = XmlUtils.GetChildElements(defaultValuesEle, "default-value");
                foreach (XmlElement defaultValueEle in defaultValueEleList)
                {
                    Value  value  = new Value();
                    String dvalue = defaultValueEle.InnerText;
                    value.PropertyValue = dvalue;
                    multiCheckField.AddDefaultValueDO(value);
                }
            }
            //value
            XmlElement valuesEle = XmlUtils.GetChildElement(fieldElm, "values");

            if (valuesEle != null)
            {
                List <XmlElement> valueEleList = XmlUtils.GetChildElements(valuesEle, "value");
                foreach (XmlElement valueEle in valueEleList)
                {
                    Value value = new Value();
                    value.PropertyValue = XmlUtils.GetElementValue(valueEle);
                    multiCheckField.AddValue(value);
                }
            }
            return(multiCheckField);
        }