public void Load(DesignerForm designer) { if (IsLoaded) { return; } Designer = designer; Config?.Load(); if (!OnLoad()) { return; } if (Config != null) { if (_SettingsMenu == null) { _SettingsMenu = new MenuItem("Settings", OnEditConfig); } Menu.MenuItems.Add(_SettingsMenu); Config.ValueChanged += OnUpdateConfig; } Designer.MenuPlugins.MenuItems.Add(Menu); IsLoaded = true; OnLoaded(); }
private void AddIcons(DesignerForm newDialog, XmlNodeList icons) { foreach (XmlNode icon in icons) { try { PictureBox picCtrl = new PictureBox(); SetControlAttributes(picCtrl, icon); picCtrl.SizeMode = PictureBoxSizeMode.StretchImage; string binaryId = GetTextFromXmlElement(icon); try { using (Stream imageStream = GetBinaryStream(binaryId)) { picCtrl.Image = new Icon(imageStream).ToBitmap(); } } catch { } newDialog.AddControl(icon, picCtrl); } catch { } } }
private void editDatasetWithDesignerToolStripMenuItem_Click(object sender, EventArgs e) { TreeNode node = g.SelectedNode; if (node == null) { return; } TableInfo info = node.Tag as TableInfo; if (info == null) { return; } DataSet datasets = info.datasets; if (datasets == null) { return; } DocumentForm df = ExplorerForms.ef.Command_OpenDocumentForm("Designer"); DesignerForm dvf = new DesignerForm(); dvf.FormBorderStyle = FormBorderStyle.None; dvf.TopLevel = false; dvf.Dock = DockStyle.Fill; dvf.LoadModel(datasets); dvf.Show(); df.Controls.Add(dvf); }
private void OnViewDesign(object sender, RoutedEventArgs e) { requestViewDesign = true; if (this.panelSheet.IsVisible) { this.panelSheet.Visibility = Visibility.Collapsed; buttonViewDesign.Content = "View Design"; Height = 170; designForm.SpreadSheet.Close(); designForm = null; } else { buttonViewDesign.Content = "Hide Design"; this.panelSheet.Visibility = Visibility.Visible; if (designForm == null) { designForm = new DesignerForm(SubjectType.DESIGN); designForm.EditedObject = design; designForm.periodicity = periodicity; designForm.BuildSheetTableWithoutFill(); } this.previewDesignBlock.Content = designForm; Height = 560; } }
public UndoPoint(DesignerForm Designer) { IEnumerator enumerator = null; this.Stack = new ArrayList(); this.GumpProperties = (GumpProperties)Designer.GumpProperties.Clone(); try { foreach (object stack in Designer.Stacks) { GroupElement objectValue = (GroupElement)RuntimeHelpers.GetObjectValue(stack); GroupElement groupElement = (GroupElement)objectValue.Clone(); this.Stack.Add(groupElement); if (objectValue == Designer.ElementStack) { this.ElementStack = groupElement; } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } }
public override void Load(DesignerForm frmDesigner) { _designer = frmDesigner; MenuItem menuItem = new MenuItem("RunUO Export", ExportClick); _designer.mnuFileExport.Enabled = true; _designer.mnuFileExport.MenuItems.Add(menuItem); }
internal DialogValidateRdl(DesignerForm designer) { _RdlDesigner = designer; // // Required for Windows Form Designer support // InitializeComponent(); return; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (DesignerForm designerForm = new DesignerForm()) { designerForm.ShowInTaskbar = true; designerForm.Designer.MdiMode = true; designerForm.ShowDialog(); } }
public override void Load(DesignerForm frmDesigner) { this.m_Designer = frmDesigner; this.mnu_FileExportPOLExport = new MenuItem("POL"); this.mnu_FileExportPOLExport.Click += new EventHandler(this.mnu_FileExportPOLExport_Click); if ( !this.m_Designer.mnuFileExport.Enabled ) { this.m_Designer.mnuFileExport.Enabled = true; } this.m_Designer.mnuFileExport.MenuItems.Add(this.mnu_FileExportPOLExport); base.Load(frmDesigner); }
public override void Load(DesignerForm frmDesigner) { this.m_Designer = frmDesigner; this.mnu_FileExportPOLExport = new MenuItem("POL"); this.mnu_FileExportPOLExport.Click += new EventHandler(this.mnu_FileExportPOLExport_Click); if (!this.m_Designer.mnuFileExport.Enabled) { this.m_Designer.mnuFileExport.Enabled = true; } this.m_Designer.mnuFileExport.MenuItems.Add(this.mnu_FileExportPOLExport); base.Load(frmDesigner); }
private void AddButtons(DesignerForm newDialog, XmlNodeList buttons) { foreach (XmlNode button in buttons) { try { Button newButton = new Button(); SetControlAttributes(newButton, button); if (button.Attributes["Icon"] != null && button.Attributes["Icon"].Value.ToLower() == "yes") { string binaryId = GetTextFromXmlElement(button); try { using (Stream imageStream = GetBinaryStream(binaryId)) { Bitmap bmp = new Icon(imageStream).ToBitmap(); Bitmap dest = new Bitmap((int)Math.Round(bmp.Width * scale), (int)Math.Round(bmp.Height * scale)); Graphics g = Graphics.FromImage(dest); g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(bmp, new Rectangle(0, 0, dest.Width, dest.Height), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel); g.Dispose(); bmp.Dispose(); newButton.Image = dest; } } catch { SetText(newButton, button); } } else { newButton.FlatStyle = FlatStyle.System; SetText(newButton, button); } newDialog.AddControl(button, newButton); } catch { } } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var designerForm = new DesignerForm { ExportViewerFactory = new ExportViewerFactory(), SessionSettingsStorage = new SessionSettingsStorage() }; Application.Run(designerForm); }
static internal bool GetSharedConnectionInfo(DesignerForm dsr, string filename, out string dataProvider, out string connectInfo) { dataProvider = null; connectInfo = null; string pswd = null; string xml = ""; try { pswd = dsr.GetPassword(); if (pswd == null) { return(false); } if (!filename.EndsWith(".dsr", StringComparison.InvariantCultureIgnoreCase)) { filename += ".dsr"; } xml = DataSourceReference.Retrieve(filename, pswd); } catch { MessageBox.Show("Unable to open shared connection, password or file is invalid.", "Test Connection"); dsr.ResetPassword(); // make sure to prompt again for the password return(false); } XmlDocument xDoc = new XmlDocument(); xDoc.LoadXml(xml); XmlNode xNodeLoop = xDoc.FirstChild; foreach (XmlNode node in xNodeLoop.ChildNodes) { switch (node.Name) { case "DataProvider": dataProvider = node.InnerText; break; case "ConnectString": connectInfo = node.InnerText; break; default: break; } } return(true); }
static void backgroundWorker_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { if (e.Error != null) { HandleException(e.Error, Resources.msgDatabaseError + ": " + e.Error.Message, Resources.databaseError); DesignerForm.SetDatabaseSupport(false); } else { Log.ShowMessage(Resources.msgDatabaseSuccess, Resources.databaseOk); DesignerForm.SetDatabaseSupport(true); } DesignerForm.StatusProgress.Value = DesignerForm.StatusProgress.Minimum; }
public static void Save(DesignerForm designerForm, XMLSettings options) { string fullPath = Path.Combine(designerForm.AppPath, "settings.xml"); using (XmlWriter xml = new XmlTextWriter(fullPath, Encoding.UTF8) { Formatting = Formatting.Indented }) { XmlSerializer serializer = new XmlSerializer(typeof(XMLSettings)); serializer.Serialize(xml, options); } }
/// <summary> /// The "Design Report" action. /// </summary> public void DesignReport() { // Get a reference to the parent designer's associated control WebReport webreport = (WebReport)_parent.Component; Report report = new Report(); bool fileBased = false; if (!String.IsNullOrEmpty(webreport.ReportFile)) { string fileName = webreport.ReportFile; fileName = MapPath(webreport.Site, fileName); report.Load(fileName); fileBased = true; } else if (!String.IsNullOrEmpty(webreport.ReportResourceString)) { report.ReportResourceString = webreport.ReportResourceString; } try { RegisterData(webreport, report, webreport.Site); } catch (Exception ex) { using (ExceptionForm form = new ExceptionForm(ex)) { form.ShowDialog(); } return; } using (DesignerForm designerForm = new DesignerForm()) { designerForm.Designer.Report = report; designerForm.Designer.AskSave = fileBased; designerForm.ShowInTaskbar = true; designerForm.ShowDialog(); if (designerForm.Designer.Modified && !fileBased) { string oldValue = webreport.ReportResourceString; webreport.ReportResourceString = report.SaveToStringBase64(); PropertyDescriptorCollection props = TypeDescriptor.GetProperties(webreport); PropertyDescriptor prop = props.Find("ReportResourceString", false); _parent.RaiseComponentChanged(prop, oldValue, webreport.ReportResourceString); } } }
public static XMLSettings Load(DesignerForm designerForm) { string fullPath = Path.Combine(designerForm.AppPath, "settings.xml"); if (!File.Exists(fullPath)) { return(new XMLSettings()); } using (XmlTextReader xml = new XmlTextReader(fullPath)) { XmlSerializer serializer = new XmlSerializer(typeof(XMLSettings)); return((XMLSettings)serializer.Deserialize(xml)); } }
private void AddPathEditBoxes(DesignerForm newDialog, XmlNodeList patheditboxes) { foreach (XmlNode pathEdit in patheditboxes) { try { TextBox newPathEdit = new TextBox(); SetControlAttributes(newPathEdit, pathEdit); SetText(newPathEdit, pathEdit); newDialog.AddControl(pathEdit, newPathEdit); } catch { } } }
private void AddCheckBoxes(DesignerForm newDialog, XmlNodeList checkboxes) { foreach (XmlNode check in checkboxes) { try { CheckBox checkBox = new CheckBox(); SetControlAttributes(checkBox, check); SetText(checkBox, check); newDialog.AddControl(check, checkBox); } catch { } } }
private void AddListBoxes(DesignerForm newDialog, XmlNodeList listBoxes) { foreach (XmlNode list in listBoxes) { try { ListBox listCtrl = new ListBox(); SetControlAttributes(listCtrl, list); listCtrl.Items.Add(GetFromXmlElement(list, "Property")); newDialog.AddControl(list, listCtrl); } catch { } } }
public override void Load(DesignerForm frmDesigner) { try { designer = frmDesigner; m_MenuConverter = new MenuItem("Hex Conversion Utility", new EventHandler(StartConverter), Shortcut.CtrlH); MenuItem utility = FindMenu(designer.MainMenu); utility.MenuItems.Add(m_MenuConverter); base.Load(frmDesigner); } catch (Exception e) { MessageBox.Show("Load(DesignerForm frmDesigner)\r\n" + e); Application.Exit(); } }
private void AddVolumeComboBoxes(DesignerForm newDialog, XmlNodeList volumeCombos) { foreach (XmlNode volumeCombo in volumeCombos) { try { ComboBox comboCtrl = new ComboBox(); comboCtrl.Items.Add("VolumeCombo"); comboCtrl.SelectedIndex = 0; SetControlAttributes(comboCtrl, volumeCombo); newDialog.AddControl(volumeCombo, comboCtrl); } catch { } } }
private void AddLines(DesignerForm newDialog, XmlNodeList lines) { foreach (XmlNode line in lines) { try { Label label = new Label(); SetControlAttributes(label, line); label.Height = 2; label.BorderStyle = BorderStyle.Fixed3D; newDialog.AddControl(line, label); } catch { } } }
private void AddTexts(DesignerForm newDialog, XmlNodeList texts) { foreach (XmlNode text in texts) { try { Label label = new Label(); SetControlAttributes(label, text); SetText(label, text); label.BackColor = Color.Transparent; newDialog.AddControl(text, label); } catch { } } }
private void AddProgressBars(DesignerForm newDialog, XmlNodeList progressBars) { foreach (XmlNode progressbar in progressBars) { try { ProgressBar progressCtrl = new ProgressBar(); SetControlAttributes(progressCtrl, progressbar); progressCtrl.Maximum = 100; progressCtrl.Value = 33; newDialog.AddControl(progressbar, progressCtrl); } catch { } } }
private void AddMaskedEdits(DesignerForm newDialog, XmlNodeList maskedEdits) { foreach (XmlNode edit in maskedEdits) { try { TextBox newEdit = new TextBox(); SetControlAttributes(newEdit, edit); SetText(newEdit, edit); newEdit.BorderStyle = BorderStyle.Fixed3D; newDialog.AddControl(edit, newEdit); } catch { } } }
private void AddSelectionTrees(DesignerForm newDialog, XmlNodeList selectionTrees) { foreach (XmlNode selectionTree in selectionTrees) { try { TreeView treeView = new TreeView(); treeView.Scrollable = false; treeView.Nodes.Add(new TreeNode("Selection tree")); SetControlAttributes(treeView, selectionTree); newDialog.AddControl(selectionTree, treeView); } catch { } } }
private void AddDirectoryLists(DesignerForm newDialog, XmlNodeList directoryLists) { foreach (XmlNode directoryList in directoryLists) { try { ListBox listBox = new ListBox(); listBox.Items.Add("Director content"); listBox.SelectedIndex = 0; SetControlAttributes(listBox, directoryList); newDialog.AddControl(directoryList, listBox); } catch { } } }
private void AddVolumeCostLists(DesignerForm newDialog, XmlNodeList volumeCostLists) { foreach (XmlNode volumeCostList in volumeCostLists) { try { ListView listView = new ListView(); ColumnHeader columnHeader1 = new ColumnHeader(); ColumnHeader columnHeader2 = new ColumnHeader(); ColumnHeader columnHeader3 = new ColumnHeader(); ColumnHeader columnHeader4 = new ColumnHeader(); ColumnHeader columnHeader5 = new ColumnHeader(); columnHeader1.Text = "Volume"; columnHeader2.Text = "Disk Size"; columnHeader3.Text = "Available"; columnHeader4.Text = "Required"; columnHeader5.Text = "Difference"; columnHeader1.TextAlign = HorizontalAlignment.Left; columnHeader2.TextAlign = HorizontalAlignment.Right; columnHeader3.TextAlign = HorizontalAlignment.Right; columnHeader4.TextAlign = HorizontalAlignment.Right; columnHeader5.TextAlign = HorizontalAlignment.Right; listView.Columns.AddRange(new ColumnHeader[] { columnHeader1, columnHeader2, columnHeader3, columnHeader4, columnHeader5 }); listView.Items.Add(new ListViewItem(new string[] { "C:", "30GB", "3200MB", "1MB", "3189MB" })); listView.View = System.Windows.Forms.View.Details; SetControlAttributes(listView, volumeCostList); newDialog.AddControl(volumeCostList, listView); } catch { } } }
private void AddComboBoxes(DesignerForm newDialog, XmlNodeList comboBoxes) { foreach (XmlNode comboBox in comboBoxes) { try { ComboBox comboCtrl = new ComboBox(); SetControlAttributes(comboCtrl, comboBox); comboCtrl.Items.Add("ComboBox"); comboCtrl.SelectedIndex = 0; newDialog.AddControl(comboBox, comboCtrl); } catch { } } }
private void AddDirectoryCombos(DesignerForm newDialog, XmlNodeList directoryCombos) { foreach (XmlNode directoryCombo in directoryCombos) { try { ComboBox comboCtrl = new ComboBox(); comboCtrl.Items.Add("Directories"); comboCtrl.SelectedIndex = 0; SetControlAttributes(comboCtrl, directoryCombo); newDialog.AddControl(directoryCombo, comboCtrl); } catch { } } }