diff --git a/Misc/GenericExtensions.cs b/Misc/GenericExtensions.cs index f676cdf..fb02099 100644 --- a/Misc/GenericExtensions.cs +++ b/Misc/GenericExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; namespace CC_Functions.Misc @@ -63,5 +64,7 @@ namespace CC_Functions.Misc public static void RemoveAt(this Dictionary dict, int index) => dict.Remove(dict.Keys.OfType().ToArray()[index]); + + public static long GetSize(this DirectoryInfo directory) => IO.GetDirectorySize(directory.FullName); } } \ No newline at end of file diff --git a/W32/GenericExtensions.cs b/W32/GenericExtensions.cs new file mode 100644 index 0000000..69c1b8b --- /dev/null +++ b/W32/GenericExtensions.cs @@ -0,0 +1,14 @@ +using System; +using System.Diagnostics; +using System.Windows.Forms; + +namespace CC_Functions.W32 +{ + public static class GenericExtensions + { + public static Wnd32 GetWindow(this IntPtr handle) => Wnd32.fromHandle(handle); + public static Wnd32 GetMainWindow(this Process handle) => Wnd32.getProcessMain(handle); + public static Wnd32 GetWnd32(this Form frm) => Wnd32.fromForm(frm); + public static bool IsDown(this Keys key) => KeyboardReader.IsKeyDown(key); + } +} \ No newline at end of file diff --git a/W32/W32.csproj b/W32/W32.csproj index 9e0e05f..8cf0f8d 100644 --- a/W32/W32.csproj +++ b/W32/W32.csproj @@ -50,6 +50,7 @@ +