Beispiel #1
0
        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);
        }
Beispiel #2
0
 public static void SaveSharedWorkspaces(ShareableWorkspace SW, string _ExternalPath = "")
 {
     if (_ExternalPath != "")
     {
         SaveJSonFile(@"\SharedWorkspace.json", SW, _ExternalPath, true);
     }
     else
     {
         SaveJSonFile(@"\SharedWorkspace.json", SW, "", true);
     }
 }