Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Added #67 conversion to lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
COM8 committed Sep 2, 2019
1 parent 5d6442a commit 1b80d77
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public AddChatDialogDataTemplate()
#region --Set-, Get- Methods--
private void SetChatBareJidProperty(string value)
{
// Make sure we only allow lower case JIDs:
value = value?.ToLowerInvariant();

if (SetProperty(ref _ChatBareJid, value, nameof(ChatBareJid)))
{
if (Client is null || string.IsNullOrEmpty(value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public string Nickname
public string RoomBareJid
{
get => _RoomBareJid;
set => SetProperty(ref _RoomBareJid, value);
set => SetRoomBareJidProperty(value);
}

private string _Password;
Expand Down Expand Up @@ -89,16 +89,13 @@ public AddMucDialogDataTemplate()
#endregion
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
#region --Set-, Get- Methods--
private void SetRoomBareJidProperty(string value)
{
// Make sure we only allow lower case JIDs:
value = value?.ToLowerInvariant();
SetProperty(ref _RoomBareJid, value, nameof(RoomBareJid));
}


#endregion
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
#region --Misc Methods (Public)--


#endregion

#region --Misc Methods (Private)--
private void SetIsRoomBareJidValidProperty(bool value)
{
if (SetProperty(ref _IsRoomBareJidValid, value, nameof(IsRoomBareJidValid)))
Expand All @@ -115,11 +112,6 @@ private void SetIsNicknameValidProperty(bool value)
}
}

private void UpdateIsInputValid()
{
IsInputValid = IsRoomBareJidValid && IsNicknameValid;
}

private void SetNicknameProperty(string value)
{
if (SetProperty(ref _Nickname, value, nameof(Nickname)))
Expand All @@ -135,6 +127,18 @@ private void SetClientProperty(XMPPClient value)
Nickname = value.getXMPPAccount().user.localPart;
}
}
#endregion
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
#region --Misc Methods (Public)--


#endregion

#region --Misc Methods (Private)--
private void UpdateIsInputValid()
{
IsInputValid = IsRoomBareJidValid && IsNicknameValid;
}

#endregion

Expand Down

0 comments on commit 1b80d77

Please sign in to comment.