Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Windows
pEp for Outlook
Compare Revisions
52d447153dd189005e7ae4b81e35bfc65b53f413...05fa17c086d355026bf3c727430b64fc173df09c
Source
05fa17c086d355026bf3c727430b64fc173df09c
Select Git revision
...
Target
52d447153dd189005e7ae4b81e35bfc65b53f413
Select Git revision
Compare
Commits (3)
Add real engine methods
· 11abf403
Thomas
authored
Apr 22, 2021
11abf403
Use pEpIdentity instead of PEPIdentity
· 7555e8e2
Thomas
authored
Apr 22, 2021
7555e8e2
Disable Delete button if no groups are present
· 05fa17c0
Thomas
authored
Apr 22, 2021
05fa17c0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
135 additions
and
81 deletions
+135
-81
UI/DialogHost.cs
UI/DialogHost.cs
+1
-1
UI/Models/MessageGroup.cs
UI/Models/MessageGroup.cs
+59
-46
UI/Models/MessageGroupInviteDialog.cs
UI/Models/MessageGroupInviteDialog.cs
+5
-3
UI/Models/OptionsDialog.cs
UI/Models/OptionsDialog.cs
+35
-12
UI/ViewModels/MessageGroupInviteViewModel.cs
UI/ViewModels/MessageGroupInviteViewModel.cs
+19
-3
UI/ViewModels/MessageGroupMemberViewModel.cs
UI/ViewModels/MessageGroupMemberViewModel.cs
+5
-10
UI/ViewModels/MessageGroupViewModel.cs
UI/ViewModels/MessageGroupViewModel.cs
+4
-4
UI/ViewModels/OptionsViewModel.cs
UI/ViewModels/OptionsViewModel.cs
+2
-2
UI/Views/OptionsView.xaml
UI/Views/OptionsView.xaml
+5
-0
No files found.
UI/DialogHost.cs
View file @
05fa17c0
...
@@ -222,7 +222,7 @@ namespace pEp.UI
...
@@ -222,7 +222,7 @@ namespace pEp.UI
/// <summary>
/// <summary>
/// Shows the group invite dialog.
/// Shows the group invite dialog.
/// </summary>
/// </summary>
public
static
void
ShowGroupInviteDialog
(
MessageGroup
host
,
PEP
Identity
invitee
)
public
static
void
ShowGroupInviteDialog
(
MessageGroup
host
,
pEp
Identity
invitee
)
{
{
new
DialogHost
(
new
MessageGroupInviteDialog
(
host
,
invitee
)).
ShowAsOutlookChild
(
true
);
new
DialogHost
(
new
MessageGroupInviteDialog
(
host
,
invitee
)).
ShowAsOutlookChild
(
true
);
}
}
...
...
UI/Models/MessageGroup.cs
View file @
05fa17c0
...
@@ -8,17 +8,17 @@ namespace pEp.UI.Models
...
@@ -8,17 +8,17 @@ namespace pEp.UI.Models
/// <summary>
/// <summary>
/// Gets the identity object representing the group.
/// Gets the identity object representing the group.
/// </summary>
/// </summary>
public
PEP
Identity
GroupIdentity
{
get
;
}
public
pEp
Identity
GroupIdentity
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// Gets the group manager.
/// Gets the group manager.
/// </summary>
/// </summary>
public
PEP
Identity
GroupManager
{
get
;
}
public
pEp
Identity
GroupManager
{
get
;
}
/// <summary>
/// <summary>
/// The group members.
/// The group members.
/// </summary>
/// </summary>
public
List
<
PEP
Identity
>
GroupMembers
{
get
;
}
=
new
List
<
PEP
Identity
>();
public
List
<
pEp
Identity
>
GroupMembers
{
get
;
}
=
new
List
<
pEp
Identity
>();
/// <summary>
/// <summary>
/// Gets or sets the pEp rating of this group.
/// Gets or sets the pEp rating of this group.
...
@@ -30,7 +30,7 @@ namespace pEp.UI.Models
...
@@ -30,7 +30,7 @@ namespace pEp.UI.Models
/// </summary>
/// </summary>
/// <param name="groupIdentity">The group identity.</param>
/// <param name="groupIdentity">The group identity.</param>
/// <param name="groupManager">The group manager.</param>
/// <param name="groupManager">The group manager.</param>
public
MessageGroup
(
PEP
Identity
groupIdentity
,
PEP
Identity
groupManager
)
public
MessageGroup
(
pEp
Identity
groupIdentity
,
pEp
Identity
groupManager
)
{
{
this
.
GroupIdentity
=
groupIdentity
;
this
.
GroupIdentity
=
groupIdentity
;
this
.
GroupManager
=
groupManager
;
this
.
GroupManager
=
groupManager
;
...
@@ -43,11 +43,11 @@ namespace pEp.UI.Models
...
@@ -43,11 +43,11 @@ namespace pEp.UI.Models
/// <param name="groupIdentity">The group identity.</param>
/// <param name="groupIdentity">The group identity.</param>
/// <param name="groupManager">The group manager.</param>
/// <param name="groupManager">The group manager.</param>
/// <param name="groupMembers">The group members.</param>
/// <param name="groupMembers">The group members.</param>
public
MessageGroup
(
pEpIdentity
groupIdentity
,
pEpIdentity
groupManager
,
pEpIdentity
[]
groupMembers
)
:
this
(
new
PEPIdentity
(
groupIdentity
)
,
new
PEPIdentity
(
groupManager
)
)
public
MessageGroup
(
pEpIdentity
groupIdentity
,
pEpIdentity
groupManager
,
pEpIdentity
[]
groupMembers
)
:
this
(
groupIdentity
,
groupManager
)
{
{
foreach
(
pEpIdentity
groupMember
in
groupMembers
)
foreach
(
pEpIdentity
groupMember
in
groupMembers
)
{
{
this
.
GroupMembers
.
Add
(
new
PEPIdentity
(
groupMember
)
)
;
this
.
GroupMembers
.
Add
(
groupMember
);
}
}
}
}
...
@@ -57,8 +57,20 @@ namespace pEp.UI.Models
...
@@ -57,8 +57,20 @@ namespace pEp.UI.Models
/// <returns>The group rating.</returns>
/// <returns>The group rating.</returns>
private
pEpRating
GetGroupRating
()
private
pEpRating
GetGroupRating
()
{
{
//return AdapterExtensions.ExecuteAndLogError(() => ThisAddIn.PEPEngine.GroupRating(this.GroupIdentity, this.GroupManager));
pEpRating
groupRating
=
pEpRating
.
pEpRatingUndefined
;
return
pEpRating
.
pEpRatingUndefined
;
AdapterExtensions
.
ExecuteAndLogError
(()
=>
ThisAddIn
.
PEPEngine
.
GroupRating
(
this
.
GroupIdentity
,
this
.
GroupManager
,
out
groupRating
));
return
groupRating
;
}
/// <summary>
/// Sets the user name of this group.
/// </summary>
/// <param name="name">The name to set.</param>
public
void
SetUserName
(
string
name
)
{
pEpIdentity
groupIdentity
=
this
.
GroupIdentity
;
groupIdentity
.
UserName
=
name
;
this
.
GroupIdentity
=
groupIdentity
;
}
}
/// <summary>
/// <summary>
...
@@ -68,9 +80,9 @@ namespace pEp.UI.Models
...
@@ -68,9 +80,9 @@ namespace pEp.UI.Models
/// <param name="groupManager">The group manager.</param>
/// <param name="groupManager">The group manager.</param>
/// <param name="memberList">The list of members.</param>
/// <param name="memberList">The list of members.</param>
/// <returns></returns>
/// <returns></returns>
public
static
MessageGroup
Create
(
PEP
Identity
groupIdentity
,
PEP
Identity
groupManager
,
List
<
PEP
Identity
>
memberList
)
public
static
MessageGroup
Create
(
pEp
Identity
groupIdentity
,
pEp
Identity
groupManager
,
List
<
pEp
Identity
>
memberList
)
{
{
//return AdapterExtensions.ExecuteAndLogError(() => ThisAddIn.PEPEngine.
Adapter
GroupCreate(groupIdentity, groupManager, memberList.ToArray()));
//return AdapterExtensions.ExecuteAndLogError(() => ThisAddIn.PEPEngine.GroupCreate(groupIdentity, groupManager, memberList.ToArray()));
return
null
;
return
null
;
}
}
...
@@ -99,43 +111,44 @@ namespace pEp.UI.Models
...
@@ -99,43 +111,44 @@ namespace pEp.UI.Models
private
static
List
<
MessageGroup
>
CreateDummyList
()
private
static
List
<
MessageGroup
>
CreateDummyList
()
{
{
return
new
List
<
MessageGroup
>
return
null
;
{
//return new List<MessageGroup>
//{
new
MessageGroup
(
new
PEP
Identity
(
"gi1@peptest.ch"
)
{
UserName
=
"Test 1"
},
new
PEP
Identity
(
"groupManager@peptest.ch"
))
//
new MessageGroup(new
pEp
Identity("gi1@peptest.ch") { UserName = "Test 1" }, new
pEp
Identity("groupManager@peptest.ch"))
{
//
{
GroupMembers
=
//
GroupMembers =
{
//
{
new
PEP
Identity
(
"test@peptest.ch"
),
//
new
pEp
Identity("test@peptest.ch"),
new
PEP
Identity
(
"test2@peptest.ch"
),
//
new
pEp
Identity("test2@peptest.ch"),
new
PEP
Identity
(
"test3@peptest.ch"
),
//
new
pEp
Identity("test3@peptest.ch"),
new
PEP
Identity
(
"test4@peptest.ch"
),
//
new
pEp
Identity("test4@peptest.ch"),
new
PEP
Identity
(
"test5@peptest.ch"
)
//
new
pEp
Identity("test5@peptest.ch")
}
//
}
},
//
},
new
MessageGroup
(
new
PEP
Identity
(
"gi2@peptest.ch"
)
{
UserName
=
"Test Group 2"
},
new
PEP
Identity
(
"groupManager@peptest.ch"
))
//
new MessageGroup(new
pEp
Identity("gi2@peptest.ch") { UserName = "Test Group 2" }, new
pEp
Identity("groupManager@peptest.ch"))
{
//
{
GroupMembers
=
//
GroupMembers =
{
//
{
new
PEP
Identity
(
"test1@peptest.ch"
),
//
new
pEp
Identity("test1@peptest.ch"),
new
PEP
Identity
(
"test6@peptest.ch"
),
//
new
pEp
Identity("test6@peptest.ch"),
new
PEP
Identity
(
"test7@peptest.ch"
),
//
new
pEp
Identity("test7@peptest.ch"),
new
PEP
Identity
(
"test8@peptest.ch"
),
//
new
pEp
Identity("test8@peptest.ch"),
new
PEP
Identity
(
"test9@peptest.ch"
)
//
new
pEp
Identity("test9@peptest.ch")
}
//
}
},
//
},
new
MessageGroup
(
new
PEP
Identity
(
"gi3@peptest.ch"
)
{
UserName
=
"T3"
},
new
PEP
Identity
(
"groupManager@peptest.ch"
))
//
new MessageGroup(new
pEp
Identity("gi3@peptest.ch") { UserName = "T3" }, new
pEp
Identity("groupManager@peptest.ch"))
{
//
{
GroupMembers
=
//
GroupMembers =
{
//
{
new
PEP
Identity
(
"test1@peptest.ch"
),
//
new
pEp
Identity("test1@peptest.ch"),
new
PEP
Identity
(
"test2@peptest.ch"
),
//
new
pEp
Identity("test2@peptest.ch"),
new
PEP
Identity
(
"test5@peptest.ch"
),
//
new
pEp
Identity("test5@peptest.ch"),
new
PEP
Identity
(
"test8@peptest.ch"
),
//
new
pEp
Identity("test8@peptest.ch"),
new
PEP
Identity
(
"test9@peptest.ch"
)
//
new
pEp
Identity("test9@peptest.ch")
}
//
}
}
//
}
};
//
};
}
}
}
}
}
}
UI/Models/MessageGroupInviteDialog.cs
View file @
05fa17c0
namespace
pEp.UI.Models
using
pEpCOMServerAdapterLib
;
namespace
pEp.UI.Models
{
{
internal
class
MessageGroupInviteDialog
:
Dialog
internal
class
MessageGroupInviteDialog
:
Dialog
{
{
...
@@ -10,14 +12,14 @@
...
@@ -10,14 +12,14 @@
/// <summary>
/// <summary>
/// Gets the identity that is being invited.
/// Gets the identity that is being invited.
/// </summary>
/// </summary>
public
PEP
Identity
Invitee
{
get
;
}
public
pEp
Identity
Invitee
{
get
;
}
/// <summary>
/// <summary>
/// Primary constructor.
/// Primary constructor.
/// </summary>
/// </summary>
/// <param name="hostGroup">The message group that the invitation is for.</param>
/// <param name="hostGroup">The message group that the invitation is for.</param>
/// <param name="invitee">The identity that is being invited.</param>
/// <param name="invitee">The identity that is being invited.</param>
public
MessageGroupInviteDialog
(
MessageGroup
hostGroup
,
PEP
Identity
invitee
)
:
base
(
Dialog
.
Type
.
GroupInvite
)
public
MessageGroupInviteDialog
(
MessageGroup
hostGroup
,
pEp
Identity
invitee
)
:
base
(
Dialog
.
Type
.
GroupInvite
)
{
{
this
.
HostGroup
=
hostGroup
;
this
.
HostGroup
=
hostGroup
;
this
.
Invitee
=
invitee
;
this
.
Invitee
=
invitee
;
...
...
UI/Models/OptionsDialog.cs
View file @
05fa17c0
using
pEp.UI.ViewModels
;
using
pEp.UI.ViewModels
;
using
pEpCOMServerAdapterLib
;
using
pEpCOMServerAdapterLib
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Runtime.InteropServices
;
...
@@ -29,9 +30,12 @@ namespace pEp.UI.Models
...
@@ -29,9 +30,12 @@ namespace pEp.UI.Models
this
.
StartPage
=
startPage
;
this
.
StartPage
=
startPage
;
// Get existing lists from adapter
// Get existing lists from adapter
foreach
(
var
messageGroup
in
MessageGroup
.
QueryMessage
Groups
()
)
if
(
MessageGroup
.
QueryMessageGroups
()
is
List
<
MessageGroup
>
existing
Groups
)
{
{
this
.
MessageGroups
.
Add
(
new
MessageGroupViewModel
(
messageGroup
));
foreach
(
var
messageGroup
in
existingGroups
)
{
this
.
MessageGroups
.
Add
(
new
MessageGroupViewModel
(
messageGroup
));
}
}
}
this
.
PopulateBlacklist
();
this
.
PopulateBlacklist
();
...
@@ -253,12 +257,12 @@ namespace pEp.UI.Models
...
@@ -253,12 +257,12 @@ namespace pEp.UI.Models
/// </summary>
/// </summary>
private
void
SyncMessageGroupsWithAdapter
()
private
void
SyncMessageGroupsWithAdapter
()
{
{
// D
elete
groups
// D
issolve removed
groups
MessageGroup
.
QueryMessageGroups
()?.
ForEach
((
group
)
=>
MessageGroup
.
QueryMessageGroups
()?.
ForEach
((
group
)
=>
{
{
if
(
this
.
MessageGroups
.
Any
(
mg
=>
mg
.
GroupIdentity
.
Address
==
group
.
GroupIdentity
.
Address
)
==
false
)
if
(
this
.
MessageGroups
.
Any
(
mg
=>
mg
.
GroupIdentity
.
Address
==
group
.
GroupIdentity
.
Address
)
==
false
)
{
{
//
AdapterExtensions.ExecuteAndLogError(ThisAddIn.PEPEngine.
Adapter
GroupDissolve(group.GroupIdentity, group.GroupManager));
AdapterExtensions
.
ExecuteAndLogError
(
()
=>
ThisAddIn
.
PEPEngine
.
GroupDissolve
(
group
.
GroupIdentity
,
group
.
GroupManager
));
}
}
});
});
...
@@ -277,19 +281,22 @@ namespace pEp.UI.Models
...
@@ -277,19 +281,22 @@ namespace pEp.UI.Models
if
(
messageGroupViewModel
!=
null
)
if
(
messageGroupViewModel
!=
null
)
{
{
// Remove members
group
?.
GroupMembers
?.
ForEach
((
member
)
=>
group
?.
GroupMembers
?.
ForEach
((
member
)
=>
{
{
if
(
messageGroupViewModel
.
GroupMembers
?.
Any
(
a
=>
a
.
PEPIdentity
.
Equals
(
member
))
==
false
)
if
(
messageGroupViewModel
.
GroupMembers
?.
Any
(
a
=>
a
.
PEPIdentity
.
Address
.
Equals
(
member
.
Address
))
==
false
)
{
{
//
AdapterExtensions.ExecuteAndLogError(ThisAddIn.PEPEngine.
Adapter
GroupRemoveMember(group.GroupIdentity, member));
AdapterExtensions
.
ExecuteAndLogError
(
()
=>
ThisAddIn
.
PEPEngine
.
GroupRemoveMember
(
group
.
GroupIdentity
,
member
));
}
}
});
});
// Invite new members
messageGroupViewModel
.
GroupMembers
?.
ToList
()?.
ForEach
((
member
)
=>
messageGroupViewModel
.
GroupMembers
?.
ToList
()?.
ForEach
((
member
)
=>
{
{
if
(
group
.
GroupMembers
?.
Any
(
a
=>
a
.
Equals
(
member
.
PEPIdentity
))
==
false
)
if
(
group
.
GroupMembers
?.
Any
(
a
=>
a
.
Address
.
Equals
(
member
.
PEPIdentity
.
Address
))
==
false
)
{
{
//AdapterExtensions.ExecuteAndLogError(ThisAddIn.PEPEngine.AdapterGroupInviteMember(group.GroupIdentity, member.PEPIdentity));
pEpIdentity
newGroupMember
=
member
.
PEPIdentity
.
ToCOMType
();
AdapterExtensions
.
ExecuteAndLogError
(()
=>
ThisAddIn
.
PEPEngine
.
GroupInviteMember
(
group
.
GroupIdentity
,
newGroupMember
));
}
}
});
});
}
}
...
@@ -301,12 +308,28 @@ namespace pEp.UI.Models
...
@@ -301,12 +308,28 @@ namespace pEp.UI.Models
{
{
if
(
existingGroups
?.
Any
(
a
=>
a
.
GroupIdentity
.
Equals
(
group
.
GroupIdentity
))
==
false
)
if
(
existingGroups
?.
Any
(
a
=>
a
.
GroupIdentity
.
Equals
(
group
.
GroupIdentity
))
==
false
)
{
{
//AdapterExtensions.ExecuteAndLogError(ThisAddIn.PEPEngine.AdapterGroupCreate(group.GroupIdentity, group.GroupManager));
List
<
pEpIdentity
>
memberlist
=
new
List
<
pEpIdentity
>();
group
.
GroupMembers
?.
ToList
()?.
ForEach
((
member
)
=>
group
.
GroupMembers
.
ToList
()?.
ForEach
((
member
)
=>
{
{
//AdapterExtensions.ExecuteAndLogError(ThisAddIn.PEPEngine.AdapterGroupInviteMember(group.GroupIdentity, member.PEPIdentity));
pEpIdentity
newGroupMember
=
member
.
PEPIdentity
.
ToCOMType
();
memberlist
.
Add
(
newGroupMember
);
});
});
try
{
// First try to create the group
ThisAddIn
.
PEPEngine
.
GroupCreate
(
group
.
GroupIdentity
,
group
.
GroupManager
,
memberlist
.
ToArray
());
// Only invite members if group was created successfully
memberlist
.
ForEach
((
member
)
=>
{
AdapterExtensions
.
ExecuteAndLogError
(()
=>
ThisAddIn
.
PEPEngine
.
GroupInviteMember
(
group
.
GroupIdentity
,
member
));
});
}
catch
(
Exception
ex
)
{
Log
.
Error
(
"SyncMessageGroupsWithAdapter: Error creating group. "
+
ex
.
ToString
());
}
}
}
});
});
}
}
...
...
UI/ViewModels/MessageGroupInviteViewModel.cs
View file @
05fa17c0
using
pEp.UI.Models
;
using
pEp.UI.Models
;
using
pEpCOMServerAdapterLib
;
using
System
;
using
System
;
namespace
pEp.UI.ViewModels
namespace
pEp.UI.ViewModels
...
@@ -90,8 +91,13 @@ namespace pEp.UI.ViewModels
...
@@ -90,8 +91,13 @@ namespace pEp.UI.ViewModels
/// </summary>
/// </summary>
private
void
AcceptInvite
()
private
void
AcceptInvite
()
{
{
var
msgGroupInviteDialog
=
(
this
.
Dialog
as
MessageGroupInviteDialog
);
if
(
this
.
Dialog
is
MessageGroupInviteDialog
msgGroupInviteDialog
)
// ThisAddIn.PEPEngine.GroupJoin(msgGroupInviteDialog.HostGroup.GroupIdentity, msgGroupInviteDialog.Invitee);
{
pEpIdentity
groupIdentity
=
msgGroupInviteDialog
.
HostGroup
.
GroupIdentity
;
pEpIdentity
invitee
=
msgGroupInviteDialog
.
Invitee
;
AdapterExtensions
.
ExecuteAndLogError
(()
=>
ThisAddIn
.
PEPEngine
.
GroupJoin
(
groupIdentity
,
invitee
));
}
}
}
/// <summary>
/// <summary>
...
@@ -99,7 +105,17 @@ namespace pEp.UI.ViewModels
...
@@ -99,7 +105,17 @@ namespace pEp.UI.ViewModels
/// </summary>
/// </summary>
private
void
RejectInvite
()
private
void
RejectInvite
()
{
{
string
groupName
=
null
;
try
{
groupName
=
(
this
.
Dialog
as
MessageGroupInviteDialog
).
HostGroup
.
GroupIdentity
.
UserName
;
}
catch
(
Exception
ex
)
{
groupName
=
"<null>"
;
Log
.
Error
(
"RejectInvite: Error getting user name. "
+
ex
.
ToString
());
}
Log
.
Verbose
(
"RejectInvite: Invitation to group {0} has been rejected by the user."
,
groupName
);
}
}
}
}
}
}
UI/ViewModels/MessageGroupMemberViewModel.cs
View file @
05fa17c0
...
@@ -2,17 +2,12 @@
...
@@ -2,17 +2,12 @@
{
{
internal
class
MessageGroupMemberViewModel
:
SelectableItemViewModel
internal
class
MessageGroupMemberViewModel
:
SelectableItemViewModel
{
{
private
PEPIdentity
_PEPIdentity
;
private
RelayCommand
_RemoveGroupMemberCommand
=
null
;
private
RelayCommand
_RemoveGroupMemberCommand
=
null
;
/// <summary>
/// <summary>
/// Gets this members associated pEp identity.
/// Gets this members associated pEp identity.
/// </summary>
/// </summary>
public
PEPIdentity
PEPIdentity
public
PEPIdentity
PEPIdentity
{
get
;
}
=
new
PEPIdentity
();
{
get
=>
this
.
_PEPIdentity
;
}
/// <summary>
/// <summary>
/// Command to remove this group member.
/// Command to remove this group member.
...
@@ -44,18 +39,18 @@
...
@@ -44,18 +39,18 @@
public
MessageGroupMemberViewModel
(
MessageGroupViewModel
parent
,
string
address
)
public
MessageGroupMemberViewModel
(
MessageGroupViewModel
parent
,
string
address
)
{
{
this
.
MessageGroupParentViewModel
=
parent
;
this
.
MessageGroupParentViewModel
=
parent
;
this
.
_
PEPIdentity
=
new
PEPIdentity
(
address
);
this
.
PEPIdentity
=
new
PEPIdentity
(
address
);
}
}
/// <summary>
/// <summary>
/// Secondary constructor.
/// Secondary constructor.
/// </summary>
/// </summary>
/// <param name="parent">The parent view model.</param>
/// <param name="parent">The parent view model.</param>
/// <param name="
pEp
Identity">The pEp identity of the group member.</param>
/// <param name="
PEP
Identity">The pEp identity of the group member.</param>
public
MessageGroupMemberViewModel
(
MessageGroupViewModel
parent
,
PEPIdentity
pEp
Identity
)
public
MessageGroupMemberViewModel
(
MessageGroupViewModel
parent
,
PEPIdentity
PEP
Identity
)
{
{
this
.
MessageGroupParentViewModel
=
parent
;
this
.
MessageGroupParentViewModel
=
parent
;
this
.
_
PEPIdentity
=
pEp
Identity
;
this
.
PEPIdentity
=
PEP
Identity
;
}
}
/// <summary>
/// <summary>
...
...
UI/ViewModels/MessageGroupViewModel.cs
View file @
05fa17c0
...
@@ -30,7 +30,7 @@ namespace pEp.UI.ViewModels
...
@@ -30,7 +30,7 @@ namespace pEp.UI.ViewModels
/// <summary>
/// <summary>
/// Gets the manager of the message group.
/// Gets the manager of the message group.
/// </summary>
/// </summary>
public
PEP
Identity
GroupIdentity
public
pEp
Identity
GroupIdentity
{
{
get
=>
this
.
messageGroup
.
GroupIdentity
;
get
=>
this
.
messageGroup
.
GroupIdentity
;
}
}
...
@@ -38,7 +38,7 @@ namespace pEp.UI.ViewModels
...
@@ -38,7 +38,7 @@ namespace pEp.UI.ViewModels
/// <summary>
/// <summary>
/// Gets the manager of the message group.
/// Gets the manager of the message group.
/// </summary>
/// </summary>
public
PEP
Identity
GroupManager
public
pEp
Identity
GroupManager
{
{
get
=>
this
.
messageGroup
.
GroupManager
;
get
=>
this
.
messageGroup
.
GroupManager
;
}
}
...
@@ -56,7 +56,7 @@ namespace pEp.UI.ViewModels
...
@@ -56,7 +56,7 @@ namespace pEp.UI.ViewModels
get
=>
this
.
messageGroup
.
GroupIdentity
.
UserName
;
get
=>
this
.
messageGroup
.
GroupIdentity
.
UserName
;
set
set
{
{
this
.
messageGroup
.
GroupIdentity
.
UserName
=
value
;
this
.
messageGroup
.
Set
UserName
(
value
)
;
this
.
OnPropertyChanged
();
this
.
OnPropertyChanged
();
}
}
}
}
...
@@ -84,7 +84,7 @@ namespace pEp.UI.ViewModels
...
@@ -84,7 +84,7 @@ namespace pEp.UI.ViewModels
foreach
(
var
member
in
messageGroup
.
GroupMembers
)
foreach
(
var
member
in
messageGroup
.
GroupMembers
)
{
{
this
.
GroupMembers
.
Add
(
new
MessageGroupMemberViewModel
(
this
,
member
));
this
.
GroupMembers
.
Add
(
new
MessageGroupMemberViewModel
(
this
,
new
PEPIdentity
(
member
))
)
;
}
}
}
}
...
...
UI/ViewModels/OptionsViewModel.cs
View file @
05fa17c0
...
@@ -759,11 +759,11 @@ namespace pEp.UI.ViewModels
...
@@ -759,11 +759,11 @@ namespace pEp.UI.ViewModels
Properties
.
Resources
.
Options_CancelText
,
Properties
.
Resources
.
Options_CancelText
,
ref
address
))
ref
address
))
{
{
var
groupIdentity
=
new
PEP
Identity
var
groupIdentity
=
new
pEp
Identity
{
{
UserName
=
address
UserName
=
address
};
};
var
groupManager
=
new
PEP
Identity
();
// TODO: Get correct group manager
var
groupManager
=
new
pEp
Identity
();
// TODO: Get correct group manager
this
.
MessageGroups
.
Insert
(
0
,
new
MessageGroupViewModel
(
new
MessageGroup
(
groupIdentity
,
groupManager
)));
this
.
MessageGroups
.
Insert
(
0
,
new
MessageGroupViewModel
(
new
MessageGroup
(
groupIdentity
,
groupManager
)));
}
}
}
}
...
...
UI/Views/OptionsView.xaml
View file @
05fa17c0
...
@@ -37,6 +37,10 @@
...
@@ -37,6 +37,10 @@
<local:InvertBoolConverter />
<local:InvertBoolConverter />
<BooleanToVisibilityConverter />
<BooleanToVisibilityConverter />
</local:ValueConverterGroup>
</local:ValueConverterGroup>
<local:ValueConverterGroup x:Key="IsListEmptyInvert">
<local:IsListEmptyConverter />
<local:InvertBoolConverter />
</local:ValueConverterGroup>
<!-- Configuration -->
<!-- Configuration -->
<core:Double x:Key="PageSelectorHeight">30</core:Double>
<core:Double x:Key="PageSelectorHeight">30</core:Double>
...
@@ -1032,6 +1036,7 @@
...
@@ -1032,6 +1036,7 @@
</ListBox>
</ListBox>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<Button Content="{x:Static p:Resources.Options_DeleteText}"
<Button Content="{x:Static p:Resources.Options_DeleteText}"
IsEnabled="{Binding MessageGroups, Converter={StaticResource IsListEmptyInvert}}"
Style="{StaticResource StyleButtonGray}"
Style="{StaticResource StyleButtonGray}"
Margin="10,5,5,5"
Margin="10,5,5,5"
Command="{Binding CommandButtonDeleteGroup}"/>
Command="{Binding CommandButtonDeleteGroup}"/>
...
...