ShowForm() public method

public ShowForm ( ) : void
return void
Example #1
0
        public void ButtonUIA_OnePicture()
        {
            using (var site = new RootSiteDataProviderViewBase(m_cache))
            {
                site.StyleSheet           = FixtureStyleSheet;
                site.WritingSystemFactory = m_wsManager;
                using (new SimpleRootSiteDataProviderTestsHelper(site))
                {
                    site.MakeRoot(SimpleRootSiteDataProviderBaseVc.kfragRoot, () => new OnePictureVc());
                    site.ShowForm();
                    bool fInvoked     = false;
                    var  dataProvider = new SimpleRootSiteDataProvider(site, childNavigationProvider =>
                                                                       RootSiteServices.CreateUIAutomationInvokeButtons(
                                                                           childNavigationProvider, site.RootBox,
                                                                           sel => { fInvoked = true; }));
                    var firstChild = dataProvider.Navigate(NavigateDirection.FirstChild);
                    Assert.IsNotNull(firstChild, "firstChild");
                    Assert.IsInstanceOf <UiaInvokeButton>(firstChild);
                    var button           = firstChild as UiaInvokeButton;
                    var firstButtonChild = button.Navigate(NavigateDirection.FirstChild);
                    Assert.IsNotNull(firstButtonChild, "button child control");
                    Assert.IsInstanceOf <ImageControl>(firstButtonChild, "button child control");
                    button.Invoke();
                    Assert.IsTrue(fInvoked, "Invoked");

                    var lastButtonChild = button.Navigate(NavigateDirection.LastChild);
                    Assert.AreSame(firstButtonChild, lastButtonChild);
                }
            }
        }
Example #2
0
 public void PictureCollectorEnv_OnePicture()
 {
     using (var site = new RootSiteDataProviderViewBase(m_cache))
     {
         site.StyleSheet           = FixtureStyleSheet;
         site.WritingSystemFactory = m_wsManager;
         using (new SimpleRootSiteDataProviderTestsHelper(site))
         {
             site.MakeRoot(SimpleRootSiteDataProviderBaseVc.kfragRoot, () => new OnePictureVc());
             site.ShowForm();
             var pictureSelections = CollectorEnvServices.CollectPictureSelectionPoints(site.RootBox);
             Assert.AreEqual(1, pictureSelections.Count(), "picture count");
         }
     }
 }
Example #3
0
 public void ImageControl_OnePicture()
 {
     using (var site = new RootSiteDataProviderViewBase(m_cache))
     {
         site.StyleSheet           = FixtureStyleSheet;
         site.WritingSystemFactory = m_wsManager;
         using (new SimpleRootSiteDataProviderTestsHelper(site))
         {
             site.MakeRoot(SimpleRootSiteDataProviderBaseVc.kfragRoot, () => new OnePictureVc());
             site.ShowForm();
             var dataProvider = new SimpleRootSiteDataProvider(site, childNavigationProvider =>
                                                               RootSiteServices.CreateUIAutomationImageControls(
                                                                   childNavigationProvider, site.RootBox));
             var firstChild = dataProvider.Navigate(NavigateDirection.FirstChild);
             Assert.IsNotNull(firstChild, "firstChild");
             Assert.IsInstanceOf <ImageControl>(firstChild);
             var lastChild = dataProvider.Navigate(NavigateDirection.LastChild);
             Assert.AreSame(firstChild, lastChild);
         }
     }
 }
Example #4
0
        public void ImageAndEditControls()
        {
            using (var site = new RootSiteDataProviderViewBase(m_cache))
            {
                site.StyleSheet           = FixtureStyleSheet;
                site.WritingSystemFactory = m_wsManager;
                using (new SimpleRootSiteDataProviderTestsHelper(site))
                {
                    const string  expectedText = "edit box";
                    ITsStrFactory tsStrFactory = TsStrFactoryClass.Create();
                    site.VwCache.CacheStringProp(site.RootHvo, RootSiteDataProviderViewBase.kflidSimpleTsString,
                                                 tsStrFactory.MakeString(expectedText, m_wsEng));
                    site.MakeRoot(SimpleRootSiteDataProviderBaseVc.kfragRoot, () => new OnePictureOneEditBoxVc());
                    site.ShowForm();

                    var dataProvider = new SimpleRootSiteDataProvider(site, childNavigationProvider =>
                                                                      RootSiteServices.CreateUIAutomationControls(
                                                                          childNavigationProvider, site.RootBox));
                    var firstChild = dataProvider.Navigate(NavigateDirection.FirstChild);
                    Assert.IsNotNull(firstChild, "firstChild");
                    Assert.IsInstanceOf <ImageControl>(firstChild, "firstChild");

                    var lastChild = dataProvider.Navigate(NavigateDirection.LastChild);
                    Assert.IsNotNull(lastChild);
                    Assert.AreNotSame(firstChild, lastChild);
                    Assert.IsInstanceOf <SimpleRootSiteEditControl>(lastChild, "lastChild");
                    var childTextProvider = (ITextProvider)lastChild;
                    Assert.AreEqual(expectedText, childTextProvider.DocumentRange.GetText(-1));

                    IRawElementProviderFragment nextSibling = firstChild.Navigate(NavigateDirection.NextSibling);
                    Assert.IsNotNull(nextSibling);
                    Assert.AreSame(lastChild, nextSibling);

                    IRawElementProviderFragment previousSibling = lastChild.Navigate(NavigateDirection.PreviousSibling);
                    Assert.IsNotNull(previousSibling);
                    Assert.AreSame(firstChild, previousSibling);
                }
            }
        }