示例#1
0
文件: Main.cs 项目: jhogan/qed
		public void SetupRoller(Roller roller){
			_rollerCount++;
			HookUpNewTab(roller);
		}
示例#2
0
文件: Main.cs 项目: jhogan/qed
		public void Roller_Prompt(Roller roller, EventArgs args){
			if (args is DialogEventArgs){
				DialogEventArgs diaArgs = (DialogEventArgs) args;
				diaArgs.DialogResults = 
					MessageBox.Show(this, diaArgs.Message, "QED", diaArgs.MessageBoxButtons, diaArgs.MessageBoxIcon, diaArgs.MessageBoxDefaultButton);
			}
			if (args is AskEventArgs){
				AskEventArgs askArgs = (AskEventArgs) args;
				InputModal im = new InputModal(askArgs.Prompt, askArgs.Questions);
				askArgs.DialogResult = im.ShowDialog(this);
				askArgs.AnswerTable = im.AnswerTable;
			}
		}
示例#3
0
文件: Main.cs 项目: jhogan/qed
		public void Roller_Report(Roller roller, QED.Business.CodePromotion.ReportEventArgs  args){
			TabPage tp = (TabPage)UI.GetTabByName(this.tabMain, "tab"  + roller.ToString());
			RichTextBox rch = (RichTextBox)UI.GetControlByName(tp, "rch"  + roller.ToString());
			if (rch != null){
				rch.Text += args.Message + "\r\n";
				System.Diagnostics.Debug.WriteLine(args.Message);
			}else{
				throw new Exception ("RichTextBox not found to report message to for roller " + roller.ToString());	
			}
		}
示例#4
0
文件: Main.cs 项目: jhogan/qed
		public void Roller_Complete(Roller roller, QED.Business.CodePromotion.ReportEventArgs args){
			_rollerCount--;
			DialogResult res = MessageBox.Show(this, "Roll: " + roller.ToString() + " is complete. \r\n" + args.Message + "\r\nClose output tab?", 
				"QED", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
			if (res == DialogResult.Yes){
				TabPage tp = (TabPage)UI.GetTabByName(this.tabMain, "tab"  + roller.ToString());
				tabMain.TabPages.Remove(tp);
			}
		}
示例#5
0
文件: Main.cs 项目: jhogan/qed
		private void HookUpNewTab(Roller roller){
			roller.OnReport += new Roller.ReportHandler(Roller_Report);			
			roller.OnCompleted += new Roller.CompletedHandler(Roller_Complete);
			roller.OnPrompt += new Roller.PromptHandler(Roller_Prompt);
			TabPage tp = this.CreateLogTab(roller.ToString());
			if (tp.Tag == null)
				tp.Tag = roller;
		}