private IDockContent GetContentFromPersistString(string persistString) { bool reOpenLast = false; object obj = OptionValues.GetValue("ReOpenLast", optionsSettings); if (obj != null) { CheckState checkSave = (CheckState)obj; if (checkSave == CheckState.Checked) { reOpenLast = true; } } if (persistString == typeof(SQLServerExplorer).ToString()) return m_serverExplorer; else if (persistString == typeof(XmlNodeExplorer).ToString()) return m_xmlNodeExplorer; else { string[] parsedStrings = persistString.Split(new char[] { ',' }); if (parsedStrings.Length < 3) return null; if (parsedStrings[0] == typeof(XMLDoc).ToString() && reOpenLast) { XMLDoc xmlDoc = new XMLDoc(); if (parsedStrings[1] != string.Empty) { xmlDoc.FileName = parsedStrings[1]; LastDirectory = xmlDoc.InitialDirectory; } if (parsedStrings[2] != string.Empty) xmlDoc.Text = parsedStrings[2]; return xmlDoc; } else if (parsedStrings[0] == typeof(SQLDoc).ToString() && reOpenLast) { SQLDoc sqlDoc = new SQLDoc(); if (parsedStrings[1] != string.Empty) { sqlDoc.FileName = parsedStrings[1]; LastDirectory = sqlDoc.InitialDirectory; } if (parsedStrings[2] != string.Empty) sqlDoc.Text = parsedStrings[2]; return sqlDoc; } else { return null; } } }
private void fileToolStripMenuItem1_Click(object sender, EventArgs e) { // open sql document SQLDoc sDoc = new SQLDoc(); sDoc.InitialDirectory = LastDirectory; if (sDoc.Open(dockPanel)) { LastDirectory = sDoc.InitialDirectory; } }
private void trans_CompleteTransformSQL(string FileName) { SQLDoc sqlDoc = new SQLDoc(); sqlDoc.InitialDirectory = LastDirectory; sqlDoc.RightToLeftLayout = RightToLeftLayout; sqlDoc.FileName = FileName; sqlDoc.Show(this.dockPanel); LastDirectory = sqlDoc.InitialDirectory; this.toolStripStatusLabel1.Text = "Completed XML Snapshot to SQL Transformation."; }