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); }
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 }); }
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; }
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 }))); }
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); }
private void OnDialogClose(EventArgs e) { DialogClose?.Invoke(this, e); }
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); }
public static MessageBox ShowError(string Title, string Message, DialogClose oCallback) { return(Show(Title, Message, MsgBoxButtons.OK, MsgBoxIcon.Error, oCallback)); }
public static MessageBox ShowInformation(string Title, string Message, DialogClose oCallback) { return(Show(Title, Message, MsgBoxButtons.OK, MsgBoxIcon.Information, oCallback)); }