예제 #1
0
        private void Initialize()
        {
            this.NumChangeCommand = new UserCommand(this.ExecuteNumChangeCommand);
            this.NewGameCommand   = new UserCommand(this.ExecuteNewGameCommand);
            this.AnswerCommand    = new UserCommand(this.ExecuteAnswerCommand);
            this.OKCommand        = new UserCommand(this.ExecuteOKCommand);
            this.IsOKEnable       = true;
            this.isAnswerEnable   = false;
            this.startTime        = DateTime.Now;
            this.endTime          = DateTime.MinValue;

            if (AppSetting.Settings.HasCustomizeSudoku())
            {
                this.Riddle = AppSetting.Settings.CustomizeSudoku;
            }
            else
            {
                this.Riddle = BrickNode.CreateNoneSudoku();
            }

            this.LoadFinished = true;

            timer       = new DispatcherTimer();
            timer.Tick += (s, e) =>
            {
            };
            timer.Interval = TimeSpan.FromMilliseconds(NewGameSpan);
        }
예제 #2
0
 private void StartNewGame()
 {
     //Create new and empty sudoku.
     this.Riddle         = BrickNode.CreateNoneSudoku();
     this.IsOKEnable     = true;
     this.IsAnswerEnable = false;
     this.TimerState     = CalculagraphState.Stop;
     this.TimerState     = CalculagraphState.Reset;
     this.startTime      = DateTime.Now;
     this.endTime        = DateTime.MinValue;
 }