Esempio n. 1
0
        /// <summary>
        /// Launches the update process from 1.5 to 2.1
        /// </summary>
        /// <param name="MUVM"></param>
        public static void LaunchUltraCleaning(MainUIViewModel MUVM)
        {
            try
            {
                MUVM.QuasarLogger.Info("Starting Ultra Clean");
                MUVM.QuasarLogger.Info("Creating base Folders");
                CreateBaseFolders();
                MUVM.QuasarLogger.Info("Creating base Workspace");
                CreateBaseWorkspace();
                MUVM.QuasarLogger.Info("Moving Old Library");
                GetMoveOldLibrary(MUVM.QuasarLogger);


                MUVM.LoadData();
                Scannerino.ScanAllMods(MUVM);
                JSonHelper.SaveContentItems(MUVM.ContentItems);

                LastCleanup();

                EventSystem.Publish <ModalEvent>(new ModalEvent()
                {
                    Action    = "LoadOK",
                    EventName = "UltraCleaning"
                });
            }
            catch (Exception e)
            {
                MUVM.QuasarLogger.Error("Error While processing old files");
                MUVM.QuasarLogger.Error(e.Message);
                MUVM.QuasarLogger.Error(e.StackTrace);
            }
        }
Esempio n. 2
0
        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"
            });
        }