Exemplo n.º 1
0
        /// <summary>
        /// Reads the complete hierarchy from a file.
        /// </summary>
        /// <param name="file">The source XML file.</param>
        public static void ReadXml(string file)
        {
            XmlTextReader reader = null;

            try
            {
                // Load the reader with the data file and ignore all white space nodes.
                reader = new XmlTextReader(file);
                reader.WhitespaceHandling = WhitespaceHandling.None;

                // Parse the file and display each of the nodes.
                while (reader.Read())
                {
                    if (!reader.IsStartElement())
                    {
                        continue;
                    }

                    switch (reader.Name)
                    {
                    case "form":
                        Console.WriteLine("form");

                        DockForm form = new DockForm();
                        form.Opacity = 0;
                        form.Show();
                        form.ReadXml(reader.ReadSubtree());

                        //if (!form.RootContainer.IsEmpty)
                        form.Opacity = 1;
                        //else
                        //	form.Close();
                        break;

                    case "manager":
                        Console.WriteLine("manager");

                        string hostType = reader.GetAttribute("parent");
                        if (hostType != null)
                        {
                            foreach (DockManager m in managerList)
                            {
                                if (m.Parent.GetType().FullName == hostType)
                                {
                                    m.ReadXml(reader.ReadSubtree());
                                }
                            }
                        }
                        break;
                    }
                }
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
        private void LoadDockForm()
        {
            DockForm form = new DockForm();

            CopyToDockForm(form);
            if (showFormAtOnLoad)
            {
                form.Show();
            }
        }
Exemplo n.º 3
0
        private void FloatWindow()
        {
            Rectangle rc = RectangleToScreen(this.ClientRectangle);
            DockForm form = new DockForm(dragObject);
            form.Show();
            form.Location = new Point(MousePosition.X, MousePosition.Y);

            if (!DockManager.FastMoveDraw)
                form.Opacity = 1;

            form.StartMoving(new Point(MousePosition.X + 10, MousePosition.Y + 10));

            dragObject = null;

            if ((panList.Count == 0) & (dockType == DockContainerType.Document) & (removeable) & (this.Parent is DockContainer))
                (this.Parent as DockContainer).Controls.Remove(this);
        }
Exemplo n.º 4
0
 private void LoadDockForm()
 {
     DockForm form = new DockForm();
     CopyToDockForm(form);
     if (showFormAtOnLoad)
         form.Show();
 }
Exemplo n.º 5
0
        /// <summary>
        /// Reads the complete hierarchy from a file.
        /// </summary>
        /// <param name="file">The source XML file.</param>
        public static void ReadXml(string file)
        {
            XmlTextReader reader = null;

            try
            {
                // Load the reader with the data file and ignore all white space nodes.
                reader = new XmlTextReader(file);
                reader.WhitespaceHandling = WhitespaceHandling.None;

                // Parse the file and display each of the nodes.
                while (reader.Read())
                {
                    if (!reader.IsStartElement())
                        continue;

                    switch (reader.Name)
                    {
                        case "form":
                            Console.WriteLine("form");

                            DockForm form = new DockForm();
                            form.Opacity = 0;
                            form.Show();
                            form.ReadXml(reader.ReadSubtree());

                            //if (!form.RootContainer.IsEmpty)
                                form.Opacity = 1;
                            //else
                            //	form.Close();
                            break;

                        case "manager":
                            Console.WriteLine("manager");

                            string hostType = reader.GetAttribute("parent");
                            if (hostType != null)
                            {
                                foreach (DockManager m in managerList)
                                    if (m.Parent.GetType().FullName == hostType)
                                        m.ReadXml(reader.ReadSubtree());
                            }
                            break;
                    }
                }
            }
            finally
            {
                if (reader != null)
                    reader.Close();
            }
        }