public RouterTextBox() : base() { _textBoxRouter = new TextBoxRouter(this); _threadBridge = new RouterThreadBridge(); this.AcceptsReturn = true; this.ReadOnly = true; this.Multiline = true; }
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)); }
/*****************/ /* 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)); }
/*****************/ /* 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); })); } }
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); } }