Esempio n. 1
0
        private CodedUIApplication <T> Create(ApplicationUnderTest applicationUnderTest)
        {
            var applicationType = typeof(T);
            ControlLocatorAttribute locatorAttribute;

            if (applicationType.TryGetAttribute(out locatorAttribute))
            {
                WindowBuilder.AssignControlAttributes(applicationUnderTest, locatorAttribute);
            }

            return(new CodedUIApplication <T>(applicationUnderTest, new T()));
        }
Esempio n. 2
0
        /// <summary>
        /// Creates the native window.
        /// </summary>
        /// <param name="windowType">Type of the window.</param>
        /// <returns>The window.</returns>
        private WinWindow CreateNativeWindow(UITestControl parent, Type windowType)
        {
            Func <UITestControl, UITestControl, Action <WinControl>, WinWindow> function;

            if (!this.windowCache.TryGetValue(windowType, out function))
            {
                function = WindowBuilder <UITestControl, WinWindow> .CreateControl(windowType);

                this.windowCache.Add(windowType, function);
            }

            return(function(parent, this.application, null));
        }