Skip to content

Commit 84989cd

Browse files
authored
Merge pull request #914 from softworkz/submit_whitespace
Fix and normalize whitespace
2 parents c1e7b84 + 84b3c59 commit 84989cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+430
-232
lines changed

src/ElectronNET.API/API/App.cs

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ public event Action WindowAllClosed
4545

4646
BridgeConnector.Socket.Emit("register-app-window-all-closed", GetHashCode());
4747
}
48+
4849
_windowAllClosed += value;
4950
}
5051
remove
5152
{
5253
_windowAllClosed -= value;
5354

54-
if(_windowAllClosed == null)
55+
if (_windowAllClosed == null)
5556
BridgeConnector.Socket.Off("app-window-all-closed" + GetHashCode());
5657
}
5758
}
@@ -117,6 +118,7 @@ public event Func<QuitEventArgs, Task> BeforeQuit
117118

118119
BridgeConnector.Socket.Emit("register-app-before-quit", GetHashCode());
119120
}
121+
120122
_beforeQuit += value;
121123
}
122124
remove
@@ -168,6 +170,7 @@ public event Func<QuitEventArgs, Task> WillQuit
168170

169171
BridgeConnector.Socket.Emit("register-app-will-quit", GetHashCode());
170172
}
173+
171174
_willQuit += value;
172175
}
173176
remove
@@ -194,7 +197,7 @@ public event Func<Task> Quitting
194197
{
195198
BridgeConnector.Socket.On("app-will-quit" + GetHashCode() + "quitting", async () =>
196199
{
197-
if(_willQuit == null)
200+
if (_willQuit == null)
198201
{
199202
await this._quitting().ConfigureAwait(false);
200203
Exit();
@@ -203,6 +206,7 @@ public event Func<Task> Quitting
203206

204207
BridgeConnector.Socket.Emit("register-app-will-quit", GetHashCode() + "quitting");
205208
}
209+
206210
_quitting += value;
207211
}
208212
remove
@@ -276,11 +280,11 @@ public event Action<bool> AccessibilitySupportChanged
276280
/// <summary>
277281
/// Emitted when the application has finished basic startup.
278282
/// </summary>
279-
public event Action Ready
283+
public event Action Ready
280284
{
281285
add
282286
{
283-
if(IsReady)
287+
if (IsReady)
284288
{
285289
value();
286290
}
@@ -298,19 +302,23 @@ public event Action Ready
298302
/// <summary>
299303
/// Application host fully started.
300304
/// </summary>
301-
public bool IsReady
302-
{
303-
get { return _isReady; }
305+
public bool IsReady
306+
{
307+
get
308+
{
309+
return _isReady;
310+
}
304311
internal set
305312
{
306313
_isReady = value;
307314

308-
if(value)
315+
if (value)
309316
{
310317
_ready?.Invoke();
311318
}
312319
}
313320
}
321+
314322
private bool _isReady = false;
315323

316324
/// <summary>
@@ -379,7 +387,7 @@ public Task<string> NameAsync
379387
}
380388

381389

382-
internal App()
390+
internal App()
383391
{
384392
CommandLine = new CommandLine();
385393
}
@@ -392,7 +400,7 @@ internal static App Instance
392400
{
393401
lock (_syncRoot)
394402
{
395-
if(_app == null)
403+
if (_app == null)
396404
{
397405
_app = new App();
398406
}
@@ -541,7 +549,7 @@ public async Task<string> GetPathAsync(PathName pathName, CancellationToken canc
541549
cancellationToken.ThrowIfCancellationRequested();
542550

543551
var taskCompletionSource = new TaskCompletionSource<string>();
544-
using(cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
552+
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
545553
{
546554
BridgeConnector.Socket.On("appGetPathCompleted", (path) =>
547555
{
@@ -554,7 +562,7 @@ public async Task<string> GetPathAsync(PathName pathName, CancellationToken canc
554562

555563
return await taskCompletionSource.Task
556564
.ConfigureAwait(false);
557-
}
565+
}
558566
}
559567

560568
/// <summary>
@@ -715,7 +723,7 @@ public async Task<bool> SetAsDefaultProtocolClientAsync(string protocol, string
715723
BridgeConnector.Socket.On("appSetAsDefaultProtocolClientCompleted", (success) =>
716724
{
717725
BridgeConnector.Socket.Off("appSetAsDefaultProtocolClientCompleted");
718-
taskCompletionSource.SetResult((bool) success);
726+
taskCompletionSource.SetResult((bool)success);
719727
});
720728

721729
BridgeConnector.Socket.Emit("appSetAsDefaultProtocolClient", protocol, path, args);
@@ -760,7 +768,7 @@ public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, stri
760768
/// <param name="cancellationToken">The cancellation token.</param>
761769
/// <returns>Whether the call succeeded.</returns>
762770
public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default)
763-
{
771+
{
764772
cancellationToken.ThrowIfCancellationRequested();
765773

766774
var taskCompletionSource = new TaskCompletionSource<bool>();
@@ -769,7 +777,7 @@ public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, stri
769777
BridgeConnector.Socket.On("appRemoveAsDefaultProtocolClientCompleted", (success) =>
770778
{
771779
BridgeConnector.Socket.Off("appRemoveAsDefaultProtocolClientCompleted");
772-
taskCompletionSource.SetResult((bool) success);
780+
taskCompletionSource.SetResult((bool)success);
773781
});
774782

775783
BridgeConnector.Socket.Emit("appRemoveAsDefaultProtocolClient", protocol, path, args);
@@ -841,7 +849,7 @@ public async Task<bool> IsDefaultProtocolClientAsync(string protocol, string pat
841849
BridgeConnector.Socket.On("appIsDefaultProtocolClientCompleted", (success) =>
842850
{
843851
BridgeConnector.Socket.Off("appIsDefaultProtocolClientCompleted");
844-
taskCompletionSource.SetResult((bool) success);
852+
taskCompletionSource.SetResult((bool)success);
845853
});
846854

847855
BridgeConnector.Socket.Emit("appIsDefaultProtocolClient", protocol, path, args);
@@ -869,7 +877,7 @@ public async Task<bool> SetUserTasksAsync(UserTask[] userTasks, CancellationToke
869877
BridgeConnector.Socket.On("appSetUserTasksCompleted", (success) =>
870878
{
871879
BridgeConnector.Socket.Off("appSetUserTasksCompleted");
872-
taskCompletionSource.SetResult((bool) success);
880+
taskCompletionSource.SetResult((bool)success);
873881
});
874882

875883
BridgeConnector.Socket.Emit("appSetUserTasks", JArray.FromObject(userTasks, _jsonSerializer));
@@ -1066,7 +1074,7 @@ public async Task<int> ImportCertificateAsync(ImportCertificateOptions options,
10661074
BridgeConnector.Socket.On("appImportCertificateCompleted", (result) =>
10671075
{
10681076
BridgeConnector.Socket.Off("appImportCertificateCompleted");
1069-
taskCompletionSource.SetResult((int) result);
1077+
taskCompletionSource.SetResult((int)result);
10701078
});
10711079

10721080
BridgeConnector.Socket.Emit("appImportCertificate", JObject.FromObject(options, _jsonSerializer));
@@ -1122,7 +1130,7 @@ public async Task<bool> SetBadgeCountAsync(int count, CancellationToken cancella
11221130
BridgeConnector.Socket.On("appSetBadgeCountCompleted", (success) =>
11231131
{
11241132
BridgeConnector.Socket.Off("appSetBadgeCountCompleted");
1125-
taskCompletionSource.SetResult((bool) success);
1133+
taskCompletionSource.SetResult((bool)success);
11261134
});
11271135

11281136
BridgeConnector.Socket.Emit("appSetBadgeCount", count);
@@ -1183,7 +1191,7 @@ public async Task<LoginItemSettings> GetLoginItemSettingsAsync(LoginItemSettings
11831191
{
11841192
BridgeConnector.Socket.Off("appGetLoginItemSettingsCompleted");
11851193

1186-
var result = ((JObject) loginItemSettings).ToObject<LoginItemSettings>();
1194+
var result = ((JObject)loginItemSettings).ToObject<LoginItemSettings>();
11871195

11881196
taskCompletionSource.SetResult(result);
11891197
});
@@ -1310,27 +1318,31 @@ internal void PreventQuit()
13101318
private bool _preventQuit = false;
13111319

13121320
private const string ModuleName = "app";
1321+
13131322
/// <summary>
13141323
/// Subscribe to an unmapped event on the <see cref="App"/> module.
13151324
/// </summary>
13161325
/// <param name="eventName">The event name</param>
13171326
/// <param name="action">The handler</param>
13181327
public void On(string eventName, Action action)
13191328
=> Events.Instance.On(ModuleName, eventName, action);
1329+
13201330
/// <summary>
13211331
/// Subscribe to an unmapped event on the <see cref="App"/> module.
13221332
/// </summary>
13231333
/// <param name="eventName">The event name</param>
13241334
/// <param name="action">The handler</param>
13251335
public async Task On(string eventName, Action<object> action)
13261336
=> await Events.Instance.On(ModuleName, eventName, action).ConfigureAwait(false);
1337+
13271338
/// <summary>
13281339
/// Subscribe to an unmapped event on the <see cref="App"/> module once.
13291340
/// </summary>
13301341
/// <param name="eventName">The event name</param>
13311342
/// <param name="action">The handler</param>
13321343
public void Once(string eventName, Action action)
13331344
=> Events.Instance.Once(ModuleName, eventName, action);
1345+
13341346
/// <summary>
13351347
/// Subscribe to an unmapped event on the <see cref="App"/> module once.
13361348
/// </summary>
@@ -1339,4 +1351,4 @@ public void Once(string eventName, Action action)
13391351
public async Task Once(string eventName, Action<object> action)
13401352
=> await Events.Instance.Once(ModuleName, eventName, action).ConfigureAwait(false);
13411353
}
1342-
}
1354+
}

src/ElectronNET.API/API/AutoUpdater.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Threading.Tasks;
88
using ElectronNET.Common;
9+
910
// ReSharper disable InconsistentNaming
1011

1112
namespace ElectronNET.API
@@ -249,7 +250,6 @@ public Task<string> ChannelAsync
249250
}
250251

251252

252-
253253
/// <summary>
254254
/// The request headers.
255255
/// </summary>
@@ -353,7 +353,9 @@ public event Action<UpdateInfo> OnUpdateDownloaded
353353
private static AutoUpdater _autoUpdater;
354354
private static object _syncRoot = new object();
355355

356-
internal AutoUpdater() { }
356+
internal AutoUpdater()
357+
{
358+
}
357359

358360
internal static AutoUpdater Instance
359361
{
@@ -512,4 +514,4 @@ public Task<string> GetFeedURLAsync()
512514
ContractResolver = new CamelCasePropertyNamesContractResolver()
513515
};
514516
}
515-
}
517+
}

src/ElectronNET.API/API/BrowserView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public Rectangle Bounds
5959
/// <summary>
6060
/// BrowserView
6161
/// </summary>
62-
internal BrowserView(int id)
62+
internal BrowserView(int id)
6363
{
6464
Id = id;
6565

@@ -94,4 +94,4 @@ public void SetBackgroundColor(string color)
9494
NullValueHandling = NullValueHandling.Ignore
9595
};
9696
}
97-
}
97+
}

src/ElectronNET.API/API/BrowserWindow.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Runtime.InteropServices;
1010
using System.Threading.Tasks;
1111
using ElectronNET.Common;
12+
1213
// ReSharper disable InconsistentNaming
1314

1415
namespace ElectronNET.API;
@@ -96,8 +97,8 @@ public event Action OnSessionEnd
9697
/// </summary>
9798
public event Action OnUnresponsive
9899
{
99-
add => ApiEventManager.AddEvent("browserWindow-unresponsive", Id, _unresponsive, value);
100-
remove => ApiEventManager.RemoveEvent("browserWindow-unresponsive", Id, _unresponsive, value);
100+
add => ApiEventManager.AddEvent("browserWindow-unresponsive", Id, _unresponsive, value);
101+
remove => ApiEventManager.RemoveEvent("browserWindow-unresponsive", Id, _unresponsive, value);
101102
}
102103

103104
private event Action _unresponsive;
@@ -752,6 +753,7 @@ public void SetPosition(int x, int y)
752753
{
753754
x = x - 7;
754755
}
756+
755757
this.CallMethod2(x, y);
756758
}
757759

@@ -769,6 +771,7 @@ public void SetPosition(int x, int y, bool animate)
769771
{
770772
x = x - 7;
771773
}
774+
772775
this.CallMethod3(x, y, animate);
773776
}
774777

@@ -906,7 +909,14 @@ private bool isWindows10()
906909
/// <value>
907910
/// The menu items.
908911
/// </value>
909-
public IReadOnlyCollection<MenuItem> MenuItems { get { return _items.AsReadOnly(); } }
912+
public IReadOnlyCollection<MenuItem> MenuItems
913+
{
914+
get
915+
{
916+
return _items.AsReadOnly();
917+
}
918+
}
919+
910920
private List<MenuItem> _items = new List<MenuItem>();
911921

912922
/// <summary>
@@ -981,7 +991,14 @@ public void SetProgressBar(double progress, ProgressBarOptions progressBarOption
981991
/// <value>
982992
/// The thumbar buttons.
983993
/// </value>
984-
public IReadOnlyCollection<ThumbarButton> ThumbarButtons { get { return _thumbarButtons.AsReadOnly(); } }
994+
public IReadOnlyCollection<ThumbarButton> ThumbarButtons
995+
{
996+
get
997+
{
998+
return _thumbarButtons.AsReadOnly();
999+
}
1000+
}
1001+
9851002
private List<ThumbarButton> _thumbarButtons = new List<ThumbarButton>();
9861003

9871004
/// <summary>

src/ElectronNET.API/API/Clipboard.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public sealed class Clipboard
1414
private static Clipboard _clipboard;
1515
private static object _syncRoot = new object();
1616

17-
internal Clipboard() { }
17+
internal Clipboard()
18+
{
19+
}
1820

1921
internal static Clipboard Instance
2022
{
@@ -253,14 +255,13 @@ public Task<NativeImage> ReadImageAsync(string type = "")
253255
var nativeImage = ((JObject)image).ToObject<NativeImage>();
254256

255257
taskCompletionSource.SetResult(nativeImage);
256-
257258
});
258259

259260
BridgeConnector.Socket.Emit("clipboard-readImage", type);
260-
261+
261262
return taskCompletionSource.Task;
262263
}
263-
264+
264265
/// <summary>
265266
/// Writes an image to the clipboard.
266267
/// </summary>

0 commit comments

Comments
 (0)