GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
ApplicationSettings.cs
1// =============================================================================
2// GPAL - Generally Positive Automation Library
3// Copyright © 2026 Software Decisions, Inc. All rights reserved.
4//
5// This file is part of GPAL.
6// Licensed under the Business Source License 1.1
7//
8// Primary development, architecture, and vision by Michael B. Vederman,
9// CEO of Software Decisions, Inc., Texas.
10//
11// Internal development maintained privately.
12// Public releases appear on GitHub: https://github.com/SoftwareDecisionsInc/GPAL.
13//
14// See LICENSE for full terms, including Additional Use Grant.
15// =============================================================================
16
17using System;
18using System.Collections;
19using System.Collections.Generic;
20using System.Diagnostics;
21using System.Linq;
22using System.Text;
23using System.Threading.Tasks;
24using System.Windows.Automation;
25using System.Windows.Forms;
26using OpenQA.Selenium;
27using static GenerallyPositive.Enums;
28
30{
31 internal class ApplicationSettings
32 {
33 internal Application Application { get; set; }
34 internal string ApplicationPath { get; set; }
35 // name of this application instance, set by GPAL factory
36 internal string Name { get; set; } = null;
37
38 internal Process Process { get; set; } = null;
39 // load images on a web page?
40 internal bool LoadImages { get; set; } = false;
41
42 // open pdf documents in external program?
43 internal bool OpenPDFExternally { get; set; } = true;
44
45 // open file save dialog
46 internal bool PromptForDownload { get; set; } = true;
47
48 internal string PlatformName { get; set; } = "Windows 10";
49
50 internal bool Maximize { get; set; } = false;
51
52 internal bool Minimize { get; set; } = false;
53
54 internal Selector MySelector { get; set; } = null;
55
56 internal AutomationElement RootAutomationElement { get; set; } = null;
57 internal object ManagedRootAutomationElement { get; set; } = null;
58
59 internal System.Windows.Forms.Form CurrentForm { get; set; } = null;
60 internal int WaitForWindowTimeout { get; set; } = 10; // seconds
61 internal bool UseHardware { get; set; } = false; // instead of uiautomation, use hardware emulation
62 internal bool NewInstance { get; set; } = false; // launch rather than attach to a running copy
63
64 // set by WithHiddenDesktop: the program runs on a Win32 desktop object of its own, which has its own
65 // window set and its own input queue, so nothing it does reaches the screen the user is working on
66 internal bool HiddenDesktop { get; set; } = false;
67
68 // the desktop's name. Applications naming the same one share it, and one asking without a name gets
69 // one of its own
70 internal string HiddenDesktopName { get; set; } = GenerallyPositive.Browser.HiddenDesktop.DefaultName;
71
72 // said once, when the program is opened there
73 internal bool HiddenDesktopReported { get; set; } = false;
74
75 // said once per application rather than on every action it turns down
76 internal bool HiddenDesktopHardwareReported { get; set; } = false;
77
78 // whether anything ever arrived on the desktop, checked once after the program is opened
79 internal bool HiddenDesktopChecked { get; set; } = false;
80 internal IntPtr LastWindowHandle { get; set; } = IntPtr.Zero;
81
82 internal bool DeleteFileBeforeDownload { get; set; } = false;
83
84 internal ArrayList Parameters
85 {
86 get;
87 set;
88 }
89
90 internal ApplicationSettings(Application application)
91 {
92 Application = application;
93 Parameters = new ArrayList();
94 }
95 }
96}
97