Created
May 29, 2019 09:24
-
-
Save al1b/65679c91d96dd9559f683ea970148688 to your computer and use it in GitHub Desktop.
Simple implemention of ICompilerSettings
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
class CompilerSettings : ICompilerSettings | |
{ | |
private readonly CompilerLanguage _compilerLang; | |
private readonly string _rootDirectory = new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath; | |
private string _compilerPath => _compilerLang == CompilerLanguage.CSharp | |
? @"roslyn\csc.exe" | |
: @"roslyn\vbc.exe"; | |
public CompilerSettings(CompilerLanguage compiler = CompilerLanguage.CSharp) | |
{ | |
_compilerLang = compiler; | |
} | |
public string CompilerFullPath => Path.Combine(_rootDirectory, _compilerPath); | |
public int CompilerServerTimeToLive => 60 * 15; | |
public enum CompilerLanguage | |
{ | |
CSharp, | |
VB | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment