Esempio n. 1
0
		static PortfolioManager()
		{
			PortfolioManager.pricer = new PortfolioPricer();

			Type connectionType = null;
			string connectionString = string.Empty;
			switch (Framework.Storage.ServerType)
			{
                case DbServerType.SQLITE:
                    connectionType = Type.GetType("SQLiteConnection");
                    connectionString = string.Format("Data Source={0};Pooling=true;FailIfMissing=false;", Path.Combine(Framework.Installation.DataDir.FullName, "freequant.db"));
                    break;
                default:
                    throw new NotSupportedException("This db is not support yet.");
            }

//            PortfolioManager.server = new PortfolioDbServer();
            PortfolioManager.server = new PortfolioFileServer();
			PortfolioManager.server.Open(connectionType, connectionString);
			PortfolioManager.portfolios = PortfolioManager.server.Load();
		}
Esempio n. 2
0
        static PortfolioManager()
        {
            PortfolioManager.pricer = new PortfolioPricer();

            Type   connectionType   = null;
            string connectionString = string.Empty;

            switch (Framework.Storage.ServerType)
            {
            case DbServerType.SQLITE:
                connectionType   = Type.GetType("SQLiteConnection");
                connectionString = string.Format("Data Source={0};Pooling=true;FailIfMissing=false;", Path.Combine(Framework.Installation.DataDir.FullName, "freequant.db"));
                break;

            default:
                throw new NotSupportedException("This db is not support yet.");
            }

//            PortfolioManager.server = new PortfolioDbServer();
            PortfolioManager.server = new PortfolioFileServer();
            PortfolioManager.server.Open(connectionType, connectionString);
            PortfolioManager.portfolios = PortfolioManager.server.Load();
        }