private static string GetKommenatorBildPfad(string kommentatorName) { FilePathesBuilder filePathesBuilder = new FilePathesBuilder(); string kommentatorPictureFolder = filePathesBuilder.GetKommentatorenPictureFolder(); string kommentatorPicturePath = Path.Combine(kommentatorPictureFolder, kommentatorName.Replace(" ", string.Empty) + ".jpg"); if (!File.Exists(kommentatorPicturePath)) { kommentatorPicturePath = kommentatorPicturePath.Replace(".jpg", ".png"); } return(kommentatorPicturePath); }
private void SetKommenatorBildPfad(Kommentar kommentator) { FilePathesBuilder fb = new FilePathesBuilder(); string kommentatorPictureFolder = fb.GetKommentatorenPictureFolder(); string kommentatorPicturePath = Path.Combine(kommentatorPictureFolder, kommentator.Name.Replace(" ", string.Empty) + ".jpg"); if (!File.Exists(kommentatorPicturePath)) { kommentatorPicturePath = kommentatorPicturePath.Replace(".jpg", ".png"); } kommentator.PicturePath = kommentatorPicturePath; }