private void ShowPreview(SaveManager.Resource_Data.Resources res) { ImageBrush imb = new ImageBrush(Mgr.LoadImage(res.Path)); imb.Stretch = Stretch.Uniform; imb.TileMode = TileMode.None; SelectedName.Content = res.Name; Preview.Background = imb; }
private void ImportFile(string FileDir, bool?Import = false) { SaveManager.Resource_Data.Resources res = new SaveManager.Resource_Data.Resources(); res.Name = System.IO.Path.GetFileName(FileDir); res.Type = SaveManager.Resource_Data.Resource_Type.Image; if (Import == true) { res.Path = "save:" + FileDir; MainWindow.SaveManager.ImportFile(FileDir, res.Name); } else { res.Path = "path:" + FileDir; } MainWindow.SaveManager.SaveData.ImageResources.Add(res); }
private void ImportFile(string FileDir, bool?Import = false) { SaveManager.Resource_Data.Resources res = new SaveManager.Resource_Data.Resources(); res.Name = System.IO.Path.GetFileName(FileDir); res.Type = SaveManager.Resource_Data.Resource_Type.Image; if (MainWindow.SaveManager.FileExists("Resource/Images/" + res.Name)) { System.Windows.MessageBox.Show("A File was not imported because there is a file with that name in the save file...\n\nFile: " + res.Name, "File Exists", MessageBoxButton.OK, MessageBoxImage.Warning); return; } if (Import == true) { res.Path = "save:" + "Resource/Images/" + res.Name; MainWindow.SaveManager.ImportFile(FileDir, "Resource/Images/" + res.Name); } else { res.Path = "path:" + FileDir; } MainWindow.SaveManager.SaveData.ImageResources.Add(res); }