Beispiel #1
0
 public ConnectAPI()
 {
     session = new XASessionClass();
     query   = new XAQueryClass();
     real    = new XARealClass();
     SetLogin(new Secret(), session.ConnectServer(server[1], 20001));
 }
Beispiel #2
0
        bool 실계좌여부 = false;                                                                                              //모의투자/실계좌 처리방법의 구분을 위함

        public MainForm()
        {
            InitializeComponent();

            myXASessionClass = new XASessionClass();
            myXASessionClass._IXASessionEvents_Event_Login += new XA_SESSIONLib._IXASessionEvents_LoginEventHandler(myXASessionClass__IXASessionEvents_Event_Login);
            myXASessionClass.Disconnect += new XA_SESSIONLib._IXASessionEvents_DisconnectEventHandler(myXASessionClass_Disconnect);
        }
Beispiel #3
0
 public GoblinBat()
 {
     InitializeComponent();
     api   = new XASessionClass();
     query = new XAQueryClass();
     real  = new XARealClass();
     SetLogin(new Secret(), api.ConnectServer(new Server().GetSelectServer("1"), 20001));
 }
Beispiel #4
0
        internal StartUp(XASessionClass session)
        {
            secret = new Secret();

            if (session.ConnectServer(secret.Server[1], secret.Port) && session.Login(secret.InfoToConnect[0], secret.InfoToConnect[1], secret.InfoToConnect[2], 0, true))
            {
                this.session = session;
                session._IXASessionEvents_Event_Login += OnEventConnect;
                session.Disconnect += OnReceiveDisconnect;
            }
            else
            {
            }
            InitializeComponent();
        }
Beispiel #5
0
        public bool ConnectWithLogin(LoginInfo user)
        {
            _xingSession = new XASessionClass();
            _xingSession._IXASessionEvents_Event_Login += _xingSession_Login;

#pragma warning disable CS0618
            _xingSession.Disconnect += XingSession_Disconnect;
            _xingSession._IXASessionEvents_Event_Logout += _xingSession_Logout;
#pragma warning restore CS0618

            string serverAddress = (_useDemoServer == true) ? "demo.etrade.co.kr" : "hts.etrade.co.kr";
            bool   bConnect      = _xingSession.ConnectServer(serverAddress, 20001);

            if (bConnect == true)
            {
                return(LoginTo(user));
            }

            return(false);
        }
Beispiel #6
0
        private void CleanResources()
        {
            if (_xingSession == null)
            {
                return;
            }

            if (_loggedIn == true)
            {
                _xingSession.Logout();
            }

            if (_xingSession.IsConnected() == true)
            {
                _xingSession.DisconnectServer();
            }

            if (_xingSession != null)
            {
                Marshal.ReleaseComObject(_xingSession);
                _xingSession = null;
            }
        }