// #92 private DummyDoc CreateNewDoc(string text) { // todo -- FindPlot? DummyDoc DummyDoc = new DummyDoc(); DummyDoc.Text = text; return(DummyDoc); }
private DummyDoc CreateNewDocument(string text) { DummyDoc dummyDoc = new DummyDoc(); dummyDoc.Text = text; return(dummyDoc); }
private DummyDoc CreateNewDoc(FileInfo info) { // todo -- FindPlot? DummyDoc DummyDoc = new DummyDoc(); DummyDoc.FileInfo = info; DummyDoc.Text = info.Name; // todo, rename ambiguous tabs return(DummyDoc); }
private IDockContent GetContentFromPersistString(string persistString) { if (persistString == typeof(DummySolutionExplorer).ToString()) { return(m_solutionExplorer); } else if (persistString == typeof(DummyPropertyWindow).ToString()) { return(m_propertyWindow); } else if (persistString == typeof(DummyToolbox).ToString()) { return(m_toolbox); } else if (persistString == typeof(DummyOutputWindow).ToString()) { return(m_outputWindow); } else if (persistString == typeof(DummyTaskList).ToString()) { return(m_taskList); } else { // DummyDoc overrides GetPersistString to add extra information into persistString. // Any DockContent may override this value to add any needed information for deserialization. string[] parsedStrings = persistString.Split(new char[] { ',' }); if (parsedStrings.Length != 3) { return(null); } if (parsedStrings[0] != typeof(DummyDoc).ToString()) { return(null); } DummyDoc dummyDoc = new DummyDoc(); if (parsedStrings[1] != string.Empty) { dummyDoc.FileName = parsedStrings[1]; } if (parsedStrings[2] != string.Empty) { dummyDoc.Text = parsedStrings[2]; } return(dummyDoc); } }
// #75 private DummyDoc CreateNewDoc() { DummyDoc DummyDoc = new DummyDoc(); int count = 0; string text; do // todo -- FindPlot? { count++; text = "Chart" + count.ToString(); } while (FindDocument(text) != null); DummyDoc.Text = text; return DummyDoc; }
private DummyDoc NewDummyDoc() { DummyDoc DummyDoc = CreateNewDoc(); if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi) { DummyDoc.MdiParent = this; DummyDoc.Show(); } else { DummyDoc.Show(dockPanel); } return(DummyDoc); }
// #75 private DummyDoc CreateNewDoc() { DummyDoc DummyDoc = new DummyDoc(); int count = 0; string text; do // todo -- FindPlot? { count++; text = "Chart" + count.ToString(); } while (FindDocument(text) != null); DummyDoc.Text = text; return(DummyDoc); }
private void menuItemNew_Click(object sender, System.EventArgs e) { #if DockSample // eucaly, 151205 DummyDoc dummyDoc = CreateNewDocument(); if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi) { dummyDoc.MdiParent = this; dummyDoc.Show(); } else { dummyDoc.Show(dockPanel); } #endif }
private DummyDoc CreateNewDocument() { DummyDoc dummyDoc = new DummyDoc(); int count = 1; //string text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString(); string text = "Document" + count.ToString(); while (FindDocument(text) != null) { count++; //text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString(); text = "Document" + count.ToString(); } dummyDoc.Text = text; return dummyDoc; }
private DummyDoc CreateNewDocument() { DummyDoc dummyDoc = new DummyDoc(); int count = 1; //string text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString(); string text = "Document" + count.ToString(); while (FindDocument(text) != null) { count++; //text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString(); text = "Document" + count.ToString(); } dummyDoc.Text = text; return(dummyDoc); }
private void menuItemOpen_Click(object sender, System.EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.InitialDirectory = Application.ExecutablePath; openFile.Filter = "rtf files (*.rtf)|*.rtf|txt files (*.txt)|*.txt|All files (*.*)|*.*"; openFile.FilterIndex = 1; openFile.RestoreDirectory = true; if (openFile.ShowDialog() == DialogResult.OK) { string fullName = openFile.FileName; string fileName = Path.GetFileName(fullName); if (FindDocument(fileName) != null) { MessageBox.Show("The document: " + fileName + " has already opened!"); return; } DummyDoc dummyDoc = new DummyDoc(); dummyDoc.Text = fileName; if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi) { dummyDoc.MdiParent = this; dummyDoc.Show(); } else { dummyDoc.Show(dockPanel); } try { dummyDoc.FileName = fullName; } catch (Exception exception) { dummyDoc.Close(); MessageBox.Show(exception.Message); } } }
private DummyDoc NewDummyDoc(FileInfo info) { var doc = FindDoc(info) as DummyDoc; if (doc != null) { doc.Activate(); return(doc); } DummyDoc DummyDoc = CreateNewDoc(info); if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi) { DummyDoc.MdiParent = this; DummyDoc.Show(); } else { DummyDoc.Show(dockPanel); } return(DummyDoc); }
private DummyDoc CreateNewDoc(FileInfo info) { // todo -- FindPlot? DummyDoc DummyDoc = new DummyDoc(); DummyDoc.FileInfo = info; DummyDoc.Text = info.Name; // todo, rename ambiguous tabs return DummyDoc; }
private IDockContent GetContentFromPersistString(string persistString) { if (persistString == typeof(DummySolutionExplorer).ToString()) return m_solutionExplorer; else if (persistString == typeof(DummyPropertyWindow).ToString()) return m_propertyWindow; else if (persistString == typeof(DummyToolbox).ToString()) return m_toolbox; else if (persistString == typeof(DummyOutputWindow).ToString()) return m_outputWindow; else if (persistString == typeof(DummyTaskList).ToString()) return m_taskList; else { // DummyDoc overrides GetPersistString to add extra information into persistString. // Any DockContent may override this value to add any needed information for deserialization. string[] parsedStrings = persistString.Split(new char[] { ',' }); if (parsedStrings.Length != 3) return null; if (parsedStrings[0] != typeof(DummyDoc).ToString()) return null; DummyDoc dummyDoc = new DummyDoc(); if (parsedStrings[1] != string.Empty) dummyDoc.FileName = parsedStrings[1]; if (parsedStrings[2] != string.Empty) dummyDoc.Text = parsedStrings[2]; return dummyDoc; } }
private void menuItemOpen_Click(object sender, System.EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.InitialDirectory = Application.ExecutablePath; openFile.Filter = "rtf files (*.rtf)|*.rtf|txt files (*.txt)|*.txt|All files (*.*)|*.*"; openFile.FilterIndex = 1; openFile.RestoreDirectory = true; if (openFile.ShowDialog() == DialogResult.OK) { string fullName = openFile.FileName; string fileName = Path.GetFileName(fullName); if (FindDocument(fileName) != null) { MessageBox.Show("The document: " + fileName + " has already opened!"); return; } DummyDoc dummyDoc = new DummyDoc(); dummyDoc.Text = fileName; if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi) { dummyDoc.MdiParent = this; dummyDoc.Show(); } else dummyDoc.Show(dockPanel); try { dummyDoc.FileName = fullName; } catch (Exception exception) { dummyDoc.Close(); MessageBox.Show(exception.Message); } } }
// #92 private DummyDoc CreateNewDoc(string text) { // todo -- FindPlot? DummyDoc DummyDoc = new DummyDoc(); DummyDoc.Text = text; return DummyDoc; }
private DummyDoc CreateNewDocument(string text) { DummyDoc dummyDoc = new DummyDoc(); dummyDoc.Text = text; return dummyDoc; }