Skip to content

Commit

Permalink
Update GeneralHelper.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Dec 24, 2024
1 parent 8604e02 commit 4cf8f36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dev/DevWinUI/Helpers/GeneralHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
using System.Globalization;
using System.Security.Principal;
using System.Web;
using Microsoft.UI.Input;

namespace DevWinUI;
public partial class GeneralHelper
{
public static bool IsAppRunningAsAdmin()
{
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}

public static void ChangeCursor(UIElement uiElement, InputCursor cursor)
{
Type type = typeof(UIElement);
Expand Down

0 comments on commit 4cf8f36

Please sign in to comment.