Exemple #1
0
        private void metroTile1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            SubForm search = new SubForm();

            search.Location = this.Location;
            search.ShowDialog();
            this.Close();
        }
Exemple #2
0
 /// <summary>
 /// 监听到事件后的事件处理程序
 /// </summary>
 /// <param name="eventObject"></param>
 private void OnClickEventReceived(ShowDialogEventSourceObject eventObject)
 {
     if (MessageBox.Show("您确定要打开新弹窗吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) != DialogResult.OK)
     {
         return;
     }
     using (SubForm dialog = new SubForm(eventObject?.ClickInfo))
     {
         dialog.ShowDialog();
         eventObject?.Callback?.Invoke(true, eventObject?.ClickInfo);
     }
 }
Exemple #3
0
 private void Sum_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms.Count > 0)
     {
         Application.OpenForms[0].Activate();
     }
     else
     {
         SubForm subForm = new SubForm(encoding);
         subForm.ShowDialog();
     }
 }
Exemple #4
0
        private void addButton_Click(object sender, EventArgs e)
        {
            SubForm sub = new SubForm(Buyers, Items);

            sub.ShowDialog();
            if (sub.DialogResult == DialogResult.OK)
            {
                foreach (Order o in sub.results)
                {
                    orderService.AddOrder(o);
                }
                orderService.OrderBy();
                orderBindingSource.ResetBindings(false);
            }
        }
        public void EvalTestSearch()
        {
            SubModel model = null;

            SetDotNetProperty(subject, "txtDisplay", "Text", "b");

            Mock.ArrangeSet(() => subForm.Model = Arg.IsAny <SubModel>()).DoInstead((SubModel m) =>
            {
                model = m;
                Assert.AreEqual("b", model.Stuff);
            });
            Mock.Arrange(() => subForm.ShowDialog()).DoInstead(() => {
                model.Stuff = "a";
            }).Returns(DialogResult.OK);
            Mock.Arrange(() => subForm.Model).Returns(() => model);

            FireDotNetEvent(subject, "btnSearch", "Click", EventArgs.Empty);

            Assert.AreEqual("a", GetDotNetProperty(subject, "txtDisplay", "Text"));
        }
Exemple #6
0
        private void modifyButton_Click(object sender, EventArgs e)
        {
            Order current = new Order();

            current = (Order)orderBindingSource.Current;
            SubForm sub = new SubForm(Buyers, Items, current)
            {
                Buyers = Buyers,
                Items  = Items
            };

            sub.ShowDialog();
            if (sub.DialogResult == DialogResult.OK)
            {
                orderBindingSource.Remove(orderBindingSource.Current);
                foreach (Order o in sub.results)
                {
                    orderService.AddOrder(o);
                }
                orderService.OrderBy();
                orderBindingSource.ResetBindings(false);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            var form = new SubForm(textBox1.Text);

            form.ShowDialog();
        }