當前位置: 首頁>>代碼示例>>C#>>正文


C# WindowItems.Window類代碼示例

本文整理匯總了C#中TestStack.White.UIItems.WindowItems.Window的典型用法代碼示例。如果您正苦於以下問題:C# Window類的具體用法?C# Window怎麽用?C# Window使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Window類屬於TestStack.White.UIItems.WindowItems命名空間,在下文中一共展示了Window類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetBaseCondiction

        public static CondictionScript GetBaseCondiction(AutomationElement element,Window rootWindow)
        {
            var walker =
              new System.Windows.Automation.TreeWalker(
                  System.Windows.Automation.Condition.TrueCondition);

            System.Windows.Automation.AutomationElement testparent;
            var baseCondiction = new CondictionScript();
            var paths=new List<AutomationElement>();

            GetPath(element, rootWindow, walker, paths);

            int flag = AnalyseSimpleCondiction(paths, rootWindow, baseCondiction);

            if(flag>0)
            {
                return baseCondiction;
            }
            else if(flag==0)
            {
                return new CondictionScript();
            }
            else
            {
                return null;
            }
        }
開發者ID:suriyel,項目名稱:XtmatRT,代碼行數:27,代碼來源:BaseWindowFinder.cs

示例2: New

        public virtual object New(Window window, ScreenRepository screenRepository)
        {
            var o = Activator.CreateInstance(type, window, screenRepository);
            //Get all fields, even from base types
            var fieldInfos = AllTypes(type).SelectMany(t=>t.GetFields(Entity.BindingFlag));
            foreach (var fieldInfo in fieldInfos)
            {
                if (nonInjectedTypes.Any(t=>t.IsAssignableFrom(fieldInfo.FieldType))) continue;

                object injectedObject = null;
                if (typeof(IUIItem).IsAssignableFrom(fieldInfo.FieldType))
                {
                    var interceptor = new UIItemInterceptor(SearchCondition(fieldInfo, window.Framework), window, screenRepository.SessionReport);
                    injectedObject = DynamicProxyGenerator.Instance.CreateProxy(fieldInfo.FieldType, interceptor);
                }
                else if (typeof(AppScreenComponent).IsAssignableFrom(fieldInfo.FieldType))
                {
                    var componentScreenClass = new ScreenClass(fieldInfo.FieldType);
                    injectedObject = componentScreenClass.New(window, screenRepository);
                }

                if (injectedObject != null) fieldInfo.SetValue(o, injectedObject);
            }

            return o;
        }
開發者ID:EDOlsson,項目名稱:White,代碼行數:26,代碼來源:ScreenClass.cs

示例3: Reset

        /// <summary>
        /// reset action after executing
        /// </summary>
        public override void Reset()
        {
            base.Reset();

            Window = null;
            Control = null;
        }
開發者ID:divyang4481,項目名稱:dotnetabt,代碼行數:10,代碼來源:UIAAction.cs

示例4: ClassInit

        public static void ClassInit(TestContext context)
        {
            var applicationPath = "WhiteTest.exe";

            application = Application.Launch(applicationPath);
            window = application.GetWindow("MainWindow", InitializeOption.NoCache);
        }
開發者ID:krzysztofstudniarek,項目名稱:WindowsFormsFunctionalTestsExample,代碼行數:7,代碼來源:FunctionalTests.cs

示例5: FindControl

        /// <summary>
        /// given a criteria, find a control within a window
        /// </summary>
        /// <param name="window">the containing window</param>
        /// <param name="criteria">the criteria to find the control</param>
        /// <returns>the found control. null - if not found</returns>
        public IUIItem FindControl(Window window, Dictionary<string, string> criteria)
        {
            // the "all" condition
            SearchCriteria crit = SearchCriteria.All;

            // for each criteria, AND with a new condition
            foreach (string key in criteria.Keys)
            {
                switch (key.ToLower())
                {
                    //case Constants.PropertyNames.ControlType:
                    //    crit = crit.AndControlType(GetTypeByName(criteria[key]));
                    //    break;
                    case Constants.PropertyNames.AutomationId:
                        crit = crit.AndAutomationId(criteria[key]);
                        break;
                    case Constants.PropertyNames.Text:
                        crit = crit.AndByText(criteria[key]);
                        break;
                    case Constants.PropertyNames.ClassName:
                        crit = crit.AndByClassName(criteria[key]);
                        break;
                    case Constants.PropertyNames.Index:
                        crit = crit.AndIndex(int.Parse(criteria[key]));
                        break;
                    default:
                        {
                            bool bNativeFound = false;
                            AutomationProperty[] props = window.AutomationElement.GetSupportedProperties();
                            foreach (AutomationProperty prop in props)
                            {
                                string propName = prop.ProgrammaticName.Substring(prop.ProgrammaticName.IndexOf('.') + 1);
                                propName = propName.Substring(0, propName.IndexOf("Property"));
                                if (propName.Equals(key, StringComparison.CurrentCultureIgnoreCase))
                                {
                                    crit.AndNativeProperty(prop, criteria[key]);
                                    bNativeFound = true;
                                    break;
                                }
                            }
                            if (bNativeFound)
                                break; ;
                        }
                        return null;
                };
            }

            try
            {
                // search for control with 'crit'
                IUIItem item = window.Get(crit, WaitTime);

                // return the found control
                return item;
            }
            catch(Exception)
            {
                return null;
            }
        }
開發者ID:divyang4481,項目名稱:dotnetabt,代碼行數:66,代碼來源:UIAActionManager.cs

