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); } }
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!"); } }