public Stats() { instance = this; InitializeComponent(); wHandler = WindowHandler.getInstance(); wHandler.onWindowReady += onWindowReady; }
public MainWindow() { InitializeComponent(); demoIsRunning = false; FileName = null; isFileChanged = false; letter = new char[1]; isWordCompletion = false; isBackspace = false; isCurrentWordHasMatcher = new bool[MainControl.numberOfMostRelevntTries]; isStopTrieHasMatcher = true; listBox1.VisibleChanged += ( o , e ) => { if ( listBox1.Visible ) { if ( listBox1.Items.Count > 0 ) listBox1.SelectedIndex = 0; updateSuggestions(); } }; for (int i = 0; i < MainControl.numberOfMostRelevntTries; i++) isCurrentWordHasMatcher[i] = true; //this.richTextBox.TextChanged+=new System.EventHandler(this.onTextChanged); this.richTextBox.KeyDown+=new System.Windows.Forms.KeyEventHandler(this.KeyDownHandler); this.richTextBox.KeyPress+=new System.Windows.Forms.KeyPressEventHandler(this.KeyPressHandler); this.richTextBox.SelectionChanged += onPositionChanged; this.suggestionManager = new SuggestionArranger(5); foreach ( Topic t in SuggestionUtils.fringeTopics.Values ) suggestionManager.addSuggester(new OrlySuggester(t)); suggestionManager.addSuggester(new OfekSuggester()); this.suggestionManager.SuggestionEventHandler += onSuggestionEvent; this.suggestionManager.SuggestionEventHandler += Stats.instance.onSuggestionEvent; demonstrator = new Demonstrator(richTextBox,listBox1,listbox1_ItemSelected,this); demonstrator.setText(Resources.bicycle); windowHandler=WindowHandler.getInstance(); windowHandler.onWindowReady += suggestionManager.runSuggester; updateStats(); }
public static WindowHandler getInstance() { if ( instance == null ) instance = new WindowHandler(); return instance; }