public static void AddMessageButton(SilverlightControlTest testClass, String content) { testClass.EnqueueCallback(() => { TestHtmlButton = Common.GetDisplayMessageButton(TestHtmlButton); TestHtmlButton.SetStyleAttribute("width", "900px"); TestHtmlButton.SetProperty("value", content); TestHtmlButton.AttachEvent("onclick", delegate(object obj, HtmlEventArgs args) { OnTestCompleted(testClass); }); System.Windows.Browser.HtmlPage.Document.Body.AppendChild(TestHtmlButton); }); }
public static void EnableAutoTimerCallBack(SilverlightControlTest testClass, TimeSpan interval, TimeSpan duration, params Action[] actions) { TestingTimer.Interval = interval; TestingTimer.Duration = duration; TestingTimer.Tick += delegate { testClass.EnqueueCallback(actions); }; TestingTimer.OnStop += delegate { OnTestCompleted(testClass); }; testClass.EnqueueCallback(() => TestingTimer.Start()); }
public static void OnTestCompleted(SilverlightControlTest testClass) { testClass.EnqueueTestComplete(); RemoveMessageButton(TestHtmlButton); }