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

Commit 5c3f6e7

Browse files
committed
Add missing enums to Environment
1 parent e594b15 commit 5c3f6e7

File tree

3 files changed

+73
-3
lines changed

3 files changed

+73
-3
lines changed

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>2.4.0</Version>
3+
<Version>2.4.1</Version>
44
</PropertyGroup>
55

66
<PropertyGroup>

JustArchiNET.Madness/EnvironmentMadness/Environment.cs

+71-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// limitations under the License.
2121

2222
using System.Diagnostics;
23+
using System.Diagnostics.CodeAnalysis;
2324
using JetBrains.Annotations;
2425
using JustArchiNET.Madness.Helpers;
2526

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

5455
[MadnessType(EMadnessType.Proxy)]
55-
public static string GetFolderPath(System.Environment.SpecialFolder folder, System.Environment.SpecialFolderOption option) => System.Environment.GetFolderPath(folder, option);
56+
public static string GetFolderPath(SpecialFolder folder) => System.Environment.GetFolderPath((System.Environment.SpecialFolder) folder);
57+
58+
[MadnessType(EMadnessType.Proxy)]
59+
public static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option) => System.Environment.GetFolderPath((System.Environment.SpecialFolder) folder, (System.Environment.SpecialFolderOption) option);
60+
61+
#pragma warning disable CA1069 // Proxy attributes should not change original signatures
62+
[MadnessType(EMadnessType.Proxy)]
63+
[PublicAPI]
64+
[SuppressMessage("ReSharper", "InconsistentNaming")]
65+
public enum SpecialFolder {
66+
Desktop = 0,
67+
Programs = 2,
68+
MyDocuments = 5,
69+
Personal = 5,
70+
Favorites = 6,
71+
Startup = 7,
72+
Recent = 8,
73+
SendTo = 9,
74+
StartMenu = 11, // 0x0000000B
75+
MyMusic = 13, // 0x0000000D
76+
MyVideos = 14, // 0x0000000E
77+
DesktopDirectory = 16, // 0x00000010
78+
MyComputer = 17, // 0x00000011
79+
NetworkShortcuts = 19, // 0x00000013
80+
Fonts = 20, // 0x00000014
81+
Templates = 21, // 0x00000015
82+
CommonStartMenu = 22, // 0x00000016
83+
CommonPrograms = 23, // 0x00000017
84+
CommonStartup = 24, // 0x00000018
85+
CommonDesktopDirectory = 25, // 0x00000019
86+
ApplicationData = 26, // 0x0000001A
87+
PrinterShortcuts = 27, // 0x0000001B
88+
LocalApplicationData = 28, // 0x0000001C
89+
InternetCache = 32, // 0x00000020
90+
Cookies = 33, // 0x00000021
91+
History = 34, // 0x00000022
92+
CommonApplicationData = 35, // 0x00000023
93+
Windows = 36, // 0x00000024
94+
System = 37, // 0x00000025
95+
ProgramFiles = 38, // 0x00000026
96+
MyPictures = 39, // 0x00000027
97+
UserProfile = 40, // 0x00000028
98+
SystemX86 = 41, // 0x00000029
99+
ProgramFilesX86 = 42, // 0x0000002A
100+
CommonProgramFiles = 43, // 0x0000002B
101+
CommonProgramFilesX86 = 44, // 0x0000002C
102+
CommonTemplates = 45, // 0x0000002D
103+
CommonDocuments = 46, // 0x0000002E
104+
CommonAdminTools = 47, // 0x0000002F
105+
AdminTools = 48, // 0x00000030
106+
CommonMusic = 53, // 0x00000035
107+
CommonPictures = 54, // 0x00000036
108+
CommonVideos = 55, // 0x00000037
109+
Resources = 56, // 0x00000038
110+
LocalizedResources = 57, // 0x00000039
111+
CommonOemLinks = 58, // 0x0000003A
112+
CDBurning = 59 // 0x0000003B
113+
}
114+
#pragma warning restore CA1069 // Proxy attributes should not change original signatures
115+
116+
#pragma warning disable CA1027 // Proxy attributes should not change original signatures
117+
[MadnessType(EMadnessType.Proxy)]
118+
[PublicAPI]
119+
[SuppressMessage("ReSharper", "InconsistentNaming")]
120+
public enum SpecialFolderOption {
121+
None = 0,
122+
DoNotVerify = 16384,
123+
Create = 32768
124+
}
125+
#pragma warning restore CA1027 // Proxy attributes should not change original signatures
56126
}

JustArchiNET.Madness/Helpers/MadnessTypeAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace JustArchiNET.Madness.Helpers;
2929
/// <summary>
3030
/// Madness type attribute, which annotates what kind of the functionality is provided.
3131
/// </summary>
32-
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property)]
32+
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property)]
3333
[PublicAPI]
3434
public sealed class MadnessTypeAttribute : Attribute {
3535
/// <summary>

0 commit comments

Comments
 (0)