Last active
August 29, 2015 14:15
-
-
Save adamralph/e59044baa3472cf3fce2 to your computer and use it in GitHub Desktop.
Using ConfigR to pass values to your app via a static class
This file contains hidden or 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
#r MyApp.exe | |
using MyApp; | |
Settings.Foo = "Bar"; |
This file contains hidden or 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
namespace MyApp | |
{ | |
using ConfigR; | |
public static class Program | |
{ | |
public static void Main() | |
{ | |
Config.Global.LoadLocalScriptFile(); | |
Console.WriteLine(Settings.Foo); | |
} | |
} | |
} |
This file contains hidden or 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
namespace MyApp | |
{ | |
public static class Settings | |
{ | |
public static string Foo { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment