コード例 #1
0
        void Create(DbTypesEnum enumValue)
        {
            var type = ByteParserFactory.Create(enumValue);
            SingleFieldExplporer newItem = new SingleFieldExplporer();

            newItem.EnumValue                  = enumValue;
            newItem.CustomDisplayText          = type.TypeName;
            newItem.ButtonText                 = "Add";
            newItem.CustomButtonPressedCommand = new RelayCommand <SingleFieldExplporer>(OnButtonPressed);
            Fields.Add(newItem);
        }
コード例 #2
0
        void UpdateViewModel(SingleFieldExplporer viewModelRef, byte[] data, int index)
        {
            var parser = ByteParserFactory.Create(viewModelRef.EnumValue);
            var result = parser.TryDecode(data, index, out string value, out var _, out string error);

            if (result == false)
            {
                viewModelRef.ValueText        = "Error:" + error;
                viewModelRef.BackgroundColour = new SolidColorBrush(Colors.Pink);
            }
            else
            {
                viewModelRef.ValueText        = value;
                viewModelRef.BackgroundColour = new SolidColorBrush(Colors.White);
            }
        }
コード例 #3
0
 void OnButtonPressed(SingleFieldExplporer explporer)
 {
     _tableDefEditor.AddNewDefinitionItem(explporer.EnumValue);
 }