Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Commit 68c5daa

Browse files
author
Mustafa ÖNCEL
committed
Apply var style
1 parent 814356c commit 68c5daa

17 files changed

Lines changed: 48 additions & 48 deletions

LifeUtils/LifeUtils/Annotations/Annotations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - Annotations.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

LifeUtils/LifeUtils/Annotations/Configurable.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - Configurable.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

@@ -70,8 +70,8 @@ public static void Init(Type type, IConfigFile config, string section = "Options
7070
PropertyInfo[] propertyInfos =
7171
type.GetProperties(flags);
7272

73-
foreach (FieldInfo fieldInfo in fieldInfos)
74-
foreach (ConfigurableAttribute attr in fieldInfo.GetCustomAttributes<ConfigurableAttribute>(true))
73+
foreach (var fieldInfo in fieldInfos)
74+
foreach (var attr in fieldInfo.GetCustomAttributes<ConfigurableAttribute>(true))
7575
{
7676
if (attr.Key.Equals("")) attr.Key = fieldInfo.Name;
7777
if (!config.ContainsKey(attr.Key, section))
@@ -82,8 +82,8 @@ public static void Init(Type type, IConfigFile config, string section = "Options
8282
break;
8383
}
8484

85-
foreach (PropertyInfo propertyInfo in propertyInfos)
86-
foreach (ConfigurableAttribute attr in propertyInfo.GetCustomAttributes<ConfigurableAttribute>(true))
85+
foreach (var propertyInfo in propertyInfos)
86+
foreach (var attr in propertyInfo.GetCustomAttributes<ConfigurableAttribute>(true))
8787
{
8888
if (attr.Key.Equals("")) attr.Key = propertyInfo.Name;
8989
if (!config.ContainsKey(attr.Key, section))

LifeUtils/LifeUtils/Annotations/Localizable.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - Localizable.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

@@ -72,8 +72,8 @@ public static void Init(Type type, IConfigFile config)
7272
PropertyInfo[] propertyInfos =
7373
type.GetProperties(flags);
7474

75-
foreach (FieldInfo fieldInfo in fieldInfos)
76-
foreach (LocalizableAttribute attr in fieldInfo.GetCustomAttributes<LocalizableAttribute>(true))
75+
foreach (var fieldInfo in fieldInfos)
76+
foreach (var attr in fieldInfo.GetCustomAttributes<LocalizableAttribute>(true))
7777
{
7878
if (attr.Key.Equals("")) attr.Key = fieldInfo.Name;
7979
if (!config.ContainsKey(attr.Key, section))
@@ -84,8 +84,8 @@ public static void Init(Type type, IConfigFile config)
8484
break;
8585
}
8686

87-
foreach (PropertyInfo propertyInfo in propertyInfos)
88-
foreach (LocalizableAttribute attr in propertyInfo.GetCustomAttributes<LocalizableAttribute>(true))
87+
foreach (var propertyInfo in propertyInfos)
88+
foreach (var attr in propertyInfo.GetCustomAttributes<LocalizableAttribute>(true))
8989
{
9090
if (attr.Key.Equals("")) attr.Key = propertyInfo.Name;
9191
if (!config.ContainsKey(attr.Key, section))

LifeUtils/LifeUtils/EnumUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - EnumUtils.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

LifeUtils/LifeUtils/FileUtils.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - FileUtils.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

@@ -53,23 +53,23 @@ public static string GetJavaHome()
5353
{
5454
try
5555
{
56-
string javaHome = Environment.GetEnvironmentVariable("JAVA_HOME");
56+
var javaHome = Environment.GetEnvironmentVariable("JAVA_HOME");
5757
if (!string.IsNullOrEmpty(javaHome) && !string.IsNullOrWhiteSpace(javaHome))
5858
return javaHome;
5959

60-
string jreHome = Environment.GetEnvironmentVariable("JRE_HOME");
60+
var jreHome = Environment.GetEnvironmentVariable("JRE_HOME");
6161
if (!string.IsNullOrEmpty(jreHome) && !string.IsNullOrWhiteSpace(jreHome))
6262
return jreHome;
6363

64-
string jdkHome = Environment.GetEnvironmentVariable("JDK_HOME");
64+
var jdkHome = Environment.GetEnvironmentVariable("JDK_HOME");
6565
if (!string.IsNullOrEmpty(jdkHome) && !string.IsNullOrWhiteSpace(jdkHome))
6666
return jdkHome;
6767

68-
string registryPath = GetJavaHomeFromRegistry()?.Trim();
68+
var registryPath = GetJavaHomeFromRegistry()?.Trim();
6969
if (!string.IsNullOrEmpty(registryPath) && !string.IsNullOrWhiteSpace(registryPath))
7070
return registryPath;
7171

72-
string processPath = GetJavaHomeFromConsole();
72+
var processPath = GetJavaHomeFromConsole();
7373

7474
return !string.IsNullOrEmpty(processPath) && !string.IsNullOrWhiteSpace(processPath)
7575
? processPath
@@ -88,7 +88,7 @@ public static string GetJavaHome()
8888
/// <returns>The java home from console.</returns>
8989
public static string GetJavaHomeFromConsole()
9090
{
91-
Process process = new Process
91+
var process = new Process
9292
{
9393
StartInfo = new ProcessStartInfo
9494
{
@@ -104,7 +104,7 @@ public static string GetJavaHomeFromConsole()
104104

105105
process.Start();
106106

107-
string javaHome = process.StandardOutput.ReadToEnd();
107+
var javaHome = process.StandardOutput.ReadToEnd();
108108

109109
try
110110
{
@@ -129,10 +129,10 @@ public static string GetJavaHomeFromRegistry()
129129

130130
try
131131
{
132-
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(javaKey))
132+
using (var rk = Registry.LocalMachine.OpenSubKey(javaKey))
133133
{
134-
string currentVersion = rk?.GetValue("CurrentVersion").ToString();
135-
using (RegistryKey key = rk?.OpenSubKey(currentVersion))
134+
var currentVersion = rk?.GetValue("CurrentVersion").ToString();
135+
using (var key = rk?.OpenSubKey(currentVersion))
136136
{
137137
return key?.GetValue("JavaHome").ToString();
138138
}
@@ -142,10 +142,10 @@ public static string GetJavaHomeFromRegistry()
142142
{
143143
try
144144
{
145-
using (RegistryKey rk = Registry.CurrentUser.OpenSubKey(javaKey))
145+
using (var rk = Registry.CurrentUser.OpenSubKey(javaKey))
146146
{
147-
string currentVersion = rk?.GetValue("CurrentVersion").ToString();
148-
using (RegistryKey key = rk?.OpenSubKey(currentVersion))
147+
var currentVersion = rk?.GetValue("CurrentVersion").ToString();
148+
using (var key = rk?.OpenSubKey(currentVersion))
149149
{
150150
return key?.GetValue("JavaHome").ToString();
151151
}
@@ -165,7 +165,7 @@ public static string GetJavaHomeFromRegistry()
165165
/// <param name="path">The directories path to delete it.</param>
166166
public static void DeleteDirectory(string path)
167167
{
168-
foreach (string directory in Directory.GetDirectories(path)) DeleteDirectory(directory);
168+
foreach (var directory in Directory.GetDirectories(path)) DeleteDirectory(directory);
169169
try
170170
{
171171
Directory.Delete(path, true);

LifeUtils/LifeUtils/ICloseable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - ICloseable.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

LifeUtils/LifeUtils/IConfigFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - IConfigFile.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

LifeUtils/LifeUtils/IConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - IConverter.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

LifeUtils/LifeUtils/IFlushable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - IFlushable.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

LifeUtils/LifeUtils/ITask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//
44
// LifeUtils - LifeUtils - ITask.cs
5-
// 13.11.2018 12:12
5+
// 19.11.2018 06:12
66

77
#endregion
88

0 commit comments

Comments
 (0)