Skip to content

Commit 8a1ef67

Browse files
committed
docs: Ergänze XML-Dokumentation in mehreren Klassen zur Verbesserung der Codeverständlichkeit
1 parent 06f12f0 commit 8a1ef67

18 files changed

Lines changed: 442 additions & 8 deletions

File tree

src/BAUERGROUP.Shared.Core/Application/ApplicationController.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@
66

77
namespace BAUERGROUP.Shared.Core.Application
88
{
9+
/// <summary>
10+
/// Base class for application lifecycle management.
11+
/// </summary>
912
public class ApplicationController: IDisposable
1013
{
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="ApplicationController"/> class.
16+
/// </summary>
1117
public ApplicationController()
1218
{
1319

1420
}
1521

22+
/// <summary>
23+
/// Releases all resources used by the <see cref="ApplicationController"/>.
24+
/// </summary>
1625
public void Dispose()
1726
{
18-
27+
1928
}
2029
}
2130
}

src/BAUERGROUP.Shared.Core/Application/ApplicationFolders.cs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33

44
namespace BAUERGROUP.Shared.Core.Application
55
{
6+
/// <summary>
7+
/// Provides access to common application folder paths.
8+
/// </summary>
69
public static class ApplicationFolders
710
{
11+
/// <summary>
12+
/// Gets the roaming application data folder path for the current user.
13+
/// </summary>
814
public static String ApplicationData
915
{
1016
get
@@ -13,6 +19,9 @@ public static String ApplicationData
1319
}
1420
}
1521

22+
/// <summary>
23+
/// Gets the directory containing the application binary.
24+
/// </summary>
1625
public static String? ApplicationBinary
1726
{
1827
get
@@ -21,6 +30,9 @@ public static String? ApplicationBinary
2130
}
2231
}
2332

33+
/// <summary>
34+
/// Gets the application file name without the extension.
35+
/// </summary>
2436
public static String ApplicationFileNameWithoutExtension
2537
{
2638
get
@@ -29,6 +41,9 @@ public static String ApplicationFileNameWithoutExtension
2941
}
3042
}
3143

44+
/// <summary>
45+
/// Gets the application-specific folder within the roaming application data directory.
46+
/// </summary>
3247
public static String ExecutionApplicationDataFolder
3348
{
3449
get
@@ -37,6 +52,9 @@ public static String ExecutionApplicationDataFolder
3752
}
3853
}
3954

55+
/// <summary>
56+
/// Gets the common application data folder path shared by all users.
57+
/// </summary>
4058
public static String CommonApplicationData
4159
{
4260
get
@@ -45,6 +63,9 @@ public static String CommonApplicationData
4563
}
4664
}
4765

66+
/// <summary>
67+
/// Gets the application-specific folder within the common application data directory.
68+
/// </summary>
4869
public static String ExecutionCommonApplicationDataFolder
4970
{
5071
get
@@ -53,6 +74,9 @@ public static String ExecutionCommonApplicationDataFolder
5374
}
5475
}
5576

77+
/// <summary>
78+
/// Gets the directory containing the currently executing assembly.
79+
/// </summary>
5680
public static String? ApplicationExecuting
5781
{
5882
get
@@ -61,6 +85,9 @@ public static String? ApplicationExecuting
6185
}
6286
}
6387

88+
/// <summary>
89+
/// Gets the local (non-roaming) application data folder path for the current user.
90+
/// </summary>
6491
public static String LocalApplicationData
6592
{
6693
get
@@ -69,6 +96,9 @@ public static String LocalApplicationData
6996
}
7097
}
7198

99+
/// <summary>
100+
/// Gets the current working directory of the application.
101+
/// </summary>
72102
public static String CurrentDirectory
73103
{
74104
get
@@ -77,6 +107,12 @@ public static String CurrentDirectory
77107
}
78108
}
79109

110+
/// <summary>
111+
/// Gets the name of the environment variable that forces data storage in the user's roaming profile.
112+
/// </summary>
113+
/// <remarks>
114+
/// When this environment variable is set to "TRUE", application data is stored in the roaming profile.
115+
/// </remarks>
80116
public static String ForceApplicationDataFolderInUserProfileEnvironmentVariable
81117
{
82118
get
@@ -85,6 +121,13 @@ public static String ForceApplicationDataFolderInUserProfileEnvironmentVariable
85121
}
86122
}
87123

