本文整理汇总了C#中White.Core.UIItems.WindowItems.Window类的典型用法代码示例。如果您正苦于以下问题:C# Window类的具体用法?C# Window怎么用?C# Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Window类属于White.Core.UIItems.WindowItems命名空间,在下文中一共展示了Window类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
_application = LaunchApplication();
_horizonWindow = FindMainWindow();
CustomCommandSerializer.AddKnownTypes(typeof(Background));
}
示例2: Slide
public void Slide(Window window)
{
var thumb = window.Get<Thumb>("Splitter");
double originalX = thumb.Location.X;
thumb.SlideHorizontally(50);
Assert.AreEqual(originalX + 50, thumb.Location.X);
}
示例3: RunTheApplication
public void RunTheApplication()
{
application = Application.Launch("ShopSchedule.exe");
Assume.That(application, Is.Not.Null, "Application failed to start!");
mainWindow = application.GetWindows()[0];
Assume.That(mainWindow, Is.Not.Null, "Could not find the primary window!");
}
示例4: SetUp
public void SetUp()
{
application =
Application.Launch(
@"..\..\..\Components\CustomCommands\Tests\WPFTestApplication\bin\debug\White.CustomCommands.WPFTestApplication.exe");
window = application.GetWindow("Form1");
}
示例5: FindModalWindowBasedOnSearchCriteriaWhenThereIsNoWindow
public void FindModalWindowBasedOnSearchCriteriaWhenThereIsNoWindow()
{
window = application.GetWindow("Form1", InitializeOption.NoCache);
window.Get<Button>("launchModal").Click();
Window modalWindow = window.ModalWindow(SearchCriteria.ByText("ModalForm1"), InitializeOption.NoCache);
Assert.AreEqual(null, modalWindow);
}
示例6: Slide
public void Slide(Window window)
{
var thumb = window.Get<Thumb>("Splitter");
var originalY = thumb.Location.Y;
thumb.SlideVertically(50);
Assert.AreEqual(originalY + 50, thumb.Location.Y);
}
示例7: 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;
}
示例8: AuctionSniperDriver
public AuctionSniperDriver(int timeoutMillis)
{
application = Application.Attach(ProcessName);
window = application.GetWindow("Form1");
Assert.That(window.DisplayState, Is.EqualTo(DisplayState.Restored));
}
示例9: attach
public API_VisualStudio_2010 attach()
{
GUI = VS_Process = new API_GuiAutomation("devenv");
if (VS_Process.TargetProcess.notNull())
VS_MainWindow = VS_Process.windows()[0];//MAIN_WINDOW_TITLE);
else
start();
return this;
}
示例10: GivenIAmAtANon_BlackLevel
public void GivenIAmAtANon_BlackLevel()
{
_application = Application.Launch(@"..\..\CcdAddIn.TestHarness\bin\Debug\CcdAddIn.TestHarness.exe");
_mainWindow = _application.GetWindow("MainWindow");
_mainWindow.Get<Button>("goToRedLevelButton").Click();
var firstPrinciple = _mainWindow.Get<ListBox>("principlesListView").Items[0];
Assert.That(firstPrinciple.Text, Is.StringContaining(Resource.DoNotRepeatYourself));
}
示例11: Generate
public virtual string Generate(Window window)
{
window.ReInitialize(InitializeOption.WithCache);
var stringBuilder = new StringBuilder();
var stringWriter = new StringWriter(stringBuilder);
var cscProvider = new CSharpCodeProvider();
ICodeGenerator codeGenerator = cscProvider.CreateGenerator(stringWriter);
var codeGeneratorOptions = new CodeGeneratorOptions {BlankLinesBetweenMembers = false, VerbatimOrder = false};
codeGenerator.GenerateCodeFromCompileUnit(new CodeSnippetCompileUnit(string.Format("using {0};", typeof(UIItem).Namespace)), stringWriter, codeGeneratorOptions);
codeGenerator.GenerateCodeFromCompileUnit(new CodeSnippetCompileUnit(string.Format("using {0};", typeof(Window).Namespace)), stringWriter, codeGeneratorOptions);
codeGenerator.GenerateCodeFromCompileUnit(new CodeSnippetCompileUnit(string.Format("using {0};", typeof(AppScreen).Namespace)), stringWriter, codeGeneratorOptions);
CodeNamespace codeNamespace = null;
if (S.IsNotEmpty(options.Namespace))
{
codeNamespace = new CodeNamespace(options.Namespace);
}
var classDefinition = new CodeTypeDeclaration
{
IsClass = true,
IsPartial = true,
Name = window.Title.Trim().Replace(" ", string.Empty),
TypeAttributes = TypeAttributes.Public
};
classDefinition.BaseTypes.Add(typeof (AppScreen));
var constructor = new CodeConstructor {Attributes = MemberAttributes.Family};
classDefinition.Members.Add(constructor);
constructor = new CodeConstructor {Attributes = MemberAttributes.Public};
constructor.Parameters.Add(new CodeParameterDeclarationExpression(typeof(Window), "window"));
constructor.Parameters.Add(new CodeParameterDeclarationExpression(typeof (ScreenRepository), "screenRepository"));
constructor.BaseConstructorArgs.Add(new CodeVariableReferenceExpression("window"));
constructor.BaseConstructorArgs.Add(new CodeVariableReferenceExpression("screenRepository"));
classDefinition.Members.Add(constructor);
var visitor = new CodeGenerationVisitor(new WindowCodeGenerationStrategy(options));
window.Visit(visitor);
visitor.Generate(classDefinition);
if (codeNamespace != null)
{
codeNamespace.Types.Add(classDefinition);
codeGenerator.GenerateCodeFromNamespace(codeNamespace, stringWriter, codeGeneratorOptions);
}
else
{
codeGenerator.GenerateCodeFromType(classDefinition, stringWriter, codeGeneratorOptions);
}
stringWriter.Close();
return stringBuilder.ToString();
}
示例12: CleanupApplication
public void CleanupApplication()
{
if (mainWindow != null) {
mainWindow.Close();
mainWindow = null;
}
if (application != null && application.HasExited) {
application.Kill();
application = null;
}
}
示例13: getGridData
public void getGridData(Window win)
{
Thread.Sleep(1000);
table = win.Get<Table>(SearchCriteria.ByAutomationId("grdDisplay"));
TableRows rows = table.Rows;
row = rows[0];
// below line fails even though it is identified in Spy
TableCell cell = row.Cells[0];
String ab = cell.Value.ToString();
Console.WriteLine(ab + " Cell Data");
Console.ReadLine();
}
示例14: CloseModal
protected void CloseModal(Window window)
{
Window modalWindow = null;
try
{
modalWindow = window.ModalWindow("ModalForm", InitializeOption.NoCache);
}
finally
{
if (modalWindow != null) modalWindow.Get<Button>("ok").Click();
}
}
示例15: GivenIFinishMyRetrospectiveWithASuggestionToAdvanceToTheNextLevel
public void GivenIFinishMyRetrospectiveWithASuggestionToAdvanceToTheNextLevel()
{
File.Delete(@"..\..\CcdAddIn.TestHarness\bin\Debug\repository");
File.Copy(@"..\..\repository21perfectRetrospectives", @"..\..\CcdAddIn.TestHarness\bin\Debug\repository");
_application = Application.Launch(@"..\..\CcdAddIn.TestHarness\bin\Debug\CcdAddIn.TestHarness.exe");
_mainWindow = _application.GetWindow("MainWindow");
_mainWindow.Get<Button>("retrospectiveButton").Click();
_mainWindow.Get<Button>("retrospectiveDoneButton").Click();
File.Delete("repository");
}