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(); } }
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; }
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(); } }
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(); } }
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); }