124+
/// <summary>
125+
/// Gets the appropriate application data folder based on the BAUERGROUP_ROAMINGAPPLICATIONDATA environment variable.
126+
/// </summary>
127+
/// <remarks>
128+
/// Returns <see cref="ExecutionApplicationDataFolder"/> if the environment variable is set to "TRUE",
129+
/// otherwise returns <see cref="ExecutionCommonApplicationDataFolder"/>.
130+
/// </remarks>
88131
public static String ExecutionAutomaticApplicationDataFolder
89132
{
90133
get
@@ -98,6 +141,9 @@ public static String ExecutionAutomaticApplicationDataFolder
98141
}
99142
}
100143

144+
/// <summary>
145+
/// Gets the user's personal documents directory (My Documents).
146+
/// </summary>
101147
public static String UserPersonalDocumentsDirectory
102148
{
103149
get

src/BAUERGROUP.Shared.Core/Application/ApplicationProperties.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44

55
namespace BAUERGROUP.Shared.Core.Application
66
{
7+
/// <summary>
8+
/// Provides access to application assembly information and runtime properties.
9+
/// </summary>
710
public static class ApplicationProperties
811
{
12+
/// <summary>
13+
/// Gets the entry assembly for the current process, or null if not available.
14+
/// </summary>
915
public static Assembly? EntryAssembly
1016
{
1117
get
@@ -14,6 +20,9 @@ public static Assembly? EntryAssembly
1420
}
1521
}
1622

23+
/// <summary>
24+
/// Gets the assembly that called into the current code.
25+
/// </summary>
1726
public static Assembly CallingAssembly
1827
{
1928
get
@@ -22,6 +31,9 @@ public static Assembly CallingAssembly
2231
}
2332
}
2433

34+
/// <summary>
35+
/// Gets the assembly containing the currently executing code.
36+
/// </summary>
2537
public static Assembly ExecutingAssembly
2638
{
2739
get
@@ -30,6 +42,9 @@ public static Assembly ExecutingAssembly
3042
}
3143
}
3244

45+
/// <summary>
46+
/// Gets the most appropriate assembly reference, preferring EntryAssembly, then CallingAssembly, then ExecutingAssembly.
47+
/// </summary>
3348
public static Assembly AutomaticAssembly
3449
{
3550
get
@@ -38,6 +53,9 @@ public static Assembly AutomaticAssembly
3853
}
3954
}
4055

56+
/// <summary>
57+
/// Gets the title of the application from the assembly's <see cref="AssemblyTitleAttribute"/>.
58+
/// </summary>
4159
public static String Title
4260
{
4361
get
@@ -46,6 +64,9 @@ public static String Title
4664
}
4765
}
4866

67+
/// <summary>
68+
/// Gets the version of the application assembly.
69+
/// </summary>
4970
public static Version? Version
5071
{
5172
get
@@ -54,6 +75,9 @@ public static Version? Version
5475
}
5576
}
5677

78+
/// <summary>
79+
/// Gets the name of the application assembly.
80+
/// </summary>
5781
public static String? Name
5882
{
5983
get
@@ -62,6 +86,9 @@ public static String? Name
6286
}
6387
}
6488

89+
/// <summary>
90+
/// Gets the command line arguments passed to the application.
91+
/// </summary>
6592
public static String CommandLine
6693
{
6794
get
@@ -70,6 +97,9 @@ public static String CommandLine
7097
}
7198
}
7299

