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


C# WindowItems.Window類代碼示例

本文整理匯總了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));
        }
開發者ID:abolourian,項目名稱:WhiteCustomCommands,代碼行數:7,代碼來源:MyTextBoxTests.cs

示例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);
 }
開發者ID:ritro,項目名稱:White,代碼行數:7,代碼來源:HorizontalThumbTest.cs

示例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!");
 }
開發者ID:hsteinhilber,項目名稱:ShopSchedule,代碼行數:7,代碼來源:ShellActions.cs

示例4: SetUp

 public void SetUp()
 {
     application =
         Application.Launch(
             @"..\..\..\Components\CustomCommands\Tests\WPFTestApplication\bin\debug\White.CustomCommands.WPFTestApplication.exe");
     window = application.GetWindow("Form1");
 }
開發者ID:domik82,項目名稱:white,代碼行數:7,代碼來源:WPFCustomCommandsTest.cs

示例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);
 }
開發者ID:huangzhichong,項目名稱:White,代碼行數:7,代碼來源:WPFModalWindowTest.cs

示例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);
 }
開發者ID:ritro,項目名稱:White,代碼行數:7,代碼來源:VerticalThumbTest.cs

示例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;
        }
開發者ID:jasongdove,項目名稱:White,代碼行數:26,代碼來源:ScreenClass.cs

示例8: AuctionSniperDriver

        public AuctionSniperDriver(int timeoutMillis)
        {
            application = Application.Attach(ProcessName);

            window = application.GetWindow("Form1");

            Assert.That(window.DisplayState, Is.EqualTo(DisplayState.Restored));
        }
開發者ID:ChrisFewtrell,項目名稱:GOOS-Walkthrough,代碼行數:8,代碼來源:AuctionSniperDriver.cs

示例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;
		}
開發者ID:pusp,項目名稱:o2platform,代碼行數:9,代碼來源:API_VisualStudio_2010.cs

示例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));
        }
開發者ID:PapaMufflon,項目名稱:CcdAddIn,代碼行數:9,代碼來源:Retrospective.cs

示例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();
        }
開發者ID:hsteinhilber,項目名稱:white-project,代碼行數:56,代碼來源:ScreenObjectGenerator.cs

示例12: CleanupApplication

 public void CleanupApplication()
 {
     if (mainWindow != null) {
         mainWindow.Close();
         mainWindow = null;
     }
     if (application != null && application.HasExited) {
         application.Kill();
         application = null;
     }
 }
開發者ID:hsteinhilber,項目名稱:ShopSchedule,代碼行數:11,代碼來源:ShellActions.cs

示例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();
 }
開發者ID:ananddave123,項目名稱:MyLocalRepo,代碼行數:12,代碼來源:Program.cs

示例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();
     }
 }
開發者ID:hsteinhilber,項目名稱:white-project,代碼行數:12,代碼來源:CoreTestTemplate.cs

示例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");
        }
開發者ID:PapaMufflon,項目名稱:CcdAddIn,代碼行數:12,代碼來源:Retrospective.cs


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