-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[client] 사용자의 클라이언트 연결을 볼 수 있는 기능 추가
- Loading branch information
Showing
14 changed files
with
403 additions
and
11 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
client/Ntreev.Crema.Client.Framework/IUserAuthenticationDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//Released under the MIT License. | ||
// | ||
//Copyright (c) 2018 Ntreev Soft co., Ltd. | ||
// | ||
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
//documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
//rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit | ||
//persons to whom the Software is furnished to do so, subject to the following conditions: | ||
// | ||
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | ||
//Software. | ||
// | ||
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
//WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
//COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
//OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
using Ntreev.Crema.ServiceModel; | ||
using Ntreev.Crema.Services; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Ntreev.Crema.Client.Framework | ||
{ | ||
public interface IUserAuthenticationDescriptor : IDescriptorBase | ||
{ | ||
string DisplayName { get; } | ||
|
||
UserInfo UserInfo { get; } | ||
|
||
bool IsOnline { get; } | ||
|
||
IUser User { get; } | ||
|
||
new IUserAuthentication Target { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
client/Ntreev.Crema.Client.Framework/UserAuthenticationDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
//Released under the MIT License. | ||
// | ||
//Copyright (c) 2018 Ntreev Soft co., Ltd. | ||
// | ||
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
//documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
//rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit | ||
//persons to whom the Software is furnished to do so, subject to the following conditions: | ||
// | ||
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | ||
//Software. | ||
// | ||
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
//WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
//COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
//OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Ntreev.Crema.ServiceModel; | ||
using Ntreev.Crema.Services; | ||
|
||
namespace Ntreev.Crema.Client.Framework | ||
{ | ||
public class UserAuthenticationDescriptor : DescriptorBase, IUserAuthenticationDescriptor | ||
{ | ||
private readonly IUserAuthentication userAuthentication; | ||
|
||
public UserAuthenticationDescriptor(Authentication authentication, IUserAuthentication userAuthentication, DescriptorTypes descriptorTypes, object owner) | ||
: base(authentication, userAuthentication, descriptorTypes) | ||
{ | ||
this.userAuthentication = userAuthentication; | ||
} | ||
|
||
public string DisplayName | ||
{ | ||
get | ||
{ | ||
var name = ""; | ||
if (this.authentication.Token == this.userAuthentication.Authentication.Token) | ||
{ | ||
name += "* "; | ||
} | ||
|
||
name += this.userAuthentication.Authentication.Token.ToString(); | ||
return name; | ||
} | ||
} | ||
|
||
public UserInfo UserInfo => this.User.UserInfo; | ||
|
||
public bool IsOnline { get; } = true; | ||
|
||
public IUser User => this.userAuthentication.User; | ||
|
||
IUserAuthentication IUserAuthenticationDescriptor.Target => this.userAuthentication; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
client/Ntreev.Crema.Client.Framework/UserAuthenticationTreeItemBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//Released under the MIT License. | ||
// | ||
//Copyright (c) 2018 Ntreev Soft co., Ltd. | ||
// | ||
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
//documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
//rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit | ||
//persons to whom the Software is furnished to do so, subject to the following conditions: | ||
// | ||
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | ||
//Software. | ||
// | ||
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
//WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
//COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
//OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Ntreev.Crema.ServiceModel; | ||
using Ntreev.Crema.Services; | ||
|
||
namespace Ntreev.Crema.Client.Framework | ||
{ | ||
public class UserAuthenticationTreeItemBase : DescriptorTreeItemBase<UserAuthenticationDescriptor>, IUserAuthenticationDescriptor | ||
{ | ||
public UserAuthenticationTreeItemBase(Authentication authentication, IUserAuthentication userAuthentication, bool isSubscriptable, object owner) | ||
: base(authentication, new UserAuthenticationDescriptor(authentication, userAuthentication, isSubscriptable ? DescriptorTypes.All : DescriptorTypes.IsRecursive, owner), owner) | ||
{ | ||
|
||
} | ||
|
||
internal protected UserAuthenticationTreeItemBase(Authentication authentication, UserAuthenticationDescriptor descriptor, object owner) | ||
: base(authentication, descriptor, owner) | ||
{ | ||
} | ||
|
||
public UserInfo UserInfo => this.Descriptor.UserInfo; | ||
|
||
public bool IsOnline => this.Descriptor.IsOnline; | ||
|
||
public IUser User => this.Descriptor.User; | ||
|
||
IUserAuthentication IUserAuthenticationDescriptor.Target => this.Descriptor.Target as IUserAuthentication; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.