Esempio n. 1
0
        public void ShowMsgWindowSafe(AccountEvent accountEvent)
        {
            var updateAction = UserSettings.Instance.GetAccountEventAction(accountEvent.AccountEventCode);
            if (updateAction == AccountEventAction.DoNothing)
                return;

            if (!AccountStatus.Instance.isAuthorized)
                return;
            if (InvokeRequired)
                BeginInvoke(new Action<IWin32Window, AccountEvent>(ShowMsgWindow), this, accountEvent);
            else
                ShowMsgWindow(this, accountEvent);
        }
Esempio n. 2
0
        public void NewPendingOrderResponse(PendingOrder order, RequestStatus status, string detailMessage)
        {
            var accountEvent = new AccountEvent(
                string.Format(Localizer.GetString("MessageNotificationPendingPlacedTitleFmt"), order.ID),

                string.Format(Localizer.GetString("MessageNotificationPendingPlacedBodyFmt"),
                    order.Side > 0 ? "BUY" : "SELL",
                    order.Volume, order.Symbol, order.PriceFrom, order.ID, order.AccountID), AccountEventCode.PendingOrder);
            ShowMsgWindowSafe(accountEvent);
            // проиграть звук - торговый ордер
            EventSoundPlayer.Instance.PlayEvent(VocalizedEvent.TradeResponse);
        }
 public void AppendMessage(AccountEvent accountEvent)
 {
     msgQueue.InQueue(new AccountEvent(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss") + ": " + accountEvent.Title,
                                       accountEvent.Body,
                                       accountEvent.AccountEventCode), 10000);
 }
Esempio n. 4
0
 private void ShowMsgWindow(IWin32Window owner, AccountEvent accountEvent)
 {
     foreach (var form in OwnedForms.OfType<SplashMessagesForm>())
     {
         form.AppendMessage(accountEvent);
         return;
     }
     var wnd = new SplashMessagesForm(accountEvent);
     wnd.Show(owner);
 }
 public SplashMessagesForm(AccountEvent message)
     : this()
 {
     AppendMessage(message);
 }