Example #1
0
        internal static void LoadConfig()
        {
            if (System.IO.File.Exists(configGuiPath) && System.IO.File.Exists(configGuiPanelPath))
            {
                // 設定ファイルが存在
                {
                    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
                    doc.Load(configGuiPath);
                    int x      = doc["GUI"].GetTextAsInt("X");
                    int y      = doc["GUI"].GetTextAsInt("Y");
                    int width  = doc["GUI"].GetTextAsInt("Width");
                    int height = doc["GUI"].GetTextAsInt("Height");
                    MainForm.Location = new System.Drawing.Point(x, y);
                    MainForm.Width    = width;
                    MainForm.Height   = height;
                }

                {
                    Func <string, WeifenLuo.WinFormsUI.Docking.IDockContent> get_dock = (s) =>
                    {
                        if (DockViewer.GetType().FullName == s)
                        {
                            return(DockViewer);
                        }

                        if (DockViewerController.GetType().FullName == s)
                        {
                            return(DockViewerController);
                        }

                        if (DockNodeTreeView.GetType().FullName == s)
                        {
                            return(DockNodeTreeView);
                        }

                        if (DockViewPoint.GetType().FullName == s)
                        {
                            return(DockViewPoint);
                        }

                        if (DockRecorder.GetType().FullName == s)
                        {
                            return(DockRecorder);
                        }

                        if (DockNodeCommonValues.GetType().FullName == s)
                        {
                            return(DockNodeCommonValues);
                        }

                        if (DockNodeLocationValues.GetType().FullName == s)
                        {
                            return(DockNodeLocationValues);
                        }

                        if (DockNodeRotationValues.GetType().FullName == s)
                        {
                            return(DockNodeRotationValues);
                        }

                        if (DockNodeScalingValues.GetType().FullName == s)
                        {
                            return(DockNodeScalingValues);
                        }

                        if (DockNodeLocationAbsValues.GetType().FullName == s)
                        {
                            return(DockNodeLocationAbsValues);
                        }

                        if (DockNodeGenerationLocationValues.GetType().FullName == s)
                        {
                            return(DockNodeGenerationLocationValues);
                        }

                        if (DockNodeDepthValues.GetType().FullName == s)
                        {
                            return(DockNodeDepthValues);
                        }

                        if (DockNodeRendererCommonValues.GetType().FullName == s)
                        {
                            return(DockNodeRendererCommonValues);
                        }

                        if (DockNodeRendererCommonValues2.GetType().FullName == s)
                        {
                            return(DockNodeRendererCommonValues2);
                        }

                        if (DockNodeDrawingValues.GetType().FullName == s)
                        {
                            return(DockNodeDrawingValues);
                        }

                        if (DockNodeSoundValues.GetType().FullName == s)
                        {
                            return(DockNodeSoundValues);
                        }

                        if (DockOption.GetType().FullName == s)
                        {
                            return(DockOption);
                        }

                        if (DockGlobal.GetType().FullName == s)
                        {
                            return(DockGlobal);
                        }

                        if (DockCulling.GetType().FullName == s)
                        {
                            return(DockCulling);
                        }

                        if (DockEffectBehavior.GetType().FullName == s)
                        {
                            return(DockEffectBehavior);
                        }


                        if (DockFCurves.GetType().FullName == s)
                        {
                            return(DockFCurves);
                        }

                        if (DockNetwork.GetType().FullName == s)
                        {
                            return(DockNetwork);
                        }

                        if (DockFileViewer.GetType().FullName == s)
                        {
                            return(DockFileViewer);
                        }

                        return(null);
                    };

                    var deserializeDockContent = new WeifenLuo.WinFormsUI.Docking.DeserializeDockContent(get_dock);

                    MainForm.Panel.LoadFromXml(configGuiPanelPath, deserializeDockContent);
                }
            }
            else
            {
                // 設定ファイルが存在しない
                AssignDefaultPosition();
            }

            Network.Load(ConfigNetworkFileName);
        }
Example #2
0
        public static void CloseDockWindow()
        {
            if (DockViewerController != null)
            {
                DockViewerController.Close();
            }
            if (DockViewPoint != null)
            {
                DockViewPoint.Close();
            }
            if (DockRecorder != null)
            {
                DockRecorder.Close();
            }
            if (DockNodeTreeView != null)
            {
                DockNodeTreeView.Close();
            }
            if (DockNodeCommonValues != null)
            {
                DockNodeCommonValues.Close();
            }
            if (DockNodeLocationValues != null)
            {
                DockNodeLocationValues.Close();
            }
            if (DockNodeRotationValues != null)
            {
                DockNodeRotationValues.Close();
            }
            if (DockNodeScalingValues != null)
            {
                DockNodeScalingValues.Close();
            }
            if (DockNodeLocationAbsValues != null)
            {
                DockNodeLocationAbsValues.Close();
            }
            if (DockNodeGenerationLocationValues != null)
            {
                DockNodeGenerationLocationValues.Close();
            }
            if (DockNodeDepthValues != null)
            {
                DockNodeDepthValues.Close();
            }
            if (DockNodeRendererCommonValues != null)
            {
                DockNodeRendererCommonValues.Close();
            }
            if (DockNodeRendererCommonValues2 != null)
            {
                DockNodeRendererCommonValues2.Close();
            }
            if (DockNodeDrawingValues != null)
            {
                DockNodeDrawingValues.Close();
            }
            if (DockNodeSoundValues != null)
            {
                DockNodeSoundValues.Close();
            }
            if (DockOption != null)
            {
                DockOption.Close();
            }
            if (DockGlobal != null)
            {
                DockGlobal.Close();
            }

            if (DockEffectBehavior != null)
            {
                DockEffectBehavior.Close();
            }

            if (DockFCurves != null)
            {
                DockFCurves.Close();
            }
            if (DockCulling != null)
            {
                DockCulling.Close();
            }
            if (DockNetwork != null)
            {
                DockNetwork.Close();
            }
            if (DockFileViewer != null)
            {
                DockFileViewer.Close();
            }

            DockViewerController             = null;
            DockViewPoint                    = null;
            DockRecorder                     = null;
            DockNodeTreeView                 = null;
            DockNodeCommonValues             = null;
            DockNodeLocationValues           = null;
            DockNodeRotationValues           = null;
            DockNodeScalingValues            = null;
            DockNodeLocationAbsValues        = null;
            DockNodeGenerationLocationValues = null;
            DockNodeDepthValues              = null;
            DockNodeRendererCommonValues     = null;
            DockNodeRendererCommonValues2    = null;
            DockNodeDrawingValues            = null;
            DockNodeSoundValues              = null;
            DockOption         = null;
            DockGlobal         = null;
            DockEffectBehavior = null;
            DockFCurves        = null;
            DockCulling        = null;
            DockNetwork        = null;
            DockFileViewer     = null;
        }