public MainWindow()
        {
            InitializeComponent();

            _defaultCodeTypeItems = new List <CodeTypeItem>
            {
                new CodeTypeItem {
                    DisplayName = "C# Expresssion", CodeType = CodeTypes.Expression
                },
                new CodeTypeItem {
                    DisplayName = "C# Statements", CodeType = CodeTypes.Statements
                },
                new CodeTypeItem {
                    DisplayName = "C# Program", CodeType = CodeTypes.Program
                }
            };

            _currentDevice = new DeviceItem
            {
                DeviceAddress = "__LOCAL__",
                DeviceType    = DeviceTypes.Local,
                DeviceName    = "Local"
            };
            _currentCodeType = _defaultCodeTypeItems[1];
        }
Exemple #2
0
 public JsonResult CodeTypeWrite(CodeTypeItem item)
 {
     item.State   = "REG";
     item.RegDate = DateTime.Now;
     COD.Insert(item);
     return(Json(new { result = "success" }, JsonRequestBehavior.AllowGet));
 }
        private void CodeTypeComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            var newCodeType = CodeTypeComboBox.SelectedItem as CodeTypeItem;

            if (newCodeType != _currentCodeType && newCodeType != null)
            {
                _currentCodeType = newCodeType;
                SetText(true);
            }
            UpdateSendButtons();
        }
Exemple #4
0
        public MainWindow()
        {
            InitializeComponent();

            _defaultCodeTypeItems = new List<CodeTypeItem>
                {
                    new CodeTypeItem {DisplayName = "C# Expresssion", CodeType = CodeTypes.Expression},
                    new CodeTypeItem {DisplayName = "C# Statements", CodeType = CodeTypes.Statements},
                    new CodeTypeItem {DisplayName = "C# Program", CodeType = CodeTypes.Program}
                };

            _currentDevice = new DeviceItem
            {
                DeviceAddress = "__LOCAL__",
                DeviceType = DeviceTypes.Local,
                DeviceName = "Local"
            };
            _currentCodeType = _defaultCodeTypeItems[1];
        }
Exemple #5
0
 private void CodeTypeComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     var newCodeType = CodeTypeComboBox.SelectedItem as CodeTypeItem;
     if (newCodeType != _currentCodeType && newCodeType != null)
     {
         _currentCodeType = newCodeType;
         SetText(true);
     }
     UpdateSendButtons();
 }