Esempio n. 1
0
 public void OnReceiveClose(object sender, DialogClose e)
 {
     for (int i = 0; i < e.Param.Length; i++)
     {
         string.Concat("numeric", Enum.GetName(typeof(IStatistics.Numeric), i)).FindByName <NumericUpDown>(this).Value = int.Parse(e.Param[i]);
     }
 }
 public void CloseDialog(bool?result)
 {
     if (_tcs.Task.IsCompleted)
     {
         return;
     }
     _tcs.SetResult(result);
     DialogClose?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 3
0
 private void OnReceiveClose(object sender, DialogClose e)
 {
     SuspendLayout();
     StartTrading(Balance.Get(), ConfirmOrder.Get(), new AccountSelection(), new ConnectKHOpenAPI());
     strategy = new Strategy(new Specify
     {
         Reaction        = e.Reaction,
         ShortDayPeriod  = e.ShortDay,
         ShortTickPeriod = e.ShortTick,
         LongDayPeriod   = e.LongDay,
         LongTickPeriod  = e.LongTick,
         HedgeType       = e.Hedge
     });
 }
Esempio n. 4
0
        public MessageBox(string Title, string Message, MsgBoxButtons Buttons, MsgBoxIcon Icon, DialogClose oCallback)
        {
            InitializeComponent();

            ModalHost  = new ModalControl();
            _oCallback = oCallback;

            btOne.Click   += OneClick;
            btTwo.Click   += OneClick;
            btCross.Click += OneClick;

            //if (string.IsNullOrEmpty(Title))
            //    txtTitle.Text = "Error";
            //  else
            txtTitle.Text = Title;

            txtMessage.Text = Message;

            if (Buttons == MsgBoxButtons.YesNo)
            {
                btOne.Content = "Yes";
                btOne.Tag     = DialogExit.OK;

                btTwo.Content = "No";
                btTwo.Tag     = DialogExit.Cancel;
            }
            else
            {
                btOne.Visibility = Visibility.Collapsed;
                btTwo.Content    = "OK";
                btTwo.Tag        = DialogExit.Cancel;
            }

            btCross.Tag = DialogExit.Cancel;

            _lblIcon.Text = Icon.ToString();


            //string sImagePath = @"Resources\error_img.png";

            //if (Icon == MsgBoxIcon.Warning)
            //    sImagePath = "/images/warning.png";
            //else if (Icon == MsgBoxIcon.Error)
            //    sImagePath = "/images/error.png";

            //BitmapImage oImage = new BitmapImage();
            //oImage.UriSource = new Uri(sImagePath);
            ////oImage.SetSource(Application.GetResourceStream(new Uri(sImagePath)).Stream);
            //_imgIcon.Source = oImage;
        }
Esempio n. 5
0
 private void OnReceiveClose(object sender, DialogClose e)
 {
     SuspendLayout();
     StartTrading(Balance.Get(), ConfirmOrder.Get(), new AccountSelection(), new ConnectKHOpenAPI());
     BeginInvoke(new Action(() => Strategy = new Strategy(new Specify
     {
         Reaction        = e.Reaction,
         ShortDayPeriod  = e.ShortDay,
         ShortTickPeriod = e.ShortTick,
         LongDayPeriod   = e.LongDay,
         LongTickPeriod  = e.LongTick,
         HedgeType       = e.Hedge,
         Base            = e.Base,
         Sigma           = e.Sigma,
         Percent         = e.Percent,
         Max             = e.Max,
         Quantity        = e.Quantity,
         Time            = e.Time
     })));
 }
Esempio n. 6
0
 private void OnReceiveClose(object sender, DialogClose e)
 {
     SuspendLayout();
     StartTrading(Balance.Get(), ConfirmOrder.Get(), new AccountSelection(), new ConnectKHOpenAPI());
     result = BeginInvoke(new Action(() =>
     {
         strategy = new Strategy(new Specify
         {
             Reaction        = e.Reaction,
             ShortDayPeriod  = e.ShortDay,
             ShortTickPeriod = e.ShortTick,
             LongDayPeriod   = e.LongDay,
             LongTickPeriod  = e.LongTick,
             HedgeType       = e.Hedge
         });
     }));
     do
     {
         Application.DoEvents();
     }while (result.IsCompleted == false);
 }
Esempio n. 7
0
 private void OnDialogClose(EventArgs e)
 {
     DialogClose?.Invoke(this, e);
 }
Esempio n. 8
0
        public static MessageBox Show(string Title, string Message, MsgBoxButtons Buttons, MsgBoxIcon Icon, DialogClose oCallback)
        {
            MessageBox oBox = new MessageBox(Title, Message, Buttons, Icon, oCallback);

            oBox.ModalHost.ShowModal(oBox);

            return(oBox);
        }
Esempio n. 9
0
 public static MessageBox ShowError(string Title, string Message, DialogClose oCallback)
 {
     return(Show(Title, Message, MsgBoxButtons.OK, MsgBoxIcon.Error, oCallback));
 }
Esempio n. 10
0
 public static MessageBox ShowInformation(string Title, string Message, DialogClose oCallback)
 {
     return(Show(Title, Message, MsgBoxButtons.OK, MsgBoxIcon.Information, oCallback));
 }