コード例 #1
0
        private void recursiveCreateAttributeModels(Attribute attribute, IDEAAttributeGroupModel parentGroupModel)
        {
            var fieldAttributeModel = new IDEAFieldAttributeModel(attribute.RawName, attribute.DisplayName, attribute.Index,
                                                                  InputDataTypeConstants.FromDataType(attribute.DataType),
                                                                  InputDataTypeConstants.FromDataType(attribute.DataType) == InputDataTypeConstants.NVARCHAR ? "enum" : "numeric", attribute.VisualizationHints);

            fieldAttributeModel.OriginModel = this;

            if (parentGroupModel != null)
            {
                parentGroupModel.InputModels.Add(fieldAttributeModel);
            }
            else
            {
                InputModels.Add(fieldAttributeModel);
            }
        }
コード例 #2
0
        private void recursiveCreateAttributeModels(AttributeGroup attributeGroup, IDEAAttributeGroupModel parentGroupModel)
        {
            var groupModel = new IDEAAttributeGroupModel(attributeGroup.Name, attributeGroup.Name);

            groupModel.OriginModel = this;
            if (parentGroupModel != null)
            {
                parentGroupModel.InputModels.Add(groupModel);
            }
            else
            {
                InputModels.Add(groupModel);
            }
            foreach (var childGroup in attributeGroup.AttributeGroups)
            {
                recursiveCreateAttributeModels(childGroup, groupModel);
            }
            foreach (var childAttribute in attributeGroup.Attributes)
            {
                recursiveCreateAttributeModels(childAttribute, groupModel);
            }
        }