public static ShareableWorkspace GetSharedWorkspace(bool External = false, string ExternalPath = "") { ShareableWorkspace SW = new ShareableWorkspace(); string Path; if (!External) { Path = Properties.Settings.Default.DefaultDir + @"\Library\Workspaces.json"; } else { Path = ExternalPath; } if (File.Exists(Path)) { using (StreamReader file = File.OpenText(Path)) { JsonSerializer serializer = new JsonSerializer(); SW = (ShareableWorkspace)serializer.Deserialize(file, typeof(ShareableWorkspace)); } } return(SW); }
public static void SaveSharedWorkspaces(ShareableWorkspace SW, string _ExternalPath = "") { if (_ExternalPath != "") { SaveJSonFile(@"\SharedWorkspace.json", SW, _ExternalPath, true); } else { SaveJSonFile(@"\SharedWorkspace.json", SW, "", true); } }