Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Add missing enums to Environment
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Nov 29, 2021
1 parent e594b15 commit 5c3f6e7
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.4.0</Version>
<Version>2.4.1</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
72 changes: 71 additions & 1 deletion JustArchiNET.Madness/EnvironmentMadness/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// limitations under the License.

using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using JetBrains.Annotations;
using JustArchiNET.Madness.Helpers;

Expand Down Expand Up @@ -52,5 +53,74 @@ public static string? ProcessPath {
public static string? GetEnvironmentVariable(string variable) => System.Environment.GetEnvironmentVariable(variable);

[MadnessType(EMadnessType.Proxy)]
public static string GetFolderPath(System.Environment.SpecialFolder folder, System.Environment.SpecialFolderOption option) => System.Environment.GetFolderPath(folder, option);
public static string GetFolderPath(SpecialFolder folder) => System.Environment.GetFolderPath((System.Environment.SpecialFolder) folder);

[MadnessType(EMadnessType.Proxy)]
public static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option) => System.Environment.GetFolderPath((System.Environment.SpecialFolder) folder, (System.Environment.SpecialFolderOption) option);

#pragma warning disable CA1069 // Proxy attributes should not change original signatures
[MadnessType(EMadnessType.Proxy)]
[PublicAPI]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum SpecialFolder {
Desktop = 0,
Programs = 2,
MyDocuments = 5,
Personal = 5,
Favorites = 6,
Startup = 7,
Recent = 8,
SendTo = 9,
StartMenu = 11, // 0x0000000B
MyMusic = 13, // 0x0000000D
MyVideos = 14, // 0x0000000E
DesktopDirectory = 16, // 0x00000010
MyComputer = 17, // 0x00000011
NetworkShortcuts = 19, // 0x00000013
Fonts = 20, // 0x00000014
Templates = 21, // 0x00000015
CommonStartMenu = 22, // 0x00000016
CommonPrograms = 23, // 0x00000017
CommonStartup = 24, // 0x00000018
CommonDesktopDirectory = 25, // 0x00000019
ApplicationData = 26, // 0x0000001A
PrinterShortcuts = 27, // 0x0000001B
LocalApplicationData = 28, // 0x0000001C
InternetCache = 32, // 0x00000020
Cookies = 33, // 0x00000021
History = 34, // 0x00000022
CommonApplicationData = 35, // 0x00000023
Windows = 36, // 0x00000024
System = 37, // 0x00000025
ProgramFiles = 38, // 0x00000026
MyPictures = 39, // 0x00000027
UserProfile = 40, // 0x00000028
SystemX86 = 41, // 0x00000029
ProgramFilesX86 = 42, // 0x0000002A
CommonProgramFiles = 43, // 0x0000002B
CommonProgramFilesX86 = 44, // 0x0000002C
CommonTemplates = 45, // 0x0000002D
CommonDocuments = 46, // 0x0000002E
CommonAdminTools = 47, // 0x0000002F
AdminTools = 48, // 0x00000030
CommonMusic = 53, // 0x00000035
CommonPictures = 54, // 0x00000036
CommonVideos = 55, // 0x00000037
Resources = 56, // 0x00000038
LocalizedResources = 57, // 0x00000039
CommonOemLinks = 58, // 0x0000003A
CDBurning = 59 // 0x0000003B
}
#pragma warning restore CA1069 // Proxy attributes should not change original signatures

#pragma warning disable CA1027 // Proxy attributes should not change original signatures
[MadnessType(EMadnessType.Proxy)]
[PublicAPI]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum SpecialFolderOption {
None = 0,
DoNotVerify = 16384,
Create = 32768
}
#pragma warning restore CA1027 // Proxy attributes should not change original signatures
}
2 changes: 1 addition & 1 deletion JustArchiNET.Madness/Helpers/MadnessTypeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace JustArchiNET.Madness.Helpers;
/// <summary>
/// Madness type attribute, which annotates what kind of the functionality is provided.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property)]
[PublicAPI]
public sealed class MadnessTypeAttribute : Attribute {
/// <summary>
Expand Down

0 comments on commit 5c3f6e7

Please sign in to comment.