Exemple #1
0
 public ResultBase SetUserLocation(Guid domainID, DomainLocationInfo location)
 {
     return(this.Invoke(domainID, (domain) =>
     {
         domain.SetUserLocation(this.authentication, location);
     }));
 }
Exemple #2
0
 private void InvokeBeginUserEdit(Authentication authentication, DomainLocationInfo location, out DomainUser domainUser)
 {
     domainUser = this.GetDomainUser(authentication);
     this.OnBeginUserEdit(domainUser, location);
     domainUser.Location      = location;
     domainUser.IsBeingEdited = true;
 }
Exemple #3
0
 public ResultBase BeginUserEdit(Guid domainID, DomainLocationInfo location)
 {
     return(this.Invoke(domainID, (domain) =>
     {
         domain.BeginUserEdit(this.authentication, location);
     }));
 }
Exemple #4
0
        private void ValidateBeginUserEdit(Authentication authentication, DomainLocationInfo location)
        {
            var domainUser = this.GetDomainUser(authentication);

            if (domainUser.CanWrite == false)
            {
                throw new PermissionDeniedException();
            }
        }
Exemple #5
0
 public void SetUserLocation(Authentication authentication, DomainLocationInfo location)
 {
     this.dispatcher.VerifyAccess();
     this.CremaHost.DebugMethod(authentication, this, nameof(SetUserLocation), base.DomainInfo.ItemPath, base.DomainInfo.ItemType);
     this.ValidateSetLocation(authentication, location);
     this.Sign(authentication);
     this.InvokeSetUserLocation(authentication, location, out var domainUser);
     this.OnUserChanged(new DomainUserEventArgs(authentication, this, domainUser));
     this.Container.InvokeDomainUserChangedEvent(authentication, this, domainUser);
 }
Exemple #6
0
 public void BeginUserEdit(Authentication authentication, DomainLocationInfo location)
 {
     this.dispatcher.VerifyAccess();
     this.CremaHost.DebugMethod(authentication, this, nameof(BeginUserEdit), base.DomainInfo.ItemPath, base.DomainInfo.ItemType);
     var result = this.Service.BeginUserEdit(this.ID, location);
     this.Sign(authentication, result);
     this.InvokeBeginUserEdit(authentication, location, out var domainUser);
     this.OnUserChanged(new DomainUserEventArgs(authentication, this, domainUser));
     this.Container.InvokeDomainUserChangedEvent(authentication, this, domainUser);
 }
        public static Task BeginEditAsync(this IDomain domain, Authentication authentication, object item, string fieldName)
        {
            var location = new DomainLocationInfo()
            {
                TableName  = CremaDataRowUtility.GetTableName(item),
                Keys       = CremaDataRowUtility.GetKeys(item),
                ColumnName = fieldName,
            };

            return(domain.BeginMemberEditAsync(authentication, location));
        }
Exemple #8
0
        public static void SetLocation(this IDomain domain, Authentication authentication, object item, string fieldName)
        {
            var location = new DomainLocationInfo()
            {
                TableName  = CremaDataRowUtility.GetTableName(item),
                Keys       = CremaDataRowUtility.GetKeys(item),
                ColumnName = fieldName,
            };

            domain.SetUserLocation(authentication, location);
        }
        public void Set(DomainMemberInfo item, DomainMemberState domainMemberState, DomainLocationInfo domainLocationInfo)
        {
            for (var i = 0; i < this.Count; i++)
            {
                if (this[i].ID == item.ID)
                {
                    this[i] = new DomainDataMember(item, domainMemberState, domainLocationInfo);
                    return;
                }
            }

            this.Add(new DomainDataMember(item, domainMemberState, domainLocationInfo));
        }
Exemple #10
0
 public void BeginUserEdit(Authentication authentication, DomainLocationInfo location)
 {
     try
     {
         this.dispatcher.VerifyAccess();
         this.CremaHost.DebugMethod(authentication, this, nameof(BeginUserEdit), base.DomainInfo.ItemPath, base.DomainInfo.ItemType);
         this.ValidateBeginUserEdit(authentication, location);
         this.Sign(authentication);
         this.InvokeBeginUserEdit(authentication, location, out var domainUser);
         this.OnUserChanged(new DomainUserEventArgs(authentication, this, domainUser));
         this.Container.InvokeDomainUserChangedEvent(authentication, this, domainUser);
     }
     catch (Exception e)
     {
         this.CremaHost.Error(e);
         throw;
     }
 }
Exemple #11
0
 private void ValidateSetLocation(Authentication authentication, DomainLocationInfo location)
 {
     var domainUser = this.GetDomainUser(authentication);
 }
Exemple #12
0
 protected virtual void OnBeginUserEdit(DomainUser domainUser, DomainLocationInfo location)
 {
 }
Exemple #13
0
 protected virtual void OnSetLocation(DomainUser domainUser, DomainLocationInfo location)
 {
 }
Exemple #14
0
 async void IDomainContextEventCallback.OnUserEditBegun(CallbackInfo callbackInfo, Guid domainID, DomainLocationInfo domainLocationInfo, Guid taskID)
 {
     try
     {
         await this.callbackEvent.InvokeAsync(callbackInfo.Index, () =>
         {
             this.Dispatcher.Invoke(() =>
             {
                 var authentication = this.UserContext.Authenticate(callbackInfo.SignatureDate);
                 var domain         = this.GetDomain(domainID);
                 var domainMember   = domain.GetDomainMember(authentication);
                 domain.InvokeMemberEditBegunAsync(authentication, domainMember, domainLocationInfo, taskID);
             });
         });
     }
     catch (Exception e)
     {
         this.CremaHost.Error(e);
     }
 }
Exemple #15
0
 public void BeginEdit(Authentication authentication, DomainLocationInfo location)
 {
     this.domain.BeginUserEdit(authentication, location);
 }
Exemple #16
0
 public Task BeginEditAsync(Authentication authentication, DomainLocationInfo location)
 {
     return(this.domain.BeginUserEditAsync(authentication, location));
 }
        public async Task <ResultBase> SetUserLocationAsync(Guid authenticationToken, Guid domainID, DomainLocationInfo location)
        {
            var authentication = await this.CremaHost.AuthenticateAsync(authenticationToken);

            var result = new ResultBase();
            var domain = await this.GetDomainAsync(domainID);

            await domain.SetUserLocationAsync(authentication, location);

            result.SignatureDate = authentication.SignatureDate;
            return(result);
        }
Exemple #18
0
 public Task SetLocationAsync(Authentication authentication, DomainLocationInfo location)
 {
     return(this.domain.SetUserLocationAsync(authentication, location));
 }
Exemple #19
0
 public DomainDataMember(DomainMemberInfo domainMemberInfo, DomainMemberState domainMemberState, DomainLocationInfo domainLocationInfo)
 {
     this.ID            = domainMemberInfo.ID;
     this.Name          = domainMemberInfo.Name;
     this.Location      = domainLocationInfo;
     this.IsBeingEdited = domainMemberState.HasFlag(DomainMemberState.IsBeingEdited);
     this.Background    = new SolidColorBrush(domainMemberInfo.GetColor());
 }
Exemple #20
0
 public void SetLocation(Authentication authentication, DomainLocationInfo location)
 {
     this.domain.SetUserLocation(authentication, location);
 }
Exemple #21
0
 private void InvokeSetUserLocation(Authentication authentication, DomainLocationInfo location, out DomainUser domainUser)
 {
     domainUser = this.GetDomainUser(authentication);
     this.OnSetLocation(domainUser, location);
     domainUser.Location = location;
 }