コード例 #1
0
        public EditorControl()
        {
            InitializeComponent();

            var index = Editor.AddStyle(new WavyLineStyle(255, System.Drawing.Color.Red));

            _errorRanges  = new ObservableCollection <ErrorRange>();
            _mipw         = new MathInputPanelWrapper(Messages.DrawExpression);
            _autoComplete = new AutocompletePopup(this);
            _styleIndex   = Editor.GetStyleIndexMask(new FastColoredTextBoxNS.Style[] { Editor.Styles[index] });

            SetupEditor();
            SetupMathInput();
            SetupSoftKeyboard();
            SetupHandlers();
        }
コード例 #2
0
        public ConsoleControl()
        {
            InitializeComponent();
            InputPanel.PlaceFocus = SetFocus;
            InputPanel.Insert     = InsertText;
            InputPanel.Delete     = Backspace;
            _currentHistory       = new String[0];
            CommandHistory.Add(String.Empty);

            Console.OnQueryEntered += OnQueryEntered;
            Console.OnHistoryDown  += OnHistoryDown;
            Console.OnHistoryUp    += OnHistoryUp;

            var binding = new Binding("Count");

            binding.Source    = CommandHistory;
            binding.Converter = new CountConverter();
            HistoryButton.SetBinding(Button.IsEnabledProperty, binding);

            EvaluateButton.Click          += EvaluateClick;
            AutocompleteButton.Click      += AutocompleteClick;
            HistoryButton.Click           += HistoryClick;
            CommandHistoryList.ItemsSource = CommandHistory;
            InputPanelButton.Click        += InputPanelClick;
            EditorButton.Click            += EditorClick;
            CollapseButton.Click          += CollapseButtonClick;
            ExpandButton.Click            += ExpandButtonClick;
            StopButton.Click += StopButtonClick;

            _autoComplete = new AutocompletePopup(this);
            _mipw         = new MathInputPanelWrapper(Messages.DrawExpression);

            if (!_mipw.IsAvailable)
            {
                MathInputButton.IsEnabled = false;
            }
            else
            {
                MathInputButton.Click += (s, ev) => _mipw.Open();
            }
        }