コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();
            this.AttachDevTools();

            _textEditor                 = this.FindControl <TextEditor>("Editor");
            _textEditor.Background      = Brushes.Transparent;
            _textEditor.ShowLineNumbers = true;
            //_textEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("C#");
            _textEditor.TextArea.TextEntered        += textEditor_TextArea_TextEntered;
            _textEditor.TextArea.TextEntering       += textEditor_TextArea_TextEntering;
            _textEditor.TextArea.IndentationStrategy = new Indentation.CSharp.CSharpIndentationStrategy();

            _addControlBtn        = this.FindControl <Button>("addControlBtn");
            _addControlBtn.Click += _addControlBtn_Click;

            _clearControlBtn        = this.FindControl <Button>("clearControlBtn");
            _clearControlBtn.Click += _clearControlBtn_Click;;

            _textEditor.TextArea.TextView.ElementGenerators.Add(_generator);

            impl = PlatformManager.CreateWindow().CreatePopup();

            this.AddHandler(PointerWheelChangedEvent, (o, i) =>
            {
                if (i.KeyModifiers != KeyModifiers.Control)
                {
                    return;
                }
                if (i.Delta.Y > 0)
                {
                    _textEditor.FontSize++;
                }
                else
                {
                    _textEditor.FontSize = _textEditor.FontSize > 1 ? _textEditor.FontSize - 1 : 1;
                }
            }, RoutingStrategies.Bubble, true);
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            this.AttachDevTools();

            _textEditor                 = this.FindControl <TextEditor>("Editor");
            _textEditor.Background      = Brushes.Transparent;
            _textEditor.ShowLineNumbers = true;
            //_textEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("C#");
            _textEditor.TextArea.TextEntered        += textEditor_TextArea_TextEntered;
            _textEditor.TextArea.TextEntering       += textEditor_TextArea_TextEntering;
            _textEditor.TextArea.IndentationStrategy = new Indentation.CSharp.CSharpIndentationStrategy();

            _addControlBtn        = this.FindControl <Button>("addControlBtn");
            _addControlBtn.Click += _addControlBtn_Click;

            _clearControlBtn        = this.FindControl <Button>("clearControlBtn");
            _clearControlBtn.Click += _clearControlBtn_Click;;

            _textEditor.TextArea.TextView.ElementGenerators.Add(_generator);

            impl = PlatformManager.CreateWindow().CreatePopup();
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Window"/> class.
 /// </summary>
 public Window()
     : this(PlatformManager.CreateWindow())
 {
 }
コード例 #4
0
ファイル: Window.cs プロジェクト: vebin/Perspex
 /// <summary>
 /// Initializes a new instance of the <see cref="Window"/> class.
 /// </summary>
 public Window()
     : base(PlatformManager.CreateWindow())
 {
     _maxPlatformClientSize = this.PlatformImpl.MaxClientSize;
 }
コード例 #5
0
ファイル: InsightWindow.cs プロジェクト: jp2masa/AvaloniaEdit
 /// <summary>
 /// Creates a new InsightWindow.
 /// </summary>
 public InsightWindow(TextArea textArea) : base(textArea, PlatformManager.CreateWindow().CreatePopup())
 {
     CloseAutomatically = true;
     AttachEvents();
     Initialize();
 }