예제 #1
0
    private void LoadUserGui(string guiPath)
    {
        mCurrentGuiPath = guiPath;

        string path;

        if (ProtocolUtility.HasProtocol(guiPath))
        {
            path = ProtocolUtility.ConvertToFilePath(guiPath) + ".xml";
        }
        else
        {
            path = guiPath;
        }

        FileInfo fileInfo = new FileInfo(path);
        string   filePath = "file://" + path;

        mLoadedGuiLabel.Text = fileInfo.Name;

        ClearUserGuis();

        try
        {
            GuiController userGuis = new GuiController(mManager, filePath);
            foreach (ITopLevel topLevel in userGuis.AllGuis)
            {
                mManager.SetTopLevelPosition(topLevel, new FixedPosition(0.0f, 0.0f, GuiAnchor.CenterCenter, GuiAnchor.CenterCenter));

                if (mHiddenWindows.Contains(topLevel.Name))
                {
                    topLevel.Showing = false;
                }
            }
            mLoadedGuis.AddRange(userGuis.AllGuis);
        }
        catch (GuiConstructionException ex)
        {
            Debug.LogError(ex);
            ShowError(ex.Message);
        }

        mCurrentGuiMonitors.Clear();
        MonitorIncludes(path);

        SetupLoadedGuiWindowList();
    }