コード例 #1
0
        private void ToolStripButton_ModifyTemplate_Click(object sender, System.EventArgs e)
        {
            StockTemplate stockTemplate = GetSelectTemplate();

            if (stockTemplate == null)
            {
                return;
            }

            TemplateDialog dialog = new TemplateDialog();

            dialog.SaveData     += new FormLoadHandler(Dialog_ModifyTemplate);
            dialog.Owner         = this;
            dialog.StartPosition = FormStartPosition.CenterParent;
            dialog.OnLoadControl(dialog, null);
            dialog.OnLoadData(dialog, stockTemplate);
            dialog.ShowDialog();
            if (dialog.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                MessageDialog.Info(this, msgModifySuccess);
                dialog.Dispose();
            }
            else
            {
                dialog.Close();
                dialog.Dispose();
            }
        }
コード例 #2
0
        private async void MobileTemplate_Click(object sender, RoutedEventArgs e)
        {
            TemplateDialog td = new TemplateDialog();
            await td.ShowAsync();

            BitmapImage bm = new BitmapImage(new Uri($"ms-appx:///Assets/{td.templateChoice.ToString()}.png", UriKind.Absolute));

            bgTemplate.Source = bm;

            //Update template
            templateChoice = td.templateChoice;
        }
コード例 #3
0
        private void ToolStripButton_AddTemplate_Click(object sender, System.EventArgs e)
        {
            TemplateDialog dialog = new TemplateDialog();

            dialog.SaveData     += new FormSaveHandler(Dialog_NewTemplate);
            dialog.Owner         = this;
            dialog.StartPosition = FormStartPosition.CenterParent;
            dialog.OnLoadControl(dialog, null);
            dialog.OnLoadData(dialog, null);
            dialog.ShowDialog();

            if (dialog.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                dialog.Dispose();
            }
            else
            {
                dialog.Dispose();
            }
        }
コード例 #4
0
        private void ModifyTemplate(StockTemplate template)
        {
            TemplateDialog dialog = new TemplateDialog();

            dialog.SaveData     += new FormSaveHandler(Dialog_ModifyTemplate);
            dialog.Owner         = this;
            dialog.StartPosition = FormStartPosition.CenterParent;
            dialog.OnLoadControl(dialog, null);
            dialog.OnLoadData(dialog, template);
            dialog.ShowDialog();
            if (dialog.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                MessageDialog.Info(this, msgModifySuccess);
                dialog.Dispose();
            }
            else
            {
                dialog.Close();
                dialog.Dispose();
            }
        }
コード例 #5
0
 private void simpleButtonCloneDialog_Click(object sender, EventArgs e)
 {
     WaitDialog.Show(ParentForm, "Loading components...");
     popupDialogTemplate = new PopupDialog();
     popupDialogTemplate.MaximizeBox = false;
     popupDialogTemplate.MinimizeBox = false;
     popupDialogTemplate.StartPosition = FormStartPosition.CenterScreen;
     popupDialogTemplate.Text = "Clone Dialog From All Dialog Templates";
     ucTemplateDialog1 = new TemplateDialog();
     ucTemplateDialog1.Dock = DockStyle.Fill;
     ucTemplateDialog1.ParentController = this;
     popupDialogTemplate.Controls.Add(ucTemplateDialog1);
     popupDialogTemplate.ClientSize = new Size(ucTemplateDialog1.Width + 10, ucTemplateDialog1.Height + 10);
     popupDialogTemplate.FormClosed += new FormClosedEventHandler(popupDialogTemplate_FormClosed);
     WaitDialog.Close();
     popupDialogTemplate.ShowDialog(this.ParentForm);
 }