32 lines
717 B
C#
32 lines
717 B
C#
|
using System;
|
|||
|
using System.IO;
|
|||
|
using System.Runtime.CompilerServices;
|
|||
|
using sharp.extensions;
|
|||
|
namespace sharp.trading
|
|||
|
{
|
|||
|
public static class TradingEnvironment
|
|||
|
{
|
|||
|
private static string _datadirectory = initialDataDirectory();
|
|||
|
public static string DataDirectory {
|
|||
|
get { return _datadirectory; }
|
|||
|
set {
|
|||
|
_datadirectory = value;
|
|||
|
DirectoryExtensions.EnsureDirectoryExists(_datadirectory);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public static TradingConnection DefaultConnection { get; set; }
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
private static string initialDataDirectory(){
|
|||
|
string p = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),".sharp.trading");
|
|||
|
DirectoryExtensions.EnsureDirectoryExists(p);
|
|||
|
return p;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|