public void InvokeUserAdded(Authentication authentication, DomainUserInfo domainUserInfo, DomainUserState domainUserState) { this.dispatcher.VerifyAccess(); var domainUser = new DomainUser(this, domainUserInfo, domainUserState); this.users.Add(domainUser); if (domainUser.IsOwner == true) { this.users.Owner = domainUser; } this.OnUserAdded(new DomainUserEventArgs(authentication, this, domainUser)); this.Container.InvokeDomainUserAddedEvent(authentication, this, domainUser); }
protected override void OnRemoveRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDate signatureDate) { foreach (var item in rows.Reverse()) { var view = this.views[item.TableName]; if (DomainRowInfo.ClearKey.SequenceEqual(item.Keys) == true) { view.Table.Clear(); } else { CremaDomainUtility.Delete(view, item.Keys); } this.tables[view].ContentsInfo = signatureDate; } this.dataSet.AcceptChanges(); }
protected override void OnSetRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDate signatureDate) { this.dataType.BeginLoadData(); try { foreach (var item in rows) { CremaDomainUtility.SetFieldsForce(this.view, item.Keys, item.Fields); } } finally { this.dataType.EndLoadData(); } this.dataType.ModificationInfo = signatureDate; this.dataType.AcceptChanges(); }
protected override void OnSetRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDate signatureDate) { this.dataSet.BeginLoad(); try { foreach (var item in rows) { var view = this.views[item.TableName]; CremaDomainUtility.SetFieldsForce(view, item.Keys, item.Fields); this.tables[view].ContentsInfo = signatureDate; } } finally { this.dataSet.EndLoad(); } this.dataSet.AcceptChanges(); }
protected override void OnRemoveRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDateProvider signatureProvider) { this.dataType.SignatureDateProvider = signatureProvider; try { foreach (var item in rows) { CremaDomainUtility.Delete(this.view, item.Keys); } this.dataType.AcceptChanges(); } catch (Exception e) { this.dataType.RejectChanges(); throw e; } }
protected override DomainRowInfo[] OnSetRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDateProvider signatureProvider) { this.dataType.SignatureDateProvider = signatureProvider; try { for (int i = 0; i < rows.Length; i++) { rows[i].Fields = CremaDomainUtility.SetFields(this.view, rows[i].Keys, rows[i].Fields); } this.dataType.AcceptChanges(); return(rows); } catch (Exception e) { this.dataType.RejectChanges(); throw e; } }
protected override DomainRowInfo[] OnSetRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDateProvider signatureProvider) { this.dataSet.SignatureDateProvider = signatureProvider; try { for (var i = 0; i < rows.Length; i++) { var view = this.views[rows[i].TableName]; rows[i].Fields = CremaDomainUtility.SetFields(view, rows[i].Keys, rows[i].Fields); } this.dataSet.AcceptChanges(); return(rows); } catch (Exception e) { this.CremaHost.Error(e); this.dataSet.RejectChanges(); throw e; } }
protected override DomainRowInfo[] OnNewRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDateProvider signatureProvider) { this.dataType.SignatureDateProvider = signatureProvider; try { for (int i = 0; i < rows.Length; i++) { var rowView = CremaDomainUtility.AddNew(this.view, rows[i].Fields); rows[i].Keys = CremaDomainUtility.GetKeys(rowView); rows[i].Fields = CremaDomainUtility.GetFields(rowView); } this.dataType.AcceptChanges(); return(rows); } catch (Exception e) { this.CremaHost.Error(e); this.dataType.RejectChanges(); throw e; } }
protected override void OnSetProperty(DomainUser domainUser, string propertyName, object value, SignatureDateProvider signatureProvider) { if (propertyName == "TableName") { if (this.IsNew == false) { throw new InvalidOperationException(Resources.Exception_CannotRename); } this.template.TableName = (string)value; } else if (propertyName == "Comment") { this.template.Comment = (string)value; } else if (propertyName == "Tags") { this.template.Tags = (TagInfo)((string)value); } else { throw new NotSupportedException(); } }
protected override void OnSetProperty(DomainUser domainUser, string propertyName, object value, SignatureDateProvider signatureProvider) { if (propertyName == "TableName") { if (this.IsNew == false) { throw new CremaException("테이블 이름은 변경할 수 없습니다."); } this.template.TableName = (string)value; } else if (propertyName == "Comment") { this.template.Comment = (string)value; } else if (propertyName == "Tags") { this.template.Tags = (TagInfo)((string)value); } else { throw new NotSupportedException(); } }
protected virtual void OnRemoveRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDateProvider signatureProvider) { }
protected virtual DomainRowInfo[] OnSetRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDateProvider signatureProvider) { return(rows); }
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; }
private void InvokeKick(Authentication authentication, string userID, string comment, out DomainUser domainUser, out RemoveInfo removeInfo) { removeInfo = new RemoveInfo(RemoveReason.Kick, comment); domainUser = this.users[userID]; }
private void InvokeBeginUserEdit(Authentication authentication, DomainLocationInfo location, out DomainUser domainUser) { domainUser = this.GetDomainUser(authentication); this.OnBeginUserEdit(domainUser, location); domainUser.Location = location; domainUser.IsBeingEdited = true; }
protected virtual void OnBeginUserEdit(DomainUser domainUser, DomainLocationInfo location) { }
public void InvokeDomainUserRemovedEvent(Authentication authentication, Domain domain, DomainUser domainUser, RemoveInfo removeInfo) { var args = new DomainUserRemovedEventArgs(authentication, domain, domainUser, removeInfo); var eventLog = EventLogBuilder.Build(authentication, this, nameof(InvokeDomainUserRemovedEvent), domain, domainUser, removeInfo.Reason, removeInfo.Message); var comment = removeInfo.Reason == RemoveReason.Kick ? EventMessageBuilder.KickDomainUser(authentication, domain, domainUser) : EventMessageBuilder.LeaveDomainUser(authentication, domain); this.Dispatcher.InvokeAsync(() => { this.CremaHost.Debug(eventLog); this.CremaHost.Info(comment); this.OnDomainUserRemoved(args); }); }
public void InvokeDomainUserAddedEvent(Authentication authentication, Domain domain, DomainUser domainUser) { var args = new DomainUserEventArgs(authentication, domain, domainUser); var eventLog = EventLogBuilder.Build(authentication, this, nameof(InvokeDomainUserAddedEvent), domain, domainUser); var comment = EventMessageBuilder.EnterDomainUser(authentication, domain); this.Dispatcher.InvokeAsync(() => { this.CremaHost.Debug(eventLog); this.CremaHost.Info(comment); this.OnDomainUserAdded(args); }); }
protected virtual void OnSetProperty(DomainUser domainUser, string propertyName, object value, SignatureDateProvider signatureProvider) { }
protected virtual void OnSetLocation(DomainUser domainUser, DomainLocationInfo location) { }
public void InvokeDomainUserChangedEvent(Authentication authentication, Domain domain, DomainUser domainUser) { var args = new DomainUserEventArgs(authentication, domain, domainUser); this.Dispatcher.InvokeAsync(() => { this.OnDomainUserChanged(args); }); }
protected virtual void OnEndUserEdit(DomainUser domainUser) { }
private void InvokeKick(Authentication authentication, string userID, string comment, out DomainUser domainUser, out RemoveInfo removeInfo) { removeInfo = new RemoveInfo(RemoveReason.Kick, comment); domainUser = this.users[userID]; if (domainUser.Authentication != null) { domainUser.Authentication.Expired -= Authentication_Expired; domainUser.Authentication = null; } }
private void InvokeEndUserEdit(Authentication authentication, out DomainUser domainUser) { domainUser = this.GetDomainUser(authentication); this.OnEndUserEdit(domainUser); domainUser.IsBeingEdited = false; }
private void InvokeSetOwner(Authentication authentication, string userID, out DomainUser oldOwner, out DomainUser newOwner) { oldOwner = this.users.Owner; newOwner = this.users[userID]; }
private void InvokeSetUserLocation(Authentication authentication, DomainLocationInfo location, out DomainUser domainUser) { domainUser = this.GetDomainUser(authentication); this.OnSetLocation(domainUser, location); domainUser.Location = location; }
protected virtual void OnSetRow(DomainUser domainUser, DomainRowInfo[] rows, SignatureDate signatureDate) { }