Skip to content

Commit a2479bf

Browse files
committed
Drop workaround via DescriptinoAttribute: No longer needed
1 parent f7ce629 commit a2479bf

File tree

6 files changed

+8
-43
lines changed

6 files changed

+8
-43
lines changed

src/ElectronNET.API/API/App.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public async Task<string> GetPathAsync(PathName pathName, CancellationToken canc
539539
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
540540
{
541541
BridgeConnector.Socket.Once<string>("appGetPathCompleted", taskCompletionSource.SetResult);
542-
BridgeConnector.Socket.Emit("appGetPath", pathName.GetDescription());
542+
BridgeConnector.Socket.Emit("appGetPath", pathName);
543543

544544
return await taskCompletionSource.Task
545545
.ConfigureAwait(false);
@@ -560,7 +560,7 @@ public async Task<string> GetPathAsync(PathName pathName, CancellationToken canc
560560
/// </summary>
561561
public void SetPath(PathName name, string path)
562562
{
563-
this.CallMethod2(name.GetDescription(), path);
563+
this.CallMethod2(name, path);
564564
}
565565

566566
/// <summary>

src/ElectronNET.API/API/BrowserWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ public void SetAspectRatio(int aspectRatio, Size extraSize) =>
681681
/// <param name="level">Values include normal, floating, torn-off-menu, modal-panel, main-menu,
682682
/// status, pop-up-menu and screen-saver. The default is floating.
683683
/// See the macOS docs</param>
684-
public void SetAlwaysOnTop(bool flag, OnTopLevel level) => this.CallMethod2(flag, level.GetDescription());
684+
public void SetAlwaysOnTop(bool flag, OnTopLevel level) => this.CallMethod2(flag, level);
685685

686686
/// <summary>
687687
/// Sets whether the window should show always on top of other windows.
@@ -694,7 +694,7 @@ public void SetAspectRatio(int aspectRatio, Size extraSize) =>
694694
/// See the macOS docs</param>
695695
/// <param name="relativeLevel">The number of layers higher to set this window relative to the given level.
696696
/// The default is 0. Note that Apple discourages setting levels higher than 1 above screen-saver.</param>
697-
public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) => this.CallMethod3(flag, level.GetDescription(), relativeLevel);
697+
public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) => this.CallMethod3(flag, level, relativeLevel);
698698

699699
/// <summary>
700700
/// Whether the window is always on top of other windows.
@@ -1190,7 +1190,7 @@ public async Task<List<BrowserWindow>> GetChildWindowsAsync()
11901190
/// menu, popover, sidebar, medium-light or ultra-dark.
11911191
/// See the macOS documentation for more details.</param>
11921192
[SupportedOSPlatform("macOS")]
1193-
public void SetVibrancy(Vibrancy type) => this.CallMethod1(type.GetDescription());
1193+
public void SetVibrancy(Vibrancy type) => this.CallMethod1(type);
11941194

11951195
/// <summary>
11961196
/// Render and control web pages.

src/ElectronNET.API/API/Dock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task<int> BounceAsync(DockBounceType type, CancellationToken cancel
5757
using (cancellationToken.Register(() => tcs.TrySetCanceled()))
5858
{
5959
BridgeConnector.Socket.Once<int>("dock-bounce-completed", tcs.SetResult);
60-
BridgeConnector.Socket.Emit("dock-bounce", type.GetDescription());
60+
BridgeConnector.Socket.Emit("dock-bounce", type);
6161

6262
return await tcs.Task
6363
.ConfigureAwait(false);

src/ElectronNET.API/API/Extensions/EnumExtensions.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/ElectronNET.API/API/NativeTheme.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ internal static NativeTheme Instance
9999
/// <param name="themeSourceMode">The new ThemeSource.</param>
100100
public void SetThemeSource(ThemeSourceMode themeSourceMode)
101101
{
102-
var themeSource = themeSourceMode.GetDescription();
102+
var themeSource = themeSourceMode;
103103

104104
BridgeConnector.Socket.Emit("nativeTheme-themeSource", themeSource);
105105
}

src/ElectronNET.API/API/Shell.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public Task<bool> WriteShortcutLinkAsync(string shortcutPath, ShortcutLinkOperat
134134
var tcs = new TaskCompletionSource<bool>();
135135

136136
BridgeConnector.Socket.Once<bool>("shell-writeShortcutLinkCompleted", tcs.SetResult);
137-
BridgeConnector.Socket.Emit("shell-writeShortcutLink", shortcutPath, operation.GetDescription(), options);
137+
BridgeConnector.Socket.Emit("shell-writeShortcutLink", shortcutPath, operation, options);
138138

139139
return tcs.Task;
140140
}

0 commit comments

Comments
 (0)