public void Disconnect() { Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} started", MethodInfo.GetCurrentMethod().GetFullName())); }); try { if (CashAppContext != null) { CashAppContext.Logout(); } } catch (Exception ex) { TBYAppContextFIXDisconnectException tex = new TBYAppContextFIXDisconnectException("5029", MethodBase.GetCurrentMethod().GetFullName(), "Hisse FIX bağlantısı sonlandırılırken hata oluştu", ex); Exception(tex); } try { if (VIOPAppContext != null) { VIOPAppContext.Logout(); } } catch (Exception ex) { TBYException tex = new TBYAppContextFIXDisconnectException("5029", MethodBase.GetCurrentMethod().GetFullName(), "VIOP FIX bağlantısı sonlandırılırken hata oluştu", ex); Exception(tex); } Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} end", MethodInfo.GetCurrentMethod().GetFullName())); }); }
public void SendStatusOrderCash(Teb.FIX.Contents.Content co, out bool isSend) { Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} started", MethodInfo.GetCurrentMethod().GetFullName())); }); CashAppContext.SendStatusOrder(co, out isSend); Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} end", MethodInfo.GetCurrentMethod().GetFullName())); }); }
public void CashLoadOrders() { Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} started", MethodInfo.GetCurrentMethod().GetFullName())); }); CashAppContext.LoadOrders(); Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} end", MethodInfo.GetCurrentMethod().GetFullName())); }); }
public void CashConnectOrDisconnect() { Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} started", MethodInfo.GetCurrentMethod().GetFullName())); }); if (CanLogout(CashAppContext)) { CashAppContext.Logout(); } else if (CanLogon(CashAppContext)) { CashAppContext.Logon(); } Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} end", MethodInfo.GetCurrentMethod().GetFullName())); }); }
public void Connect(System.Collections.Generic.List <Teb.FIX.Model.Order> cashOrders, System.Collections.Generic.List <Teb.FIX.Model.Order> futureOrders) { Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} started", MethodInfo.GetCurrentMethod().GetFullName())); }); Task.Factory.StartNew(() => { //bool state = false; try { if (CurrentUser.Instance.User != null) { if (CurrentUser.Instance.User.AutoConnectToCash && CashAppContext != null) { CashAppContext.LogonWithOrders(cashOrders); } } } catch (Exception ex) { TBYException tex = new TBYAppContextFIXConnectException("5029", MethodBase.GetCurrentMethod().GetFullName(), "Hisse FIX bağlantısı kurulurken hata oluştu", ex); Exception(tex); } }); Task.Factory.StartNew(() => { //bool state = false; try { if (CurrentUser.Instance.User != null) { if (CurrentUser.Instance.User.AutoConnectToFuture && VIOPAppContext != null) { VIOPAppContext.LogonWithOrders(futureOrders); } } } catch (Exception ex) { TBYException tex = new TBYAppContextFIXConnectException("5029", MethodBase.GetCurrentMethod().GetFullName(), "VIOP FIX bağlantısı kurulurken hata oluştu", ex); Exception(tex); } }); Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} end", MethodInfo.GetCurrentMethod().GetFullName())); }); }
public void Dispose() { Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} started", MethodInfo.GetCurrentMethod().GetFullName())); }); try { CashAppContext.Dispose(); VIOPAppContext.Dispose(); CashAppContext = null; VIOPAppContext = null; } catch (Exception ex) { TBYException tex = new TBYAppContextStopException("5035", MethodBase.GetCurrentMethod().GetFullName(), "FIXContext Dispose hatası oluştu", ex); Exception(tex); } Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} end", MethodInfo.GetCurrentMethod().GetFullName())); }); }
public void Clear() { Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} started", MethodInfo.GetCurrentMethod().GetFullName())); }); Task.Factory.StartNew(() => { try { if (CashAppContext != null && CashAppContext.OrderHandler != null) { CashAppContext.Clear(); } } catch (Exception ex) { TBYException tex = new TBYAppContextFIXConnectException("5029", MethodBase.GetCurrentMethod().GetFullName(), "Hisse emirleri silinirken hata oluştu", ex); Exception(tex); } }); Task.Factory.StartNew(() => { try { if (VIOPAppContext != null && VIOPAppContext.OrderHandler != null) { VIOPAppContext.Clear(); } } catch (Exception ex) { TBYException tex = new TBYAppContextFIXConnectException("5029", MethodBase.GetCurrentMethod().GetFullName(), "VIOP emirleri silinirken hata oluştu", ex); Exception(tex); } }); Debug.DebugHelper.Run(() => { Debug.DebugHelper.Log(String.Format("{0} end", MethodInfo.GetCurrentMethod().GetFullName())); }); }