Пример #1
0
        public void SetUp()
        {
            subForm = Mock.Create <SubForm>(Behavior.Strict);

            subject = new LookupControl();
            subject.SubFormFactory = () => subForm;
        }
Пример #2
0
        private void metroTile1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            SubForm search = new SubForm();

            search.Location = this.Location;
            search.ShowDialog();
            this.Close();
        }
Пример #3
0
 private void Clicked_Button(object sender, EventArgs e)
 {
     if (formStack.Count < 3)
     {
         SubForm sub = new SubForm();
         sub.Visible = true;
     }
     else
     {
         MessageBox.Show("더 이상 생성할수 없습니다.", "No");
     }
 }
Пример #4
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);
     }
 }
Пример #5
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();
     }
 }
Пример #6
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);
            }
        }
Пример #7
0
        private void AbrirForm <SubForm>() where SubForm : Form, new()
        {
            Form frmChild = new Form();

            frmChild = pnlChildForms.Controls.OfType <SubForm>().FirstOrDefault();

            if (frmChild == null)
            {
                frmChild          = new SubForm();
                frmChild.TopLevel = false;
                frmChild.Dock     = DockStyle.Fill;
                pnlChildForms.Controls.Add(frmChild);
                pnlChildForms.Tag = frmChild;
                frmChild.Show();
                frmChild.BringToFront();
            }
            else
            {
                frmChild.BringToFront();
            }
        }
Пример #8
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);
            }
        }
Пример #9
0
        public void MainForm_DestroyOldHandleWithThreadExit_CallsHandler()
        {
            var mainForm    = new SubForm();
            var newMainForm = new SubForm();
            var context     = new ApplicationContext(mainForm)
            {
                MainForm = newMainForm
            };
            int          callCount = 0;
            EventHandler handler   = (sender, e) =>
            {
                Assert.Same(context, sender);
                Assert.Same(EventArgs.Empty, e);
                callCount++;
            };

            context.ThreadExit += handler;

            Assert.NotEqual(IntPtr.Zero, mainForm.Handle);
            Assert.Equal(0, callCount);

            Assert.NotEqual(IntPtr.Zero, newMainForm.Handle);
            Assert.Equal(0, callCount);

            mainForm.OnHandleDestroyed(EventArgs.Empty);
            Assert.Equal(0, callCount);

            newMainForm.OnHandleDestroyed(EventArgs.Empty);
            Assert.Equal(1, callCount);

            // Call again.
            mainForm.OnHandleDestroyed(EventArgs.Empty);
            Assert.Equal(1, callCount);

            newMainForm.OnHandleDestroyed(EventArgs.Empty);
            Assert.Equal(1, callCount);
        }
Пример #10
0
        public void MainForm_RecreateHandleWithThreadExit_DoesNotCallHandler()
        {
            var          mainForm  = new SubForm();
            var          context   = new ApplicationContext(mainForm);
            int          callCount = 0;
            EventHandler handler   = (sender, e) =>
            {
                Assert.Same(context, sender);
                Assert.Same(EventArgs.Empty, e);
                callCount++;
            };

            context.ThreadExit += handler;

            Assert.NotEqual(IntPtr.Zero, mainForm.Handle);
            Assert.Equal(0, callCount);

            mainForm.RecreateHandle();
            Assert.Equal(0, callCount);

            // Call again.
            mainForm.RecreateHandle();
            Assert.Equal(0, callCount);
        }
Пример #11
0
 private void FiltrujTabelę(object sender, EventArgs e)
 {
     SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.karty_ocenBindingSource, this.bazaDanychDataSet.Karty_ocen);
 }
 private void ResetujFiltr(object sender, EventArgs e)
 {
     SubForm.ResetujFiltr(ref this.filterValue, ref this.filterBy, ref this.nauczycieleBindingSource);
 }
 private void FiltrujTabelę(object sender, EventArgs e)
 {
     SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.nauczycieleBindingSource, this.bazaDanychDataSet.Nauczyciele);
 }
 private void SygnalizujZamknięcie(object sender, FormClosedEventArgs e)
 {
     SubForm.SygnalizuZamknięcie(ref main, CurrentSubForm.NauczycielePrzeglądanie);
 }
Пример #15
0
 public RoleUcForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #16
0
 private void SygnalizuZamknięcie(object sender, FormClosedEventArgs e)
 {
     SubForm.SygnalizuZamknięcie(ref main, CurrentSubForm.KartyOcenPrzeglądanie);
 }
Пример #17
0
 private void ResetujFiltr(object sender, EventArgs e)
 {
     SubForm.ResetujFiltr(ref this.filterValue, ref this.filterBy, ref this.karty_ocenBindingSource);
 }
 public PgmTransferWarningSettingForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #19
0
 public ShippingAddressForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #20
0
 private void FiltrujTabelę(object sender, EventArgs e)
 {
     SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.plan_zajęćBindingSource, this.bazaDanychDataSet.Plan_zajęć);
 }
Пример #21
0
 public ShippingInfoConfirmOrderForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #22
0
 public CurrencyForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #23
0
 public WarehouseForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #24
0
        private void 두번째폼열기ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SubForm sub = new SubForm();

            sub.Visible = true;
        }
Пример #25
0
 private void FiltrujTabelę(object sender, EventArgs e)
 {
     SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.rodzaje_pracBindingSource, this.bazaDanychDataSet.Rodzaje_prac);
 }
Пример #26
0
 private void ResetujFiltr(object sender, EventArgs e)
 {
     SubForm.ResetujFiltr(ref this.filterValue, ref this.filterBy, ref this.rodzaje_pracBindingSource);
 }
Пример #27
0
 public BusinessTypeForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #28
0
 public ItemKindForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #29
0
 public TaskNotifyOrderForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }
Пример #30
0
 public ProjectForm(SubForm ownerForm)
 {
     InitializeComponent();
     this._ownerFrom = ownerForm;
 }