コード例 #1
0
        public void ParseCommandLineArguments()
        {
            string[] args = Environment.GetCommandLineArgs();

            if (args.Length > 1)
            {
                try
                {
                    filePath = args[1];
                    ClearVars(true);
                    file = PssgFile.Open(File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read));
                    nodesWorkspace.LoadData(file);
                    texturesWorkspace.LoadData(nodesWorkspace.RootNode);
                    if (texturesWorkspace.Textures.Count > 0)
                    {
                        SelectedTabIndex = 1;
                    }
                    DisplayName = Properties.Resources.AppTitleShort + " - " + Path.GetFileName(filePath);
                }
                catch (Exception excp)
                {
                    // Fail
                    DisplayName = Properties.Resources.AppTitleLong;
                    MessageBox.Show("The program could not open this file!" + Environment.NewLine + Environment.NewLine + excp.Message, "Could Not Open", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
コード例 #2
0
        public void LoadPssg(PssgFile pssg)
        {
            // if pssg is null, we just want to reload the workspaces
            if (pssg is null)
            {
                ClearVars(false);
            }
            else
            {
                ClearVars(true);
                file = pssg;
            }

            nodesWorkspace.LoadData(file);
            texturesWorkspace.LoadData(nodesWorkspace.RootNode);
            if (texturesWorkspace.Textures.Count > 0)
            {
                SelectedTabIndex = 1;
            }
            _modelsWorkspace.LoadData(file);
        }