-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update files to use file scoped namespaces
- Loading branch information
1 parent
f85c0d1
commit 84bfc41
Showing
45 changed files
with
2,609 additions
and
2,747 deletions.
There are no files selected for viewing
29 changes: 13 additions & 16 deletions
29
src/LocalStack.AwsLocal/AmbientContexts/ConsoleContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
using System; | ||
namespace LocalStack.AwsLocal.AmbientContexts; | ||
|
||
namespace LocalStack.AwsLocal.AmbientContexts | ||
public abstract class ConsoleContext | ||
{ | ||
public abstract class ConsoleContext | ||
{ | ||
private static ConsoleContext _current = DefaultConsoleContext.Instance; | ||
private static ConsoleContext _current = DefaultConsoleContext.Instance; | ||
|
||
public static ConsoleContext Current | ||
{ | ||
get => _current; | ||
public static ConsoleContext Current | ||
{ | ||
get => _current; | ||
|
||
set => _current = value ?? throw new ArgumentNullException(nameof(value)); | ||
} | ||
set => _current = value ?? throw new ArgumentNullException(nameof(value)); | ||
} | ||
|
||
public abstract void WriteLine(string text); | ||
public abstract void WriteLine(string text); | ||
|
||
public static void ResetToDefault() | ||
{ | ||
_current = DefaultConsoleContext.Instance; | ||
} | ||
public static void ResetToDefault() | ||
{ | ||
_current = DefaultConsoleContext.Instance; | ||
} | ||
} | ||
} |
19 changes: 8 additions & 11 deletions
19
src/LocalStack.AwsLocal/AmbientContexts/DefaultConsoleContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
using System; | ||
namespace LocalStack.AwsLocal.AmbientContexts; | ||
|
||
namespace LocalStack.AwsLocal.AmbientContexts | ||
public class DefaultConsoleContext : ConsoleContext | ||
{ | ||
public class DefaultConsoleContext : ConsoleContext | ||
{ | ||
private static readonly Lazy<DefaultConsoleContext> LazyInstance = new Lazy<DefaultConsoleContext>(() => new DefaultConsoleContext()); | ||
|
||
public override void WriteLine(string text) | ||
{ | ||
Console.WriteLine(text); | ||
} | ||
private static readonly Lazy<DefaultConsoleContext> LazyInstance = new(() => new DefaultConsoleContext()); | ||
|
||
public static DefaultConsoleContext Instance => LazyInstance.Value; | ||
public override void WriteLine(string text) | ||
{ | ||
Console.WriteLine(text); | ||
} | ||
|
||
public static DefaultConsoleContext Instance => LazyInstance.Value; | ||
} |
19 changes: 8 additions & 11 deletions
19
src/LocalStack.AwsLocal/AmbientContexts/DefaultEnvironmentContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
using System; | ||
namespace LocalStack.AwsLocal.AmbientContexts; | ||
|
||
namespace LocalStack.AwsLocal.AmbientContexts | ||
public class DefaultEnvironmentContext : EnvironmentContext | ||
{ | ||
public class DefaultEnvironmentContext : EnvironmentContext | ||
{ | ||
private static readonly Lazy<DefaultEnvironmentContext> LazyInstance = new Lazy<DefaultEnvironmentContext>(() => new DefaultEnvironmentContext()); | ||
|
||
public override void Exit(int value) | ||
{ | ||
Environment.Exit(value); | ||
} | ||
private static readonly Lazy<DefaultEnvironmentContext> LazyInstance = new(valueFactory: () => new DefaultEnvironmentContext()); | ||
|
||
public static DefaultEnvironmentContext Instance => LazyInstance.Value; | ||
public override void Exit(int value) | ||
{ | ||
Environment.Exit(value); | ||
} | ||
|
||
public static DefaultEnvironmentContext Instance => LazyInstance.Value; | ||
} |
29 changes: 13 additions & 16 deletions
29
src/LocalStack.AwsLocal/AmbientContexts/EnvironmentContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
using System; | ||
namespace LocalStack.AwsLocal.AmbientContexts; | ||
|
||
namespace LocalStack.AwsLocal.AmbientContexts | ||
public abstract class EnvironmentContext | ||
{ | ||
public abstract class EnvironmentContext | ||
{ | ||
private static EnvironmentContext _current = DefaultEnvironmentContext.Instance; | ||
private static EnvironmentContext _current = DefaultEnvironmentContext.Instance; | ||
|
||
public static EnvironmentContext Current | ||
{ | ||
get => _current; | ||
public static EnvironmentContext Current | ||
{ | ||
get => _current; | ||
|
||
set => _current = value ?? throw new ArgumentNullException(nameof(value)); | ||
} | ||
set => _current = value ?? throw new ArgumentNullException(nameof(value)); | ||
} | ||
|
||
public abstract void Exit(int value); | ||
public abstract void Exit(int value); | ||
|
||
public static void ResetToDefault() | ||
{ | ||
_current = DefaultEnvironmentContext.Instance; | ||
} | ||
public static void ResetToDefault() | ||
{ | ||
_current = DefaultEnvironmentContext.Instance; | ||
} | ||
} | ||
} |
Oops, something went wrong.