Example #1
0
        private void menuItemOpen_Click(object sender, System.EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.InitialDirectory = Application.ExecutablePath;
            openFile.Filter           = "Xml files (*.xml)|*.xml|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;
                }

                ResourceDoc dummyDoc = new ResourceDoc();
                dummyDoc.Text = fileName;
                dummyDoc.Show(dockPanel);
                try
                {
                    dummyDoc.FileName = fullName;
                }
                catch (Exception exception)
                {
                    dummyDoc.Close();
                    MessageBox.Show(exception.Message);
                }
            }
        }
Example #2
0
        private void OpenFile(string fileName, string useTextLabel)
        {
            if (FindDocument(fileName) != null)
            {
                MessageBox.Show("The document: " + fileName + " has already opened!");
                return;
            }

            ResourceDoc dummyDoc = new ResourceDoc();

            if (string.IsNullOrEmpty(useTextLabel))
            {
                dummyDoc.Text = Path.GetFileName(fileName);
            }
            else
            {
                dummyDoc.Text = useTextLabel;
            }

            dummyDoc.Show(dockPanel);
            try
            {
                dummyDoc.FileName = fileName;
            }
            catch (Exception exception)
            {
                dummyDoc.Close();
                MessageBox.Show(exception.Message);
            }
        }
Example #3
0
        private ResourceDoc CreateNewDocument(string text)
        {
            ResourceDoc dummyDoc = new ResourceDoc();

            dummyDoc.Text = text;
            return(dummyDoc);
        }
Example #4
0
        private void menuItemNew_Click(object sender, System.EventArgs e)
        {
            ResourceDoc dummyDoc = CreateNewDocument();

            if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
            {
                dummyDoc.MdiParent = this;
                dummyDoc.Show();
            }
            else
            {
                dummyDoc.Show(dockPanel);
            }
        }
Example #5
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            if (persistString == typeof(ObjectModelExplorer).ToString())
            {
                return(m_objectModelExplorer);
            }
            else if (persistString == typeof(OMTPropertyWindow).ToString())
            {
                return(m_propertyWindow);
            }
            else if (persistString == typeof(DummyToolbox).ToString())
            {
                return(m_toolbox);
            }
            else if (persistString == typeof(OutputWindow).ToString())
            {
                return(m_outputWindow);
            }
            else if (persistString == typeof(PluginList).ToString())
            {
                return(m_pluginList);
            }
            else
            {
                string[] parsedStrings = persistString.Split(new char[] { ',' });
                if (parsedStrings.Length != 3)
                {
                    return(null);
                }

                if (parsedStrings[0] != typeof(ResourceDoc).ToString())
                {
                    return(null);
                }

                ResourceDoc dummyDoc = new ResourceDoc();
                if (parsedStrings[1] != string.Empty)
                {
                    dummyDoc.FileName = parsedStrings[1];
                }
                if (parsedStrings[2] != string.Empty)
                {
                    dummyDoc.Text = parsedStrings[2];
                }

                return(dummyDoc);
            }
        }
Example #6
0
        private ResourceDoc CreateNewDocument()
        {
            ResourceDoc dummyDoc = new ResourceDoc();

            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);
        }
Example #7
0
        private void menuItemLayoutByCode_Click(object sender, System.EventArgs e)
        {
            dockPanel.SuspendLayout(true);

            m_objectModelExplorer.Show(dockPanel, DockState.DockRight);
            m_propertyWindow.Show(m_objectModelExplorer.Pane, m_objectModelExplorer);
            m_toolbox.Show(dockPanel, new Rectangle(98, 133, 200, 383));
            m_outputWindow.Show(m_objectModelExplorer.Pane, DockAlignment.Bottom, 0.35);
            m_pluginList.Show(m_toolbox.Pane, DockAlignment.Left, 0.4);

            CloseAllDocuments();
            ResourceDoc doc1 = CreateNewDocument("Document1");
            ResourceDoc doc2 = CreateNewDocument("Document2");
            ResourceDoc doc3 = CreateNewDocument("Document3");
            ResourceDoc doc4 = CreateNewDocument("Document4");

            doc1.Show(dockPanel, DockState.Document);
            doc2.Show(doc1.Pane, null);
            doc3.Show(doc1.Pane, DockAlignment.Bottom, 0.5);
            doc4.Show(doc3.Pane, DockAlignment.Right, 0.5);

            dockPanel.ResumeLayout(true, true);
        }
Example #8
0
        private void OpenFile(string fileName, string useTextLabel)
        {
            if (FindDocument(fileName) != null)
            {
                MessageBox.Show("The document: " + fileName + " has already opened!");
                return;
            }

            ResourceDoc dummyDoc = new ResourceDoc();
            if (string.IsNullOrEmpty(useTextLabel))
                dummyDoc.Text = Path.GetFileName(fileName);
            else
                dummyDoc.Text = useTextLabel;

            dummyDoc.Show(dockPanel);
            try
            {
                dummyDoc.FileName = fileName;
            }
            catch (Exception exception)
            {
                dummyDoc.Close();
                MessageBox.Show(exception.Message);
            }
        }
Example #9
0
        private void menuItemOpen_Click(object sender, System.EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.InitialDirectory = Application.ExecutablePath;
            openFile.Filter = "Xml files (*.xml)|*.xml|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;
                }

                ResourceDoc dummyDoc = new ResourceDoc();
                dummyDoc.Text = fileName;
                dummyDoc.Show(dockPanel);
                try
                {
                    dummyDoc.FileName = fullName;
                }
                catch (Exception exception)
                {
                    dummyDoc.Close();
                    MessageBox.Show(exception.Message);
                }

            }
        }
Example #10
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            if (persistString == typeof(ObjectModelExplorer).ToString())
                return m_objectModelExplorer;
            else if (persistString == typeof(OMTPropertyWindow).ToString())
                return m_propertyWindow;
            else if (persistString == typeof(DummyToolbox).ToString())
                return m_toolbox;
            else if (persistString == typeof(OutputWindow).ToString())
                return m_outputWindow;
            else if (persistString == typeof(PluginList).ToString())
                return m_pluginList;
            else
            {
                string[] parsedStrings = persistString.Split(new char[] { ',' });
                if (parsedStrings.Length != 3)
                    return null;

                if (parsedStrings[0] != typeof(ResourceDoc).ToString())
                    return null;

                ResourceDoc dummyDoc = new ResourceDoc();
                if (parsedStrings[1] != string.Empty)
                    dummyDoc.FileName = parsedStrings[1];
                if (parsedStrings[2] != string.Empty)
                    dummyDoc.Text = parsedStrings[2];

                return dummyDoc;
            }
        }
Example #11
0
 private ResourceDoc CreateNewDocument(string text)
 {
     ResourceDoc dummyDoc = new ResourceDoc();
     dummyDoc.Text = text;
     return dummyDoc;
 }
Example #12
0
        private ResourceDoc CreateNewDocument()
        {
            ResourceDoc dummyDoc = new ResourceDoc();

            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;
        }