コード例 #1
0
ファイル: TestIQFeed.cs プロジェクト: michaelwills/tradelink
        public void setup()
        {
            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            if (!isserverconok)
            {
                server = new TradeLink.Common.TLServer_WM();
                con    = new IQFeedHelper(server);
                con.VerboseDebugging = verbosesetting;
                con.SendDebug       += new DebugDelegate(g.d);
                // get login information
                var data = Util.getfile(loginfile, g.d);
                Assert.IsFalse(string.IsNullOrWhiteSpace(data), "no login info");
                var li = data.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                Assert.AreEqual(3, li.Length, "missing login info");
                // attempt to startup connection
                con.Start(li[userr], li[pwr], li[prodr], Util.TLBuild());
                // wait a moment
                Util.sleep(4000);
                Assert.IsTrue(isserverconok, "server connection failed");
            }

            if (isserverconok && !isclientconok)
            {
                var c = new TLClient_WM("tempiqclient", false);
                c.VerboseDebugging = verbosesetting;
                c.SendDebugEvent  += new DebugDelegate(g.d);

                if (c.ProvidersAvailable[0] != Providers.IQFeed)
                {
                    throw new Exception("unable to find test server");
                }
                c.Mode(0, false);
                client = c;


                client.gotUnknownMessage += new MessageDelegate(client_gotUnknownMessage);

                // verify
                Assert.IsTrue(isclientconok, "client connection failed");
            }
            // reset everything
            mt = new MessageTracker();
            mt.VerboseDebugging = verbosesetting;
            blt           = new BarListTracker();
            mt.BLT        = blt;
            mt.SendDebug += new DebugDelegate(g.d);
            mt.GotNewBar += new SymBarIntervalDelegate(mt_GotNewBar);
            recvbarcount  = 0;
            msgok         = true;
            g.d("iqfeed started.");
            // wait a moment
            Util.sleep(1000);
        }
コード例 #2
0
ファイル: TestIQFeed.cs プロジェクト: antonywu/tradelink
        public void setup()
        {
            
            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            
            if (!isserverconok)
            {
                server = new TradeLink.Common.TLServer_WM();
                con = new IQFeedHelper(server);
                con.VerboseDebugging = verbosesetting;
                con.SendDebug += new DebugDelegate(g.d);
                // get login information
                var data = Util.getfile(loginfile, g.d);
                Assert.IsFalse(string.IsNullOrWhiteSpace(data), "no login info");
                var li = data.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                Assert.AreEqual(3, li.Length, "missing login info");
                // attempt to startup connection
                con.Start(li[userr], li[pwr], li[prodr], Util.TLBuild());
                // wait a moment
                Util.sleep(4000);
                Assert.IsTrue(isserverconok, "server connection failed");
            }

            if (isserverconok && !isclientconok)
            {
                var c = new TLClient_WM("tempiqclient", false);
                c.VerboseDebugging = verbosesetting;
                c.SendDebugEvent += new DebugDelegate(g.d);

                if (c.ProvidersAvailable[0]!= Providers.IQFeed)
                    throw new Exception("unable to find test server");
                c.Mode(0, false);
                client = c;


                client.gotUnknownMessage += new MessageDelegate(client_gotUnknownMessage);
               
                // verify
                Assert.IsTrue(isclientconok, "client connection failed");
            }
            // reset everything
            mt = new MessageTracker();
            mt.VerboseDebugging = verbosesetting; 
            blt = new BarListTracker();
            mt.BLT = blt;
            mt.SendDebug += new DebugDelegate(g.d);
            mt.GotNewBar += new SymBarIntervalDelegate(mt_GotNewBar);
            recvbarcount = 0;
            msgok = true;
            g.d("iqfeed started.");
            // wait a moment
            Util.sleep(1000);
        }
コード例 #3
0
 private void _login_Click(object sender, EventArgs e)
 {
     _helper.Start(_user.Text, _pass.Text, pc, Util.TLBuild());
 }
コード例 #4
0
 private void _login_Click(object sender, EventArgs e)
 {
     _helper.Start(_user.Text, _pass.Text, Properties.Settings.Default.PROGRAM_NAME, 0);
 }