private void InvokeAddUser(Authentication authentication, DomainAccessType accessType, out DomainUser domainUser) { domainUser = new DomainUser(this, authentication.ID, authentication.Name, accessType) { IsOnline = authentication.Types.HasFlag(AuthenticationType.User), }; domainUser.Authentication = authentication; authentication.Expired += Authentication_Expired; }
public void Join(Authentication authentication, DomainAccessType accessType) { var action = new JoinAction() { UserID = authentication.ID, AccessType = accessType, AcceptTime = authentication.SignatureDate.DateTime }; this.Post(action); }
public DomainMember(Domain domain, string userID, string name, DomainAccessType accessType) { this.domain = domain; base.DomainMemberInfo = new DomainMemberInfo() { ID = userID, Name = name, AccessType = accessType, }; }
public DomainUser(Domain domain, string userID, string name, DomainAccessType accessType) { this.domain = domain; base.DomainUserInfo = new DomainUserInfo() { UserID = userID, UserName = name, AccessType = accessType, Location = DomainLocationInfo.Empty, }; }
public void AddUser(Authentication authentication, DomainAccessType accessType) { this.dispatcher.VerifyAccess(); this.CremaHost.DebugMethod(authentication, this, nameof(AddUser), base.DomainInfo.ItemPath, base.DomainInfo.ItemType, accessType); this.ValidateAdd(authentication); this.Sign(authentication); this.domainLogger.Join(authentication, accessType); this.InvokeAddUser(authentication, accessType, out var domainUser); this.users.Add(domainUser); this.domainLogger.Complete(); this.OnUserAdded(new DomainUserEventArgs(authentication, this, domainUser)); this.Container.InvokeDomainUserAddedEvent(authentication, this, domainUser); }
private void Domain_UserRemoved(object sender, DomainUserRemovedEventArgs e) { var domainUserID = e.DomainUserInfo.UserID; var removeInfo = e.RemoveInfo; var userID = e.UserID; if (domainUserID == this.authentication.ID && removeInfo.Reason == RemoveReason.Kick) { this.accessType = DomainAccessType.None; this.Dispatcher.InvokeAsync(async() => { await this.RefreshAsync(); this.OnKicked(e); }); } }