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; }
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; }
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); } } }
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); }
public static void UpdateTaggingInfo(TaggingInfo updatedTaggingInfo) { TaggingInfo = updatedTaggingInfo; }