Exemplo n.º 1
0
        public bool ConnectQuotesServer(string strUser, string strPasswd, string strBRSQ, string strQuoteSrv, string strBookSrv)
        {
            try
            {
                if (!ValidateGrayboxInstallation())
                {
                    return(false);
                }
                GBQUOTESLib.GBServer gbServer = new GBQUOTESLib.GBServerClass();
                gbServer.Initialize(strUser, strPasswd, "", strQuoteSrv, strBookSrv);
                gbStockMgr = (GBQUOTESLib.GBStockManager)gbServer.GetStockManager("");

                bool bConnect = GrayBoxAPI.BlackBox.instance().Connect();
                if (bConnect)
                {
                    debug("Connected to Graybox");
                }
                else
                {
                    debug("Not connected to Graybox");
                    return(false);
                }

                return(true);
            }
            catch
            {
                debug("Graybox connection error");
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool ConnectQuotesServer(string strUser, string strPasswd, string strBRSQ, string strQuoteSrv, string strBookSrv)
        {
            try
            {
                if(!ValidateGrayboxInstallation()) return false;
                GBQUOTESLib.GBServer gbServer = new GBQUOTESLib.GBServerClass();
                gbServer.Initialize(strUser, strPasswd, "", strQuoteSrv, strBookSrv);
                gbStockMgr = (GBQUOTESLib.GBStockManager)gbServer.GetStockManager("");
                
                bool bConnect = GrayBoxAPI.BlackBox.instance().Connect();
                if (bConnect)
                {
                    debug("Connected to Graybox");
                }
                else
                {
                    debug("Not connected to Graybox");
                    return false;
                }

                return true;
            }
            catch
            {
                debug("Graybox connection error");
                return false;
            }
        }