Ejemplo n.º 1
0
 public FieldTypeWrapper(IAttributeField field)
 {
     if (field == null)
     {
         throw new ArgumentNullException("field");
     }
     _field = field;
 }
Ejemplo n.º 2
0
 public FieldAdapter(IAttributeField fld)
 {
     if (fld == null)
     {
         throw new ArgumentNullException("fld");
     }
     Field = fld;
 }
        public FieldOperationGridAdapter(IAttributeField field)
        {
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }

            _field = field;
        }
Ejemplo n.º 4
0
 public FindReplaceFieldWrapper(IAttributeField field)
 {
     if (field == null)
     {
         throw new ArgumentNullException("field");
     }
     Field     = field;
     FieldType = FindReplaceFieldType.Regular;
 }
Ejemplo n.º 5
0
        public RecalculateFieldWrapper(IAttributeField field)
        {
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }
            _field = field;

            Selected = true;
            Details  = string.Empty;
            Result   = RecalculateFieldResult.None;
        }
Ejemplo n.º 6
0
        public FieldCalculatorModel(IAttributeTable table, IAttributeField field)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }

            Table = table;
            Field = field;
        }
Ejemplo n.º 7
0
        private bool Validate(IAttributeField field)
        {
            string errorMessage;

            bool nameChanged = Model.AddField || (Model.AllowEditing && !field.Name.EqualsIgnoreCase(Model.Field.Name));

            if (nameChanged && !Model.Table.ValidateFieldName(field.Name, out errorMessage))
            {
                MessageService.Current.Info(errorMessage);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 8
0
        public FieldPropertiesModel(IAttributeTable table, IAttributeField field, bool addField, bool allowEditing)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }

            if (field == null)
            {
                field = new AttributeField();
            }

            Field    = field;
            AddField = addField;
            Table    = table;

            _allowEditing = allowEditing;
        }
Ejemplo n.º 9
0
        private bool ApplyValue(AttributeTable table, IAttributeField fld, int fieldIndex, string text)
        {
            switch (fld.Type)
            {
            case AttributeType.String:
            {
                table.EditCellValue(fieldIndex, Model.ShapeIndex, text);
                break;
            }

            case AttributeType.Integer:
            {
                int val;
                if (!Int32.TryParse(text, out val))
                {
                    MessageService.Current.Info("Failed to parse integer value: " + text);
                    return(false);
                }

                table.EditCellValue(fieldIndex, Model.ShapeIndex, val);
                break;
            }

            case AttributeType.Double:
            {
                double val;
                if (!Double.TryParse(text, out val))
                {
                    MessageService.Current.Info("Failed to parse double value: " + text);
                    return(false);
                }

                table.EditCellValue(fieldIndex, Model.ShapeIndex, val);
                break;
            }
            }

            return(true);
        }
Ejemplo n.º 10
0
 public static Field GetInternal(this IAttributeField field)
 {
     return(field.InternalObject as Field);
 }