コード例 #1
0
        void LoadProject()
        {
            string projectFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "UnrealDebugger.project");

            try
            {
                if (File.Exists(projectFile))
                {
                    _project = Project.LoadFromXml(projectFile);
                }
                else
                {
                    Assembly assembly = typeof(UnrealDebuggerIDE).Assembly;
                    Stream projectStream = assembly.GetManifestResourceStream("UnrealDebugger.Resources.Default.project");
                    _project = Project.LoadFromXml(projectStream);
                }
            }
            catch (Exception e)
            {
                ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
                msgBox.ShowDialog();

                _project = new Project();
            }

            _configurationPanel.SetProject(_project);
            _project.Loaded();

            if (_project.CheckForUpdates)
            {
                this._versionChecker = new VersionChecker(this.Title, this.Version);
            }

            BuildRecentFilesList();
        }
コード例 #2
0
 void SaveProject()
 {
     try
     {
         string projectFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "UnrealDebugger.project");
         _project.SaveToXml(projectFile);
     }
     catch (Exception e)
     {
         ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
         msgBox.ShowDialog();
     }
 }
コード例 #3
0
 void SaveLayout()
 {
     try
     {
         string layoutFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "UnrealDebugger.layout");
         dockPanelDebugger.SaveAsXml(layoutFile);
     }
     catch (Exception e)
     {
         ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
         msgBox.ShowDialog();
     }
 }
コード例 #4
0
        void LoadLayout()
        {
            try
            {
                string layoutFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "UnrealDebugger.layout");

                if (File.Exists(layoutFile))
                {
                    dockPanelDebugger.LoadFromXml(layoutFile, _deserializeDockContent);
                }
                else
                {
                    Assembly assembly = typeof(UnrealDebuggerIDE).Assembly;
                    Stream layoutStream = assembly.GetManifestResourceStream("UnrealDebugger.Resources.Default.layout");
                    dockPanelDebugger.LoadFromXml(layoutStream, _deserializeDockContent);
                }
            }
            catch (Exception e)
            {
                ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
                msgBox.ShowDialog();
            }
        }
コード例 #5
0
ファイル: Project.cs プロジェクト: TroutZhang/unreal-debugger
        public bool SaveToXml(string file)
        {
            try
            {
                UnrealDebuggerIDE.Instance.RaiseWriteUserData(this._userdata);

                XmlSerializer xml = new XmlSerializer(typeof(Project));

                using (TextWriter fs = new StreamWriter(file))
                {
                    xml.Serialize(fs, this);
                }

                return true;
            }
            catch (Exception e)
            {
                ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
                msgBox.ShowDialog();
                return false;
            }
        }
コード例 #6
0
ファイル: Project.cs プロジェクト: TroutZhang/unreal-debugger
        public static Project LoadFromXml(Stream stream)
        {
            try
            {
                Project project = null;
                XmlSerializer xml = new XmlSerializer(typeof(Project));

                using (TextReader fs = new StreamReader(stream))
                {
                    project = xml.Deserialize(fs) as Project;
                }

                UnrealDebuggerIDE.Instance.RaiseReadUserData(project._userdata);

                return project;
            }
            catch (Exception e)
            {
                ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
                msgBox.ShowDialog();

                return new Project();
            }
        }
コード例 #7
0
        public bool SaveToXml(string file)
        {
            try
            {
                XmlSerializer xml = new XmlSerializer(typeof(ScriptOutline));

                using (TextWriter fs = new StreamWriter(file))
                {
                    xml.Serialize(fs, this);
                }

                return true;
            }
            catch (Exception e)
            {
                ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
                msgBox.ShowDialog();
                return false;
            }
        }
コード例 #8
0
        public static ScriptOutline LoadFromXml(string file)
        {
            try
            {
                ScriptOutline outline = null;
                XmlSerializer xml = new XmlSerializer(typeof(ScriptOutline));

                using (TextReader fs = new StreamReader(file))
                {
                    outline = xml.Deserialize(fs) as ScriptOutline;
                }

                return outline;
            }
            catch (Exception e)
            {
                ExceptionMessageBox msgBox = new ExceptionMessageBox(e);
                msgBox.ShowDialog();

                return new ScriptOutline();
            }
        }
コード例 #9
0
        public static ScriptOutline CreateFromScript(string file)
        {
            ScriptOutline outline = null;

            try
            {
                using (StreamReader reader = new StreamReader(file))
                {
                    string source = reader.ReadToEnd();
                    source = Uncomment(source);
                    outline = Analize(source);
                }
            }
            catch (Exception e)
            {
                Exception ex = new Exception("There was an error while parsing the script contents for file '" + file + "'. Script outline will not be available", e);
                ex.Source = e.Source;

                ExceptionMessageBox msgBox = new ExceptionMessageBox(ex);
                msgBox.ShowDialog();

                return new ScriptOutline();
            }

            return outline;
        }