示例6: CheckWindowExists

        //**************************************************************************************************************************************************************
        public static bool CheckWindowExists(Window mainWindow, string childWindowName)
        {
            bool window = false;

            try
            {
                List<Window> allChildWindows = mainWindow.ModalWindows();

                foreach (Window w in allChildWindows)
                {
                    if (w.Name.Equals(childWindowName) || w.Name.Contains(childWindowName))
                    {
                        window = true;
                        Thread.Sleep(int.Parse(Execution_Speed));
                        break;
                    }
                }

                return window;
            }
            catch (Exception e)
            {
                String sMessage = e.Message;
                LastException.SetLastError(sMessage);
                throw new Exception(sMessage);
            }
        }
開發者ID:nhaloi,項目名稱:QBWhiteFramework,代碼行數:28,代碼來源:Actions.cs

示例7: FindControl

        /// <summary>
        /// given a criteria, find a control within a window
        /// </summary>
        /// <param name="window">the containing window</param>
        /// <param name="criteria">the criteria to find the control</param>
        /// <returns>the found control. null - if not found</returns>
        public IUIItem FindControl(Window window, Dictionary<string, string> criteria)
        {
            // the "all" condition
            SearchCriteria crit = SearchCriteria.All;

            // for each criteria, AND with a new condition
            foreach (string key in criteria.Keys)
            {
                switch (key.ToLower())
                {
                    case Constants.PropertyNames.ControlType:
                        crit = crit.AndControlType(GetTypeByName(criteria[key]));
                        break;
                    case Constants.PropertyNames.AutomationId:
                        crit = crit.AndAutomationId(criteria[key]);
                        break;
                    case Constants.PropertyNames.Text:
                        crit = crit.AndByText(criteria[key]);
                        break;
                    default:
                        return null;
                };
            }

            // search for control with 'crit'
            IUIItem item = window.Get(crit, WaitTime);

            // return the found control
            return item;
        }
開發者ID:divyang4481,項目名稱:dotnetabt,代碼行數:36,代碼來源:UIAActionManager.cs

示例8: Initialize

 public void Initialize()
 {
     qbApp = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.Initialize(exe);
     qbWindow = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.PrepareBaseState(qbApp);
     QuickBooks.ResetQBWindows(qbApp, qbWindow, false);
     InitQB();
 }
開發者ID:vincentraj,項目名稱:QBSilk4NetWhiteFramework,代碼行數:7,代碼來源:US_Regression_CommentedReports.cs

示例9: Slide

 public void Slide(Window window)
 {
     var thumb = window.Get<Thumb>("Splitter");
     var originalY = thumb.Location.Y;
     thumb.SlideVertically(50);
     Assert.Equal(originalY + 50, thumb.Location.Y);
 }
開發者ID:EricBlack,項目名稱:White,代碼行數:7,代碼來源:VerticalThumbTest.cs

示例10: Slide

 public void Slide(Window window)
 {
     var thumb = window.Get<Thumb>("Splitter");
     double originalX = thumb.Location.X;
     thumb.SlideHorizontally(50);
     Assert.Equal(originalX + 50, thumb.Location.X);
 }
開發者ID:EricBlack,項目名稱:White,代碼行數:7,代碼來源:HorizontalThumbTest.cs

示例11: DeskSelectionModel

 public DeskSelectionModel(Window window)
 {
     deskSelection = window.Get<ComboBox>(SearchCriteria.ByAutomationId(DeskSelectionIDs.DESKSELECTIONCOMBOBOX));
     makeMeImmediatlyAvailable = window.Get<CheckBox>(SearchCriteria.ByAutomationId(DeskSelectionIDs.MAKEMEIMMEDIATELYAVAILABLECHECKBOX));
     okButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.OKBUTTON));
     cancelButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.OKBUTTON));
     closeButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.CLOSEBUTTON));
 }
開發者ID:ZeroTull,項目名稱:EC4,代碼行數:8,代碼來源:DeskSelectionModel.cs

示例12: CleanUp

        public void CleanUp()
        {
            _mainWindow.Close();
            _application.Dispose();

            _application = null;
            _mainWindow = null;
        }
開發者ID:hemantksingh,項目名稱:MusicManager,代碼行數:8,代碼來源:Given_menu_option_select_mp3_files_is_selected.cs

示例13: TestInitialize

 public void TestInitialize()
 {
     qbApp = FrameworkLibraries.AppLibs.QBDT.WhiteAPI.QuickBooks.Initialize(exe);
     qbWindow = FrameworkLibraries.AppLibs.QBDT.WhiteAPI.QuickBooks.PrepareBaseState(qbApp);
     QuickBooks.ResetQBWindows(qbApp, qbWindow);
     invoiceNumber = rand.Next(12345, 99999);
     poNumber = rand.Next(12345, 99999);
 }
開發者ID:nhaloi,項目名稱:QBWhiteFramework,代碼行數:8,代碼來源:TestCommentedReports.cs

示例14: Initialize

 public void Initialize()
 {
     Logger test = new Logger("US_Commented_Reports_Test");
     qbApp = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.Initialize(exe);
     qbWindow = FrameworkLibraries.AppLibs.WhiteAPI.QuickBooks.PrepareBaseState(qbApp);
     QuickBooks.ResetQBWindows(qbApp, qbWindow, false);
     InitQB();
 }
開發者ID:vincentraj,項目名稱:QBSilk4NetWhiteFramework,代碼行數:8,代碼來源:US_Sanity_CommentedReports.cs

示例15: OperationsPage

        public OperationsPage(Window window)
        {
            this.window = window;

            string[] operations = { "*", "/", "-", "+", "=" };

            operationButtons = operations.ToDictionary(o => o, o => window.Get<Button>(SearchCriteria.ByText(o)));
        }
開發者ID:jazz-any,項目名稱:CalcUT,代碼行數:8,代碼來源:OperationsPage.cs


注:本文中的TestStack.White.UIItems.WindowItems.Window類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。