public FieldEditorViewModel(FieldModel fieldModel)
        {
            if (fieldModel == null)
                throw new ArgumentNullException(nameof(fieldModel));

            _fieldModel = fieldModel;

            EditOptionsCommand = new RelayCommand(EditOptions, () => CanEditOptions);
        }
 public FLOAT32RuntimeField(FieldModel fieldModel)
     : base(fieldModel)
 {
     _editor = new RuntimeFieldEditor<DoubleUpDown>(
        fieldModel.Name,
        new DoubleUpDown()
         {
             Minimum = Single.MinValue,
             Maximum = Single.MaxValue,
             VerticalAlignment = VerticalAlignment.Stretch,
             HorizontalAlignment = HorizontalAlignment.Stretch,
             Margin = new Thickness(0),
             BorderThickness = new Thickness(0)
         });
 }
 public INT32RuntimeField(FieldModel fieldModel)
     : base(fieldModel)
 {
     _editor = new RuntimeFieldEditor<LongUpDown>(
         fieldModel.Name,
         new LongUpDown()
         {
             Minimum = Int32.MinValue,
             Maximum = Int32.MaxValue,
             VerticalAlignment = VerticalAlignment.Stretch,
             HorizontalAlignment = HorizontalAlignment.Stretch,
             Margin = new Thickness(0),
             BorderThickness = new Thickness(0),
             ClipValueToMinMax = true
         });
 }
        public FIXED16RuntimeField(FieldModel fieldModel)
            : base(fieldModel)
        {
            _options = new FixedPointOptionWrapper(fieldModel.Options);

             _editor = new RuntimeFieldEditor<DoubleUpDown>(
                fieldModel.Name,
                new DoubleUpDown()
                {
                    VerticalAlignment = VerticalAlignment.Stretch,
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    Margin = new Thickness(0),
                    BorderThickness = new Thickness(0),
                    ClipValueToMinMax = true,
                    Minimum = Int16.MinValue / _options.Scale,
                    Maximum = Int16.MaxValue / _options.Scale
                });
        }
        protected BITRuntimeFieldBase(FieldModel fieldModel, int numberOfBits)
            : base(fieldModel)
        {
            var optionWrapper = new BITOptionWrapper(fieldModel.Options, numberOfBits);

            string[] names = optionWrapper.GetNames();

            //Create tuples that contain the display name
            var tuples = names
                .Select(n => new Tuple<string, RuntimeFieldEditor<CheckBox>>(
                    n,
                    new RuntimeFieldEditor<CheckBox>(fieldModel.Name + " - " + n, new CheckBox())))
                .ToArray();

            _allFieldEditors = tuples
                .Select(t => t.Item2)
                .ToArray();

            _displayedFieldEditors = tuples
                .Where(t => !string.IsNullOrWhiteSpace(t.Item1))
                .Select(t => t.Item2)
                .ToArray();
        }
 public override sealed int GetSize(FieldModel fieldModel)
 {
     return _numberOfBits / 8;
 }
 public abstract override IRuntimeField CreateRuntimeField(FieldModel fieldModel);
 public BIT32RuntimeField(FieldModel fieldModel)
     : base(fieldModel, 32)
 {
 }
 public override IRuntimeField CreateRuntimeField(FieldModel fieldModel)
 {
     return new FLOAT32RuntimeField(fieldModel);
 }
        private FieldEditorViewModel CreateNewEntry()
        {
            var fieldModel = new FieldModel();

            return new FieldEditorViewModel(fieldModel);
        }
 public BIT8RuntimeField(FieldModel fieldModel)
     : base(fieldModel, 8)
 {
 }
 protected RuntimeFieldBase(FieldModel fieldModel)
 {
     _fieldModel = fieldModel;
 }
 public BIT16RuntimeField(FieldModel fieldModel)
     : base(fieldModel, 16)
 {
 }
 public abstract int GetSize(FieldModel fieldModel);
 public abstract IRuntimeField CreateRuntimeField(FieldModel fieldModel);
 public override IRuntimeField CreateRuntimeField(FieldModel fieldModel)
 {
     return new INT8RuntimeField(fieldModel);
 }
 public override int GetSize(FieldModel fieldModel)
 {
     return 1;
 }
 public override IRuntimeField CreateRuntimeField(FieldModel fieldModel)
 {
     return new FIXED16RuntimeField(fieldModel);
 }