private void LoadPccBtn_Click(object sender, EventArgs e) { string filepath = "C:/Program Files/Samsung Display/PCC C#/PCC_CS.exe"; ProcessStartInfo pccinfo = new ProcessStartInfo(filepath); pcc = FlaUI.Core.Application.AttachOrLaunch(pccinfo); PccStatusLabel.Text = "Loaded"; isPccConnected = true; }
public void Initialize(Func <AutomationBase> getAutomation, Func <Application> getApplication) { if (this.isInitialized) { return; } this.Application = getApplication.Invoke(); this.Automation = getAutomation.Invoke(); this.isInitialized = true; }
protected virtual void Dispose(bool disposing) { // Cleanup if (this.Application != null) { this.Application.Close(); Retry.WhileFalse(() => this.Application.HasExited, TimeSpan.FromSeconds(2), ignoreException: true); this.Application.Dispose(); this.Application = null; } if (this.Automation != null) { this.Automation.Dispose(); this.Automation = null; } }
private static Window WaitUntillSlnIsLoaded(FlaUI.Core.Application app, UIA3Automation automation) { int delayMSeconds = 500; var cf = new ConditionFactory(new UIA3PropertyLibrary()); AutomationElement debugTargetButton = null; Window mainWindow = null; while (debugTargetButton is null) { mainWindow = app.GetMainWindow(automation); debugTargetButton = mainWindow.FindFirst(FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByName("Debug Target")); if (!(debugTargetButton is null)) { break; } Task.Delay(delayMSeconds).Wait(); } return(mainWindow); }