/// <summary> /// Creates a default Workspace /// </summary> public static void CreateBaseWorkspace() { String AssociationsPath = Properties.Settings.Default.DefaultDir + @"\Library\Workspaces.json"; if (!File.Exists(AssociationsPath)) { Workspace defaultWorkspace = new Workspace() { Name = "Default", Guid = Guid.NewGuid(), Associations = new ObservableCollection <Association>(), BuildDate = "" }; ObservableCollection <Workspace> DefaultFile = new ObservableCollection <Workspace>() { defaultWorkspace }; JSonHelper.SaveWorkspaces(DefaultFile); Properties.Settings.Default.LastSelectedWorkspace = defaultWorkspace.Guid; Properties.Settings.Default.Save(); } }
public static void Rescan(MainUIViewModel MUVM) { MUVM.ActiveWorkspace.Associations = new ObservableCollection <Association>(); MUVM.ContentItems = new ObservableCollection <ContentItem>(); Scannerino.ScanAllMods(MUVM); JSonHelper.SaveContentItems(MUVM.ContentItems); foreach (LibraryItem li in MUVM.Library) { List <ContentItem> contentItems = MUVM.ContentItems.Where(ci => ci.LibraryItemGuid == li.Guid).ToList(); MUVM.ActiveWorkspace = Slotter.AutomaticSlot(contentItems, MUVM.ActiveWorkspace, MUVM.QuasarModTypes); } JSonHelper.SaveWorkspaces(MUVM.Workspaces); EventSystem.Publish <ModalEvent>(new ModalEvent() { Action = "LoadOK", EventName = "UltraScanning" }); }