Text zu Datei hinzufügen

Neues Buttondesign
Stapelnachrichtsmodus
Anpassbarer Waitlayer
Eigene MessageBox
This commit is contained in:
LynJet
2022-07-28 19:18:15 +02:00
parent b6ccd4fd71
commit b342974c98
35 changed files with 1079 additions and 655 deletions

View File

@@ -17,7 +17,7 @@ namespace ChatController.Core
public static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
if(e.NewValue == null)
if(e.NewValue is null)
{
return;
}

View File

@@ -10,6 +10,38 @@ namespace ChatController.Core
private static readonly object _Lock = new object();
private ImageSource _DocumentThumbnail;
public ImageSource DocumentThumbnail
{
get => _DocumentThumbnail;
set
{
lock(_Lock)
{
if(!(value is null) && _DocumentThumbnail is null)
{
_DocumentThumbnail = value;
}
}
}
}
private ImageSource _ImagePlaceholder;
public ImageSource ImagePlaceholder
{
get => _ImagePlaceholder;
set
{
lock(_Lock)
{
if(!(value is null) && _ImagePlaceholder is null)
{
_ImagePlaceholder = value;
}
}
}
}
// Key-> "group-127" oder "user-938"
private Dictionary<string, ImageSourceCacheStorage> _ImageSourceCache = new Dictionary<string, ImageSourceCacheStorage>();
@@ -41,7 +73,7 @@ namespace ChatController.Core
{
lock(_Lock)
{
if(key == null || _ImageSourceCache == null || !_ImageSourceCache.ContainsKey(key))
if(key is null || _ImageSourceCache is null || !_ImageSourceCache.ContainsKey(key))
{
return null;
}
@@ -56,7 +88,7 @@ namespace ChatController.Core
{
lock(_Lock)
{
if(_ImageSourceCache == null)
if(_ImageSourceCache is null)
{
_ImageSourceCache = new Dictionary<string, ImageSourceCacheStorage>();
}
@@ -158,7 +190,7 @@ namespace ChatController.Core
public void SetCachedProfilePicture(ImageSource avatarImageSource, string profilePicturePath)
{
if(avatarImageSource != null && !string.IsNullOrWhiteSpace(profilePicturePath))
if(!(avatarImageSource is null) && !string.IsNullOrWhiteSpace(profilePicturePath))
{
ProfilePicturePath = profilePicturePath;
_ProfilePicture = new ImageSourceCacheObject(avatarImageSource, CacheCategory.ProfilePicture);
@@ -186,7 +218,7 @@ namespace ChatController.Core
public void AddImageSourceToCachedObjects(ImageSource imageSource, CacheCategory cacheCategory, string name)
{
if(CachedObjects == null)
if(CachedObjects is null)
{
CachedObjects = new Dictionary<CacheCategory, Dictionary<string, ImageSourceCacheObject>>();
}
@@ -206,7 +238,7 @@ namespace ChatController.Core
}
else
{
CachedObjects.Add(cacheCategory, new Dictionary<string, ImageSourceCacheObject> {{name, newImageSourceCacheObject } });
CachedObjects.Add(cacheCategory, new Dictionary<string, ImageSourceCacheObject> { {name, newImageSourceCacheObject } });
}
}
}