Beispiel #1
0
 /// <summary>
 /// Begins controlling window.
 /// </summary>
 public Controller(IAnalysisView window)
 {
     this.window             = window;
     window.FileChosenEvent += HandleFileChosen;
     window.CloseEvent      += HandleClose;
     window.NewEvent        += HandleNew;
     window.CountEvent      += HandleCount;
 }
Beispiel #2
0
 /// <summary>
 /// Begins controlling window.
 /// </summary>
 public Controller(IAnalysisView window)
 {
     this.window             = window;
     this.model              = new Model();
     window.CellChanged     += SetContents;
     window.CellClickEvent  += UpdateBoxes;
     window.FileChosenEvent += HandleFileChosen;
     window.CloseEvent      += HandleClose;
     window.NewEvent        += HandleNew;
     window.SaveEvent       += HandleSave;
     window.AboutEvent      += HandleAbout;
 }
Beispiel #3
0
 public Controller(IAnalysisView window)
 {
     this.window         = window;
     ServerName          = "http://cs3500-boggle-s17.azurewebsites.net/BoggleService.svc/";
     Player2ID           = "Player2";
     Player1Score        = 0;
     Player2Score        = 0;
     FirstUpdate         = true;
     timer               = new System.Windows.Forms.Timer();
     tokenSource         = new CancellationTokenSource();
     window.GameStart   += StartMatch;
     window.Register    += RegisterUser;
     window.CancelGame  += QuitGame;
     window.WordEntered += NewWord;
     timer.Tick         += WaitingForGame;
     window.RegCancel   += CancelRegistration;
     window.JoinCancel  += CancelJoinMatch;
 }
        /// <summary>
        /// Begins controlling window.
        /// </summary>
        public Controller(IAnalysisView window, Spreadsheet ss)
        {
            this.window = window;
            this.sheet  = ss;
            var setvalues = new Dictionary <string, string>();

            foreach (string s in ss.GetNamesOfAllNonemptyCells())
            {
                setvalues.Add(s, ss.GetCellValue(s).ToString());
            }
            window.UpdateView(setvalues);
            //window.FileChosenEvent += HandleFileChosen;

            window.SetContents    += UpdateContents;
            window.GetContents    += PassBackContents;
            window.FileCloseEvent += HandleClose;
            window.NewEvent       += HandleNew;
            window.FileSaveEvent  += HandleSave;
            window.FileOpenEvent  += HandleOpen;
        }