Kein Fehler mehr bei fehlender, serverseitiger AccentColor.
Neuladen der Kontaktliste hat nicht mehr zur Folge, dass die Suche nicht mehr funktioniert.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Media;
|
||||
@@ -65,11 +64,9 @@ namespace ChatController.ChatKlassen
|
||||
|
||||
public DateTime TimeStamp { get; set; }
|
||||
|
||||
public int GroupId { get; set; }
|
||||
public int GroupId { get; }
|
||||
|
||||
public int UserOid { get; set; }
|
||||
|
||||
public string UserIdManage { get; set; }
|
||||
public string UserIdManage { get; }
|
||||
|
||||
public bool IsChatMessageInputGridVisible { get; }
|
||||
|
||||
@@ -88,61 +85,65 @@ namespace ChatController.ChatKlassen
|
||||
|
||||
IsChatMessageInputGridVisible = isChatMessageInputGridVisible;
|
||||
|
||||
AccentColorBrush = new BrushConverter().ConvertFromString($"#{accentColorBrushString}") as SolidColorBrush ?? new SolidColorBrush(Colors.Black);
|
||||
if(accentColorBrushString == null)
|
||||
{
|
||||
if(pUserIdManage != null)
|
||||
{
|
||||
accentColorBrushString = "3B7799";
|
||||
}
|
||||
else if(pOnlyEmployees && pUserCount > 2)
|
||||
{
|
||||
accentColorBrushString = "45993B";
|
||||
}
|
||||
else
|
||||
{
|
||||
accentColorBrushString = "000000";
|
||||
}
|
||||
}
|
||||
|
||||
AccentColorBrush = new BrushConverter().ConvertFromString($"#{accentColorBrushString}") as SolidColorBrush;
|
||||
|
||||
Image = image;
|
||||
}
|
||||
|
||||
private sealed class ContactEqualityComparer : IEqualityComparer<Contact>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
public bool Equals(Contact x, Contact y)
|
||||
if(obj is Contact y)
|
||||
{
|
||||
if(ReferenceEquals(x, y))
|
||||
if(ReferenceEquals(this, y))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(x is null)
|
||||
if(GetType() != y.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(y is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(x.GetType() != y.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return x.Name == y.Name &&
|
||||
x.IsNewMessage == y.IsNewMessage &&
|
||||
Equals(x.ProfilePicture, y.ProfilePicture) &&
|
||||
x.TimeStamp.Equals(y.TimeStamp) &&
|
||||
x.GroupId == y.GroupId &&
|
||||
x.UserOid == y.UserOid &&
|
||||
x.UserIdManage == y.UserIdManage &&
|
||||
x.IsChatMessageInputGridVisible == y.IsChatMessageInputGridVisible;
|
||||
return Name == y.Name &&
|
||||
IsNewMessage == y.IsNewMessage &&
|
||||
Equals(ProfilePicture, y.ProfilePicture) &&
|
||||
TimeStamp.Equals(y.TimeStamp) &&
|
||||
GroupId == y.GroupId &&
|
||||
UserIdManage == y.UserIdManage &&
|
||||
IsChatMessageInputGridVisible == y.IsChatMessageInputGridVisible;
|
||||
}
|
||||
|
||||
public int GetHashCode(Contact obj)
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hashCode = obj.Name != null ? obj.Name.GetHashCode() : 0;
|
||||
var hashCode = Name != null ? Name.GetHashCode() : 0;
|
||||
|
||||
hashCode = (hashCode * 397) ^ obj.IsNewMessage.GetHashCode();
|
||||
hashCode = (hashCode * 397) ^ (obj.ProfilePicture != null ? obj.ProfilePicture.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ obj.TimeStamp.GetHashCode();
|
||||
hashCode = (hashCode * 397) ^ obj.GroupId;
|
||||
hashCode = (hashCode * 397) ^ obj.UserOid;
|
||||
hashCode = (hashCode * 397) ^ (obj.UserIdManage != null ? obj.UserIdManage.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ obj.IsChatMessageInputGridVisible.GetHashCode();
|
||||
hashCode = (hashCode * 397) ^ (ProfilePicture != null ? ProfilePicture.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ GroupId;
|
||||
hashCode = (hashCode * 397) ^ (UserIdManage != null ? UserIdManage.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ IsChatMessageInputGridVisible.GetHashCode();
|
||||
|
||||
return hashCode;
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -912,6 +912,8 @@ namespace ChatController
|
||||
|
||||
ReadNewSyncFile();
|
||||
|
||||
AddViewFilterToClientlist();
|
||||
|
||||
EndWaiting();
|
||||
});
|
||||
});
|
||||
@@ -1096,6 +1098,11 @@ namespace ChatController
|
||||
}
|
||||
|
||||
private void ChatMainControl_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AddViewFilterToClientlist();
|
||||
}
|
||||
|
||||
private void AddViewFilterToClientlist()
|
||||
{
|
||||
var view = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
|
||||
view.Filter = UserFilter;
|
||||
|
||||
Reference in New Issue
Block a user