Пример #1
0
        public AxTableField buildField()
        {
            AxTableField axTableField;

            switch (this.fieldType)
            {
            case FieldType.String:
                axTableField = new Metadata.MetaModel.AxTableFieldString();
                break;

            case FieldType.Integer:
                axTableField = new Metadata.MetaModel.AxTableFieldInt();
                break;

            case FieldType.Real:
                axTableField = new Metadata.MetaModel.AxTableFieldReal();
                break;

            case FieldType.DateTime:
                axTableField = new Metadata.MetaModel.AxTableFieldUtcDateTime();
                break;

            case FieldType.Guid:
                axTableField = new Metadata.MetaModel.AxTableFieldGuid();
                break;

            case FieldType.Int64:
                axTableField = new Metadata.MetaModel.AxTableFieldInt64();
                break;

            case FieldType.Enum:
                axTableField = new Metadata.MetaModel.AxTableFieldEnum();
                break;

            case FieldType.Time:
                axTableField = new Metadata.MetaModel.AxTableFieldTime();
                break;

            case FieldType.Container:
                axTableField = new Metadata.MetaModel.AxTableFieldContainer();
                break;

            case FieldType.Memo:
                axTableField = new Metadata.MetaModel.AxTableFieldString();
                break;

            case FieldType.Date:
                axTableField = new Metadata.MetaModel.AxTableFieldDate();
                break;

            default:
                throw new NotImplementedException($"Field type {this.controller.comboBoxFieldType.ToString()} is not supported");
            }

            return(axTableField);
        }
Пример #2
0
        protected void addSpecificPropertiesToField(Metadata.MetaModel.AxTableField axTableField, AxEdt edt)
        {
            switch (fieldType)
            {
            case FieldType.Enum:
                Metadata.MetaModel.AxEdtEnum        edtEnum   = edt as Metadata.MetaModel.AxEdtEnum;
                Metadata.MetaModel.AxTableFieldEnum fieldEnum = axTableField as Metadata.MetaModel.AxTableFieldEnum;
                if (edtEnum != null && fieldEnum != null)
                {
                    fieldEnum.EnumType = edtEnum.EnumType;
                }
                break;

            default:
                break;
            }
        }