public void SetLockInfo(LockChangeType changeType, LockInfo lockInfo) { if (changeType == LockChangeType.Lock) { base.LockInfo = lockInfo; } else { base.LockInfo = LockInfo.Empty; } }
public static object[] Build(object[] items, LockChangeType changeType, string[] comments) { return(new object[] { changeType, comments }); }
public static object[] Build(object[] items, LockChangeType changeType) { return(Build(items, changeType, items.Select(item => string.Empty).ToArray())); }
void IDataBaseCollectionServiceCallback.OnDataBasesLockChanged(SignatureDate signatureDate, LockChangeType changeType, LockInfo[] lockInfos, string[] comments) { throw new NotImplementedException(); }
void IDataBaseCollectionServiceCallback.OnDataBasesLockChanged(SignatureDate signatureDate, LockChangeType changeType, LockInfo[] lockInfos, string[] comments) { this.InvokeAsync(() => { var authentication = this.userContext.Authenticate(signatureDate); var dataBases = new DataBase[lockInfos.Length]; for (var i = 0; i < lockInfos.Length; i++) { var lockInfo = lockInfos[i]; var dataBase = this[lockInfo.Path]; dataBase.SetLockInfo(changeType, lockInfo); dataBases[i] = dataBase; } switch (changeType) { case LockChangeType.Lock: this.InvokeItemsLockedEvent(authentication, dataBases, comments); break; case LockChangeType.Unlock: this.InvokeItemsUnlockedEvent(authentication, dataBases); break; } }, nameof(IDataBaseCollectionServiceCallback.OnDataBasesLockChanged)); }
async void IDataBaseContextEventCallback.OnDataBasesLockChanged(CallbackInfo callbackInfo, LockChangeType changeType, LockInfo[] lockInfos, string[] comments) { try { await this.callbackEvent.InvokeAsync(callbackInfo.Index, () => { this.Dispatcher.Invoke(() => { var authentication = this.UserContext.Authenticate(callbackInfo.SignatureDate); var dataBases = new DataBase[lockInfos.Length]; for (var i = 0; i < lockInfos.Length; i++) { var lockInfo = lockInfos[i]; var dataBase = this[lockInfo.Path]; if (changeType == LockChangeType.Unlock) { lockInfo.Path = string.Empty; } dataBase.SetLockInfo(lockInfo); dataBases[i] = dataBase; } switch (changeType) { case LockChangeType.Lock: this.InvokeItemsLockedEvent(authentication, dataBases, comments); break; case LockChangeType.Unlock: this.InvokeItemsUnlockedEvent(authentication, dataBases); break; } }); }); } catch (Exception e) { this.CremaHost.Error(e); } }