本文整理汇总了C#中White.Core.Factory.InitializeOption类的典型用法代码示例。如果您正苦于以下问题:C# InitializeOption类的具体用法?C# InitializeOption怎么用?C# InitializeOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InitializeOption类属于White.Core.Factory命名空间,在下文中一共展示了InitializeOption类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WindowSession
public WindowSession(ApplicationSession applicationSession, InitializeOption initializeOption)
{
this.applicationSession = applicationSession;
windowItemsMap = WindowItemsMap.Create(initializeOption, RectX.UnlikelyWindowPosition);
if (windowItemsMap.LoadedFromFile) initializeOption.NonCached();
this.initializeOption = initializeOption;
}
开发者ID:hsteinhilber,项目名称:white-project,代码行数:7,代码来源:WindowSession.cs
示例2: CreateWindow
public virtual Window CreateWindow(SearchCriteria searchCriteria, Process process, InitializeOption option, WindowSession windowSession)
{
string message =
string.Format("Couldn't find window with SearchCriteria {0} in process {1}{2}", searchCriteria, process.Id, Constants.BusyMessage);
AutomationElement element = WaitTillFound(() => finder.FindWindow(searchCriteria, process.Id), message);
return Create(element, option, windowSession);
}
开发者ID:huangzhichong,项目名称:White,代码行数:7,代码来源:WindowFactory.cs
示例3: Create
public static WindowItemsMap Create(InitializeOption initializeOption, Point currentWindowPosition)
{
if (initializeOption.NoIdentification) return new NullWindowItemsMap();
string fileLocation = FileLocation(initializeOption);
if (File.Exists(fileLocation))
{
Logger.DebugFormat("[PositionBasedSearch] Loading WindowItemsMap for: {0}, from {1}", initializeOption.Identifier, fileLocation);
WindowItemsMap windowItemsMap = null;
try
{
using (var fileStream = CreateFileStream(fileLocation))
{
windowItemsMap = (WindowItemsMap)CreateDataContractSerializer().ReadObject(fileStream);
}
}
catch (Exception ex)
{
Logger.DebugFormat("[PositionBasedSearch] Loading WindowItemsMap FAILED for: {0}, Error: {1}", initializeOption.Identifier, ex.Message);
Logger.DebugFormat("[PositionBasedSearch] Deleting WindowItemsMap for: {0}", initializeOption.Identifier);
try { File.Delete(fileLocation); }
catch (IOException) { }
}
if (windowItemsMap != null)
{
windowItemsMap.currentWindowPosition = currentWindowPosition;
windowItemsMap.loadedFromFile = true;
return windowItemsMap;
}
}
Logger.DebugFormat("[PositionBasedSearch] Creating new WindowItemsMap for: {0}", initializeOption.Identifier);
return new WindowItemsMap(fileLocation, currentWindowPosition);
}
开发者ID:ritro,项目名称:White,代码行数:35,代码来源:WindowItemsMap.cs
示例4: ModalWindow
private Window ModalWindow(Clock.Do find, InitializeOption option, WindowSession windowSession)
{
var clock = new Clock(CoreAppXmlConfiguration.Instance.BusyTimeout);
Clock.Matched matched = obj => obj != null;
Clock.Expired expired = () => null;
var automationElement = (AutomationElement) clock.Perform(find, matched, expired);
return automationElement == null ? null: Create(automationElement, option, windowSession);
}
开发者ID:hsteinhilber,项目名称:white-project,代码行数:8,代码来源:ChildWindowFactory.cs
示例5: SetUp
public virtual MainScreen SetUp(InitializeOption initializeOption)
{
WinFormTestConfiguration configuration = new WinFormTestConfiguration(string.Empty);
application = configuration.Launch();
ScreenRepository screenRepository = new ScreenRepository(application.ApplicationSession);
mainScreen = screenRepository.Get<MainScreen>("Form1", initializeOption);
return mainScreen;
}
开发者ID:tmandersson,项目名称:FastGTD,代码行数:8,代码来源:ScreenRepositoryTester.cs
示例6: WindowSession
public virtual WindowSession WindowSession(InitializeOption initializeOption)
{
if (initializeOption.Identifier == null) return new NullWindowSession();
WindowSession windowSession;
if (windowSessions.TryGetValue(initializeOption.Identifier, out windowSession)) return windowSession;
windowSession = new WindowSession(this, initializeOption);
windowSessions.Add(initializeOption.Identifier, windowSession);
return windowSession;
}
开发者ID:tmandersson,项目名称:FastGTD,代码行数:11,代码来源:ApplicationSession.cs
示例7: Create
internal static Window Create(AutomationElement element, InitializeOption option, WindowSession windowSession)
{
SpecializedWindowFactory specializedWindowFactory = specializedWindowFactories.Find(factory => factory.DoesSpecializedThis(element));
if (specializedWindowFactory != null)
{
return specializedWindowFactory.Create(element, option, windowSession);
}
var windowsFramework = new WindowsFramework(element.Current.FrameworkId);
if (windowsFramework.WinForm) return new WinFormWindow(element, option, windowSession);
if (windowsFramework.WPF) return new WPFWindow(element, WindowFactory.Desktop, option, windowSession);
if (windowsFramework.Win32) return new Win32Window(element, WindowFactory.Desktop, option, windowSession);
if (windowsFramework.UIAutomationBug) return null;
throw new UIItemSearchException(string.Format("{0} is not supported yet.", windowsFramework));
}
开发者ID:hsteinhilber,项目名称:white-project,代码行数:15,代码来源:ChildWindowFactory.cs
示例8: FindModalWindow
public virtual Window FindModalWindow(string title, Process process, InitializeOption option, AutomationElement parentWindowElement,
WindowSession windowSession)
{
var windowFinder = new AutomationElementFinder(parentWindowElement);
try
{
AutomationElement modalWindowElement = WaitTillFound(delegate
{
AutomationElement windowElement = windowFinder.FindWindow(title, process.Id) ??
finder.FindWindow(title, process.Id);
return windowElement;
}, "Could not find modal window with title: " + title);
return Create(modalWindowElement, option, windowSession);
}
catch (UIActionException e)
{
WhiteLogger.Instance.Debug(e.ToString());
return null;
}
}
开发者ID:domik82,项目名称:white,代码行数:20,代码来源:WindowFactory.cs
示例9: FindModalWindow
public virtual Window FindModalWindow(SearchCriteria searchCriteria, InitializeOption option, AutomationElement parentWindowElement, WindowSession windowSession)
{
var windowFinder = new AutomationElementFinder(parentWindowElement);
try
{
AutomationElement modalWindowElement = WaitTillFound(() =>
{
AutomationElement windowElement = windowFinder.FindWindow(searchCriteria) ??
Finder.FindWindow(searchCriteria);
return windowElement;
}, "Could not find modal window with SearchCriteria: " + searchCriteria);
return Create(modalWindowElement, option, windowSession);
}
catch (UIActionException e)
{
logger.Debug(e.ToString());
return null;
}
}
开发者ID:jesuissur,项目名称:White,代码行数:19,代码来源:WindowFactory.cs
示例10: BrowserWindow
public BrowserWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession)
: base(automationElement, windowFactory, option, windowSession)
{
}
开发者ID:jalla347,项目名称:White,代码行数:4,代码来源:BrowserWindow.cs
示例11: Desktop
private Desktop(AutomationElement automationElement, ActionListener actionListener, InitializeOption initializeOption,
WindowSession windowSession)
: base(automationElement, actionListener, initializeOption, windowSession)
{
finder = new AutomationElementFinder(automationElement);
}
开发者ID:tmandersson,项目名称:FastGTD,代码行数:6,代码来源:Desktop.cs
示例12: FindWindow
public virtual Window FindWindow(Process process, Predicate<string> match, InitializeOption initializeOption, WindowSession windowSession)
{
string message = string.Format("Could not find window matching condition. ProcessName: {0}, ProcessId: {1}, MatchingConditionMethod: {2}, MatchingConditionTarget: {3}", process.ProcessName, process.Id, match.Method, match.Target);
AutomationElement foundElement = WaitTillFound(() => FindWindowElement(process, match), message);
return Create(foundElement, initializeOption, windowSession);
}
开发者ID:domik82,项目名称:white,代码行数:6,代码来源:WindowFactory.cs
示例13: ModalWindow
public virtual Window ModalWindow(string title, InitializeOption option, WindowSession windowSession)
{
return ModalWindow(() => Finder.FindWindow(title, 0), option, windowSession);
}
开发者ID:ritro,项目名称:White,代码行数:4,代码来源:ChildWindowFactory.cs
示例14: StatusBar
public virtual StatusStrip StatusBar(InitializeOption initializeOption)
{
var statusStrip = (StatusStrip) Get(SearchCriteria.ByControlType(ControlType.StatusBar));
statusStrip.Cached = initializeOption;
statusStrip.Associate(windowSession);
return statusStrip;
}
开发者ID:hsteinhilber,项目名称:white-project,代码行数:7,代码来源:Window.cs
示例15: Create
public virtual Window Create(AutomationElement automationElement, InitializeOption initializeOption, WindowSession session)
{
return new InternetExplorerWindow(automationElement, WindowFactory.Desktop, initializeOption, session);
}
开发者ID:tmandersson,项目名称:FastGTD,代码行数:4,代码来源:InternetExplorerFactory.cs
示例16: WindowSession
public override WindowSession WindowSession(InitializeOption initializeOption)
{
return new NullWindowSession();
}
开发者ID:tmandersson,项目名称:FastGTD,代码行数:4,代码来源:NoApplicationSession.cs
示例17: ModalWindowSession
public virtual WindowSession ModalWindowSession(InitializeOption modalInitializeOption)
{
return applicationSession.WindowSession(modalInitializeOption);
}
开发者ID:hsteinhilber,项目名称:white-project,代码行数:4,代码来源:WindowSession.cs
示例18: Window
protected Window(AutomationElement automationElement, InitializeOption initializeOption,
WindowSession windowSession)
: base(automationElement, new NullActionListener(), initializeOption, windowSession)
{
InitializeWindow();
}
开发者ID:hsteinhilber,项目名称:white-project,代码行数:6,代码来源:Window.cs
示例19: FindWindow
public virtual Window FindWindow(Process process, Predicate<string> match, InitializeOption initializeOption, WindowSession windowSession)
{
AutomationElement foundElement =
WaitTillFound(() => FindWindowElement(process, match), "Could not find window matching condition");
return Create(foundElement, initializeOption, windowSession);
}
开发者ID:hsteinhilber,项目名称:white-project,代码行数:6,代码来源:WindowFactory.cs
示例20: TestConfiguration
protected TestConfiguration(string program, string commandLineArguments)
{
this.program = program;
this.commandLineArguments = commandLineArguments;
windowInitializeOption = InitializeOption.NoCache;
}
开发者ID:tmandersson,项目名称:FastGTD,代码行数:6,代码来源:TestConfiguration.cs
注:本文中的White.Core.Factory.InitializeOption类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论