Widow – Diff between revs 14 and 18
?pathlinks?
Rev 14 | Rev 18 | |||
---|---|---|---|---|
Line 23... | Line 23... | |||
23 | |
23 | |
|
Line 24... | Line 24... | |||
24 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
24 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
|
Line 25... | Line 25... | |||
25 | |
25 | |
|
Line 26... | Line 26... | |||
26 | private MainForm Form { get; } |
26 | private MainForm Form { get; } |
|
Line 27... | Line 27... | |||
27 | |
27 | |
|
Line 56... | Line 56... | |||
56 | Form = mainForm; |
56 | Form = mainForm; |
|
Line 57... | Line 57... | |||
57 | |
57 | |
|
58 | Form.WindowCreated += Form_WindowCreated; |
58 | Form.WindowCreated += Form_WindowCreated; |
|
Line 59... | Line 59... | |||
59 | } |
59 | } |
|
60 | |
- | ||
61 | public WindowManipulation(MainForm mainForm, Windows.Windows windowsToManipulate) : this(mainForm) |
- | ||
62 | { |
- | ||
63 | WindowsToManipulate = windowsToManipulate; |
- | ||
64 | } |
- | ||
65 | |
- | ||
66 | public WindowManipulation(MainForm mainForm, Windows.Windows windowsToManipulate, Settings settings) : this( |
- | ||
67 | mainForm, |
60 | |
|
68 | windowsToManipulate) |
61 | public WindowManipulation(Settings settings, MainForm mainForm) : this(mainForm) |
|
69 | { |
62 | { |
|
70 | OnWindowCreate = settings.OnWindowCreate; |
63 | OnWindowCreate = settings.OnWindowCreate; |
|
71 | ApplyEveryTimeEnabled = settings.ApplyEveryTimeEnabled; |
64 | ApplyEveryTimeEnabled = settings.ApplyEveryTimeEnabled; |
|
Line 96... | Line 89... | |||
96 | if (!OnWindowCreate) |
89 | if (!OnWindowCreate) |
|
97 | { |
90 | { |
|
98 | return; |
91 | return; |
|
99 | } |
92 | } |
|
Line -... | Line 93... | |||
- | 93 | |
||
- | 94 | if (WindowsToManipulate == null) |
||
- | 95 | { |
||
- | 96 | return; |
||
- | 97 | } |
||
100 | |
98 | |
|
101 | var @class = Helpers.GetWindowClass(e.Handle); |
99 | var @class = Helpers.GetWindowClass(e.Handle); |
|
102 | if (!WindowsToManipulate.TryGetWindow(new WindowHash(e.Title, @class), out _)) |
100 | if (!WindowsToManipulate.TryGetWindow(new WindowHash(e.Title, @class), out _)) |
|
103 | { |
101 | { |
|
104 | return; |
102 | return; |
|
Line 109... | Line 107... | |||
109 | |
107 | |
|
Line 110... | Line 108... | |||
110 | #endregion |
108 | #endregion |
|
Line -... | Line 109... | |||
- | 109 | |
||
- | 110 | #region Public Methods |
||
- | 111 | |
||
- | 112 | public void AddWindows(Windows.Windows windows) |
||
- | 113 | { |
||
111 | |
114 | WindowsToManipulate = windows; |
|
112 | #region Public Methods |
115 | } |
|
- | 116 | |
||
- | 117 | public async Task Apply() |
||
- | 118 | { |
||
- | 119 | if (WindowsToManipulate == null) |
||
- | 120 | { |
||
113 | |
121 | return; |
|
114 | public async Task Apply() |
122 | } |
|
115 | { |
123 | |
|
116 | var windows = new List<WindowModification>(); |
124 | var windows = new List<WindowModification>(); |