private void copyXdf() { if (currentTreeNode == null) { return; } if (currentTreeNode.Parent == null) { return; } switch (currentTreeNode.Parent.Name) { case TreeRootNodeName: break; default: return; } object xdfObject = null; if (s6xScalar.AddressBinInt >= S6x.Properties.XdfBaseOffsetInt) { xdfObject = new XdfFlag(s6xScalar, (S6xBitFlag)slBitFlags[currentTreeNode.Name], S6x.Properties.XdfBaseOffsetInt); } MemoryStream mStr = new MemoryStream(); ToolsXml.SerializeXdf(ref mStr, xdfObject); Clipboard.SetData(SADDef.XdfClipboardFormat, mStr); mStr.Close(); mStr = null; xdfObject = null; }
private void generateXDoc(ref XmlDocument xDoc) { XPathNavigator xNav = null; xDoc.AppendChild(xDoc.CreateXmlDeclaration("1.0", "UTF-8", null)); xNav = xDoc.CreateNavigator(); ToolsXml.Serialize(ref xNav, this); xNav = null; GC.Collect(); }
public ConversionRepoForm(string filePath, ref SADS6x s6x) { InitializeComponent(); repoFilePath = filePath; sadS6x = s6x; try { Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); } catch { } repoRepository = (RepositoryConversion)ToolsXml.DeserializeFile(repoFilePath, typeof(RepositoryConversion)); if (repoRepository == null) { repoRepository = new RepositoryConversion(); } repoRepository.isSaved = true; bindingSource = new BindingSource(); bindingSource.DataSource = repoRepository.Items.FindAll(searchRepositoryConversionItem); repoListBox.DisplayMember = "Title"; repoListBox.DataSource = bindingSource; this.FormClosing += new FormClosingEventHandler(RepositoryForm_FormClosing); searchTextBox.KeyPress += new KeyPressEventHandler(searchTextBox_KeyPress); repoListBox.MouseMove += new MouseEventHandler(repoListBox_MouseMove); repoListBox.MouseDown += new MouseEventHandler(repoListBox_MouseDown); repoListBox.MouseClick += new MouseEventHandler(repoListBox_MouseClick); repoListBox.SelectedIndexChanged += new EventHandler(repoListBox_SelectedIndexChanged); titleTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); iFormulaTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); commentsTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); informationTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); titleTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); iFormulaTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); commentsTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); informationTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); titleTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); iFormulaTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); commentsTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); informationTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); iFormulaTextBox.TextChanged += new EventHandler(iFormulaTextBox_TextChanged); repoListBox.SelectedItem = null; repoListBox_SelectedIndexChanged(repoListBox, new EventArgs()); }
public SettingsForm(string title, string filePath, string specType) { InitializeComponent(); this.Text = title; settingsFilePath = filePath; specificType = specType; try { Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); } catch { } setSettings = (SettingsLst)ToolsXml.DeserializeFile(settingsFilePath, typeof(SettingsLst)); if (setSettings == null) { setSettings = new SettingsLst(); } setSettings.isSaved = true; ToolsSettings.Update(ref setSettings, specType); bindingSource = new BindingSource(); bindingSource.DataSource = setSettings.GetOrderedItems(); settingsListBox.DisplayMember = "Label"; settingsListBox.DataSource = bindingSource; setCategories = setSettings.GetCategs(); categComboBox.DataSource = setCategories; categComboBox.SelectedIndex = 0; this.FormClosing += new FormClosingEventHandler(SettingsForm_FormClosing); searchTextBox.KeyPress += new KeyPressEventHandler(searchTextBox_KeyPress); categComboBox.SelectedIndexChanged += new EventHandler(categComboBox_SelectedIndexChanged); settingsListBox.MouseMove += new MouseEventHandler(settingsListBox_MouseMove); settingsListBox.MouseDown += new MouseEventHandler(settingsListBox_MouseDown); settingsListBox.MouseClick += new MouseEventHandler(settingsListBox_MouseClick); settingsListBox.SelectedIndexChanged += new EventHandler(settingsListBox_SelectedIndexChanged); settingsListBox.SelectedItem = null; settingsListBox_SelectedIndexChanged(settingsListBox, new EventArgs()); }
private void initRepositories() { repoTables = (Repository)ToolsXml.DeserializeFile(Application.StartupPath + "\\" + SADDef.repoFileNameTables, typeof(Repository)); if (repoTables == null) { repoTables = new Repository(); } repoFunctions = (Repository)ToolsXml.DeserializeFile(Application.StartupPath + "\\" + SADDef.repoFileNameFunctions, typeof(Repository)); if (repoFunctions == null) { repoFunctions = new Repository(); } repoScalars = (Repository)ToolsXml.DeserializeFile(Application.StartupPath + "\\" + SADDef.repoFileNameScalars, typeof(Repository)); if (repoScalars == null) { repoScalars = new Repository(); } repoStructures = (Repository)ToolsXml.DeserializeFile(Application.StartupPath + "\\" + SADDef.repoFileNameStructures, typeof(Repository)); if (repoStructures == null) { repoStructures = new Repository(); } repoUnits = (Repository)ToolsXml.DeserializeFile(Application.StartupPath + "\\" + SADDef.repoFileNameUnits, typeof(Repository)); if (repoUnits == null) { repoUnits = new Repository(); } repoConversion = (RepositoryConversion)ToolsXml.DeserializeFile(Application.StartupPath + "\\" + SADDef.repoFileNameConversion, typeof(RepositoryConversion)); if (repoConversion == null) { repoConversion = new RepositoryConversion(); } }
public RepositoryForm(string title, string filePath, string specType, ref SADS6x s6x) { InitializeComponent(); this.Text = title; repoFilePath = filePath; specificType = specType; sadS6x = s6x; try { Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); } catch { } repoRepository = (Repository)ToolsXml.DeserializeFile(repoFilePath, typeof(Repository)); if (repoRepository == null) { repoRepository = new Repository(); } repoRepository.isSaved = true; switch (specificType) { case "REGISTERS": case "UNITS": labelLabel.Visible = false; labelTextBox.Visible = false; sLabelLabel.Text = labelLabel.Text; break; case "OBDIERRORS": sLabelLabel.Text = SADDef.repoLabelOBDIErrorsShortLabel; sLabelLabel.MouseMove += new MouseEventHandler(ShortLabelLabel_MouseMove); break; case "OBDIIERRORS": sLabelLabel.Text = SADDef.repoLabelOBDIIErrorsShortLabel; sLabelLabel.MouseMove += new MouseEventHandler(ShortLabelLabel_MouseMove); break; } bindingSource = new BindingSource(); bindingSource.DataSource = repoRepository.Items.FindAll(searchRepositoryItem); repoListBox.DisplayMember = "ShortLabel"; repoListBox.DataSource = bindingSource; this.FormClosing += new FormClosingEventHandler(RepositoryForm_FormClosing); searchTextBox.KeyPress += new KeyPressEventHandler(searchTextBox_KeyPress); repoListBox.MouseMove += new MouseEventHandler(repoListBox_MouseMove); repoListBox.MouseDown += new MouseEventHandler(repoListBox_MouseDown); repoListBox.MouseClick += new MouseEventHandler(repoListBox_MouseClick); repoListBox.SelectedIndexChanged += new EventHandler(repoListBox_SelectedIndexChanged); sLabelTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); labelTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); commentsTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); informationTextBox.ModifiedChanged += new EventHandler(RepoItemTextBox_ModifiedChanged); sLabelTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); labelTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); commentsTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); informationTextBox.KeyDown += new KeyEventHandler(RepoItemTextBox_KeyDown); sLabelTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); labelTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); commentsTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); informationTextBox.Leave += new EventHandler(RepoItemTextBox_Leave); repoListBox.SelectedItem = null; repoListBox_SelectedIndexChanged(repoListBox, new EventArgs()); listLoadS6xToolStripSeparator.Visible = (sadS6x != null); listLoadS6xToolStripMenuItem.Visible = (sadS6x != null); }