예제 #1
0
        // #92
        private DummyDoc CreateNewDoc(string text)
        {           // todo -- FindPlot?
            DummyDoc DummyDoc = new DummyDoc();

            DummyDoc.Text = text;
            return(DummyDoc);
        }
예제 #2
0
        private DummyDoc CreateNewDocument(string text)
        {
            DummyDoc dummyDoc = new DummyDoc();

            dummyDoc.Text = text;
            return(dummyDoc);
        }
예제 #3
0
        private DummyDoc CreateNewDoc(FileInfo info)
        {           // todo -- FindPlot?
            DummyDoc DummyDoc = new DummyDoc();

            DummyDoc.FileInfo = info;
            DummyDoc.Text     = info.Name;              // todo, rename ambiguous tabs
            return(DummyDoc);
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
		// #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;
		}
예제 #6
0
        private DummyDoc NewDummyDoc()
        {
            DummyDoc DummyDoc = CreateNewDoc();

            if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
            {
                DummyDoc.MdiParent = this;
                DummyDoc.Show();
            }
            else
            {
                DummyDoc.Show(dockPanel);
            }
            return(DummyDoc);
        }
예제 #7
0
        // #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);
        }
예제 #8
0
        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
        }
예제 #9
0
파일: MainForm.cs 프로젝트: beZong/bZmd
		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;
		}
예제 #10
0
        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);
        }
예제 #11
0
        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);
                }
            }
        }
예제 #12
0
        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);
        }
예제 #13
0
		private DummyDoc CreateNewDoc(FileInfo info)
		{   // todo -- FindPlot?
			DummyDoc DummyDoc = new DummyDoc();
			DummyDoc.FileInfo = info;
			DummyDoc.Text = info.Name;      // todo, rename ambiguous tabs
			return DummyDoc;
		}
예제 #14
0
파일: MainForm.cs 프로젝트: beZong/bZmd
		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;
			}
		}
예제 #15
0
파일: MainForm.cs 프로젝트: beZong/bZmd
		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);
				}

			}
		}
예제 #16
0
		// #92
		private DummyDoc CreateNewDoc(string text)
		{   // todo -- FindPlot?
			DummyDoc DummyDoc = new DummyDoc();
			DummyDoc.Text = text;
			return DummyDoc;
		}
예제 #17
0
파일: MainForm.cs 프로젝트: beZong/bZmd
		private DummyDoc CreateNewDocument(string text)
		{
			DummyDoc dummyDoc = new DummyDoc();
			dummyDoc.Text = text;
			return dummyDoc;
		}