public void TextChanged(object sender, EventArgs e) { RichTextBox richTextBox = (RichTextBox)sender; if (richTextBox.InvokeRequired) { TextChangedDelegate textChangedDelegate = new TextChangedDelegate(TextChanged); richTextBox.Invoke(textChangedDelegate, new object[] { sender, e }); } else { string text = richTextBox.Text; int value; int.TryParse(text, out value); if (value > 0 && value < 10) { Board.SetValue(X, Y, value); richTextBox.ReadOnly = true; richTextBox.MouseLeave -= new System.EventHandler(this.MouseLeave); Board.FigureStuffOut(); //UpdateGui.BeginInvoke(null, null, null, null); UpdateGui.Invoke(null, null); } } }
internal UpdateAppContext( bool silentUpdate, bool startInTray ) { try { //Instantiate the component Module to hold everything mComponents = new System.ComponentModel.Container(); frmUpdate = new UpdateGui(); frmUpdate.FormClosed += new FormClosedEventHandler( frmUpdate_FormClosed ); if( startInTray ) { InitTray(); } else { frmUpdate.Show(); } if( silentUpdate ) { frmUpdate.SilentUpdate = true; frmUpdate.StartUpdate(); } } catch( Exception e ) { logger.Fatal( "App Context fail. {0}", e.ToString() ); } //mDisplayForm_Click( null, null ); }
public void SetPossibleValues(object sender, string values) { RichTextBox richTextBox = (RichTextBox)sender; if (richTextBox.InvokeRequired) { SetValuesDelegate setValuesDelegate = new SetValuesDelegate(SetPossibleValues); richTextBox.Invoke(setValuesDelegate, new object[] { sender, values }); } else { if (richTextBox.Text != values) { richTextBox.Text = values; //UpdateGui.BeginInvoke(null, null, null, null); UpdateGui.Invoke(null, null); } } }
void initializeScripts() { Time.timeScale=1; globe = GameObject.Find("WorldGlobe"); gravitationalField = GameObject.Find ("GravitationalField"); handleInitialLevelUpdateScript = gameObject.GetComponent<HandleInitialLevelUpdate>(); makeWaveScript = gameObject.GetComponent<MakeWave>(); updateGuiScript = gameObject.GetComponent<UpdateGui>(); handleLevelUpdatesScript = gameObject.GetComponent<HandleLevelUpdates>(); handleGlobeScript = globe .GetComponent<HandleGlobe>(); hasFinishBeenHandled = false; pressedStartWave = false; canBuildSiege = false; canBuildNuclear = false; canBuildChainLightning = false; canBuildRecycling = false; }