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(); }
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(); } }
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(); } }
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(); } }
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; } }
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(); } }
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; } }
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(); } }
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; }