100+
/// <summary>
101+
/// Gets a value indicating whether the current process is running as 64-bit.
102+
/// </summary>
73103
public static Boolean Is64BitProcess
74104
{
75105
get

src/BAUERGROUP.Shared.Core/Application/EnvironmentProperties.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,70 @@
44

55
namespace BAUERGROUP.Shared.Core.Application
66
{
7+
/// <summary>
8+
/// Provides access to environment and system information.
9+
/// </summary>
710
public static class EnvironmentProperties
811
{
12+
/// <summary>
13+
/// Gets the NetBIOS name of the local computer.
14+
/// </summary>
915
public static String ClientName { get { return Environment.MachineName; } }
1016

17+
/// <summary>
18+
/// Gets the user name of the currently logged-in user.
19+
/// </summary>
1120
public static String UserName { get { return Environment.UserName; } }
21+
22+
/// <summary>
23+
/// Gets the network domain name associated with the current user.
24+
/// </summary>
1225
public static String UserDomainName { get { return Environment.UserDomainName; } }
26+
27+
/// <summary>
28+
/// Gets the full user name in DOMAIN\Username format.
29+
/// </summary>
1330
public static String FullUserName { get { return String.Format(@"{0}\{1}", UserDomainName, UserName); } }
1431

32+
/// <summary>
33+
/// Gets a value indicating whether the current process is running in user interactive mode.
34+
/// </summary>
1535
public static Boolean UserIsInteractive { get { return Environment.UserInteractive; } }
1636

37+
/// <summary>
38+
/// Gets the current operating system information.
39+
/// </summary>
1740
public static OperatingSystem OperatingSystem { get { return Environment.OSVersion; } }
41+
42+
/// <summary>
43+
/// Gets a value indicating whether the current operating system is 64-bit.
44+
/// </summary>
1845
public static Boolean Is64BitOperatingSystem { get { return Environment.Is64BitOperatingSystem; } }
1946

47+
/// <summary>
48+
/// Gets the number of processors available to the current process.
49+
/// </summary>
2050
public static Int32 ProcessorCount { get { return Environment.ProcessorCount; } }
51+
52+
/// <summary>
53+
/// Gets the fully qualified path of the system directory.
54+
/// </summary>
2155
public static String SystemDirectory { get { return Environment.SystemDirectory; } }
2256

57+
/// <summary>
58+
/// Retrieves the value of an environment variable.
59+
/// </summary>
60+
/// <param name="name">The name of the environment variable.</param>
61+
/// <returns>The value of the environment variable, or null if not found.</returns>
2362
public static String? GetEnvironmentVariable(String name)
2463
{
2564
//Returns NULL if not found
2665
return Environment.GetEnvironmentVariable(name);
2766
}
2867

68+
/// <summary>
69+
/// Gets the type of session the application is running in (Console, RDP, ICA, or Undetermined).
70+
/// </summary>
2971
public static EnvironmentSessionType SessionType
3072
{
3173
get

src/BAUERGROUP.Shared.Core/Application/EnvironmentSessionType.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,29 @@
44

55
namespace BAUERGROUP.Shared.Core.Application
66
{
7+
/// <summary>
8+
/// Specifies the type of user session the application is running in.
9+
/// </summary>
710
public enum EnvironmentSessionType
811
{
12+
/// <summary>
13+
/// The session type could not be determined.
14+
/// </summary>
915
Undetermined = 0,
1016

17+
/// <summary>
18+
/// A local console session.
19+
/// </summary>
1120
Console = 1,
1221

22+
/// <summary>
23+
/// A Citrix ICA (Independent Computing Architecture) remote session.
24+
/// </summary>
1325
ICA = 10,
26+
27+
/// <summary>
28+
/// A Microsoft Remote Desktop Protocol (RDP) session.
29+
/// </summary>
1430
RDP = 11
1531
}
1632
}

src/BAUERGROUP.Shared.Core/Extensions/DescriptionHelper.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
using System.Text;
66

77
namespace BAUERGROUP.Shared.Core.Extensions
8-
{
8+
{
9+
/// <summary>
10+
/// Extension methods for retrieving attributes from enum values.
11+
/// </summary>
912
public static class DescriptionHelper
10-
{
13+
{
14+
/// <summary>
15+
/// Gets an attribute of the specified type from an enum value.
16+
/// </summary>
17+
/// <typeparam name="T">The type of attribute to retrieve.</typeparam>
18+
/// <param name="value">The enum value.</param>
19+
/// <returns>The attribute instance.</returns>
1120
public static T GetAttributeOfType<T>(this Enum value) where T : Attribute
1221
{
1322
var type = value.GetType();
@@ -16,9 +25,14 @@ public static T GetAttributeOfType<T>(this Enum value) where T : Attribute
1625
return (T)attributes[0];
1726
}
1827

28+
/// <summary>
29+
/// Gets the description from a <see cref="DescriptionAttribute"/> on an enum value.
30+
/// </summary>
31+
/// <param name="value">The enum value.</param>
32+
/// <returns>The description text from the attribute.</returns>
1933
public static string GetDescriptionAttribute(this Enum value)
2034
{
2135
return GetAttributeOfType<DescriptionAttribute>(value).Description;
2236
}
23-
}
37+
}
2438
}

0 commit comments

Comments
 (0)