Beispiel #1
0
 public RouterTextBox() : base()
 {
     _textBoxRouter     = new TextBoxRouter(this);
     _threadBridge      = new RouterThreadBridge();
     this.AcceptsReturn = true;
     this.ReadOnly      = true;
     this.Multiline     = true;
 }
Beispiel #2
0
 public RouterTextBox()
     : base()
 {
     m_TextBoxRouter = new TextBoxRouter(this);
      m_ThreadBridge = new RouterThreadBridge();
      this.AcceptsReturn = true;
      this.ReadOnly = true;
      this.Multiline = true;
 }
        /*****************/
        /* RouterTextBox */
        /*****************/

        public RouterTextBox() : base()
        {
            m_TextBoxRouter    = new TextBoxRouter(this);
            m_ThreadBridge     = new RouterThreadBridge();
            this.AcceptsReturn = true;
            this.IsReadOnly    = false;
            DataObject.AddPastingHandler(this, OnPaste);
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut, OnCut));
        }
Beispiel #4
0
 /*****************/
 /* RouterTextBox */
 /*****************/
 public RouterTextBox()
     : base()
 {
     m_TextBoxRouter = new TextBoxRouter(this);
      m_ThreadBridge = new RouterThreadBridge();
      this.AcceptsReturn = true;
      this.IsReadOnly = false;
      DataObject.AddPastingHandler(this,OnPaste);
      CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut,OnCut));
 }
Beispiel #5
0
        /*****************/
        /* RouterTextBox */
        /*****************/

        public RouterTextBox() : base()
        {
            m_TextBoxRouter    = new TextBoxRouter(this);
            m_ThreadBridge     = new RouterThreadBridge();
            this.AcceptsReturn = true;
            this.IsReadOnly    = false;
            DataObject.AddPastingHandler(this, OnPaste);
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut, OnCut));
            this.SelectionChanged         += new RoutedEventHandler(TextBoxSelectionChanged);
            this.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(TextBox_PreviewMouseLeftButtonUp);
        }
            /*********/
            /* Write */
            /*********/

            public override void Write(String logicalName, String printString)
            {
                RouterThreadBridge theBridge = this.m_RouterTextBox.m_ThreadBridge;

                lock (theBridge)
                {
                    if (theBridge.closed)
                    {
                        return;
                    }

                    Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal,
                                                          new Action(delegate { m_RouterTextBox.CreateTimer(printString); }));
                }
            }
Beispiel #7
0
            public override int Getc(String logicalName)
            {
                RouterThreadBridge theBridge = _routerTextBox._threadBridge;

                lock (theBridge)
                {
                    if (theBridge.Closed)
                    {
                        _routerTextBox._attachedEnv.SetHaltExecution(true);
                        return(-1);
                    }

                    if (theBridge.CharList.Count == 0)
                    {
                        theBridge.CharNeeded = true;

                        try
                        {
                            Monitor.Wait(theBridge);
                        }
                        catch (SynchronizationLockException e)
                        {
                            Console.WriteLine(e);
                        }
                        catch (ThreadInterruptedException e)
                        {
                            Console.WriteLine(e);
                        }
                    }

                    theBridge.CharNeeded = false;
                    if (theBridge.Closed)
                    {
                        _routerTextBox._attachedEnv.SetHaltExecution(true);
                        return(-1);
                    }

                    Byte theByte = theBridge.CharList[0];
                    theBridge.CharList.RemoveAt(0);

                    return(theByte);
                }
            }