コード例 #1
0
ファイル: SketchPad.cs プロジェクト: KommuSoft/CplKul2012
 private void AddQueryAnswer(QueryAnswerLocations qa)
 {
     if(qa != null) {
         QueryAnswerLocations qat = this.qas.Pop ();
         if(qat != null) {
             qat.BoundsChanged -= handleBoundsChanged;
         }
         this.qas.Push(qa);
         qa.BoundsChanged += handleBoundsChanged;
         this.handleBoundsChanged(this,EventArgs.Empty);
     }
 }
コード例 #2
0
ファイル: SketchPad.cs プロジェクト: KommuSoft/CplKul2012
 public void ExecuteQuery()
 {
     if (this.rootpiece != null && this.rootpiece.CanExecute) {
         try {
             IPuzzlePiece[] ans = this.resolver.Resolve (this.rootpiece);
             QueryAnswerLocations qal = new QueryAnswerLocations (this.rootpiece, ans);
             this.AddQueryAnswer (qal);
             qal = new QueryAnswerLocations(new RunPiece ());
             this.qas.Push(qal);
             qal.BoundsChanged += handleBoundsChanged;
             this.handleBoundsChanged(this,EventArgs.Empty);
             this.QueueDraw ();
         }
         catch (Exception e) {
             ExtensionMethods.ShowException(e);
         }
     } else {
         ExtensionMethods.ShowException("Cannot execute the query: not all required parameters have been resolved!");
     }
 }