示例#1
0
        private static void LoadCoreData(JsonWallpaperData jsonWallpaperData)
        {
            SetMaxRank(jsonWallpaperData.miscData.maxRank);

            //? Must be set before the foreach loop where AddImage is called so that the available tags and categories can exist
            TaggingInfo = new TaggingInfo(jsonWallpaperData.tagData.ToList());

            foreach (CategoryData category in TaggingInfo.GetAllCategories())
            {
                category.Initialize(false);
            }

            // All tags will be linked through the AddImage method
            string invalidImagesString = "A few image files for your theme appear to be missing.\nThe following image's will not be saved to your theme: \n";

            foreach (ImageData image in jsonWallpaperData.imageData)
            {
                if (AddImage(image) == null)
                {
                    invalidImagesString += "\n" + image.Path;
                }
            }

            if (invalidImagesString.Contains("\n\n"))
            {
                MessageBox.Show(invalidImagesString);
            }

            // since activating an image folder also adds undeteced images, this needs to be loaded last
            IsLoadingImageFolders = true; // this is used to override the IsLoading bool for new images added when loading image folders
            WallpaperManagerForm.LoadImageFolders(jsonWallpaperData.imageFolders);
            IsLoadingImageFolders = false;
        }
示例#2
0
 public JsonWallpaperData(ImageData[] imageData, Dictionary <string, bool> imageFolders)
 {
     //! This handles SAVING!!! | Don't go to this code segment for modifying how data is loaded!
     miscData          = new MiscData(); // values are updated in the constructor
     themeOptions      = OptionsData.ThemeOptions;
     this.imageFolders = imageFolders;
     tagData           = TaggingInfo.GetAllCategories();
     this.imageData    = imageData;
 }
示例#3
0
 public static void UnlinkImageTags(ImageData taggedImage)
 {
     foreach (string category in taggedImage.Tags.Keys)
     {
         foreach (string tag in taggedImage.Tags[category])
         {
             TaggingInfo.GetTag(category, tag).UnlinkImage(taggedImage);
         }
     }
 }
示例#4
0
        private static void ResetCoreData()
        {
            int oldRankMax = RankData.Count - 1;

            FileData.Clear();     // AddImage handles most of FileData
            RankData.Clear();     //? Loaded in when jsonWallpaperData is created
            ActiveImages.Clear(); //? Loaded in when jsonWallpaperData is created
            ImageFolders.Clear();
            TaggingInfo = new TaggingInfo();

            ImagesOfType.Clear();
            ImagesOfTypeRankData.Clear();
            ActiveImagesOfType.Clear();

            WallpaperPathing.Reset();

            InitializeImagesOfType();

            // This is needed if loading otherwise images with invalid ranks will crash the program
            SetRankData(LargestMaxRank);
        }
示例#5
0
 public static void UpdateTaggingInfo(TaggingInfo updatedTaggingInfo)
 {
     TaggingInfo = updatedTaggingInfo;
 }