Пример #1
0
 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);
     });
 }
Пример #2
0
        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());
        }
Пример #3
0
        public static void OnTestCompleted(SilverlightControlTest testClass)
        {
            testClass.EnqueueTestComplete();

            RemoveMessageButton(TestHtmlButton);
        }
Пример #4
0
 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);
     });
 }
Пример #5
0
        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());
        }
Пример #6
0
        public static void OnTestCompleted(SilverlightControlTest testClass)
        {
           
            testClass.EnqueueTestComplete();
          
            RemoveMessageButton(TestHtmlButton);

           
        }