示例#1
0
        public void InvokeItemsUnlockedEvent(Authentication authentication, ITypeItem[] items)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsUnlockedEvent), items);
            var comment  = EventMessageBuilder.UnlockTypeItem(authentication, items);
            var metaData = EventMetaDataBuilder.Build(items, LockChangeType.Unlock);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.OnItemsLockChanged(new ItemsEventArgs <ITypeItem>(authentication, items, metaData));
        }
示例#2
0
        public void InvokeItemsSetPublicEvent(Authentication authentication, ITableItem[] items)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsSetPublicEvent), items);
            var message  = EventMessageBuilder.SetPublicTableItem(authentication, items);
            var metaData = EventMetaDataBuilder.Build(items, AccessChangeType.Public);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnItemsAccessChanged(new ItemsEventArgs <ITableItem>(authentication, items, metaData));
        }
示例#3
0
        public void InvokeItemsLockedEvent(Authentication authentication, ITableItem[] items, string[] comments)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsLockedEvent), items, comments);
            var message  = EventMessageBuilder.LockTableItem(authentication, items, comments);
            var metaData = EventMetaDataBuilder.Build(items, LockChangeType.Lock, comments);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnItemsLockChanged(new ItemsEventArgs <ITableItem>(authentication, items, metaData));
        }
示例#4
0
        public void InvokeTablesContentChangedEvent(Authentication authentication, Table[] tables)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesContentChangedEvent), tables);
            var message  = EventMessageBuilder.ChangeTableContent(authentication, tables);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnTablesChanged(new ItemsChangedEventArgs <ITable>(authentication, tables, null, DomainItemType.TableContent));
            this.Context.InvokeItemsChangedEvent(authentication, tables);
        }
示例#5
0
        public void InvokeTablesDeletedEvent(Authentication authentication, Table[] tables, string[] oldPaths)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesDeletedEvent), oldPaths);
            var message  = EventMessageBuilder.DeleteTable(authentication, tables);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnTablesDeleted(new ItemsDeletedEventArgs <ITable>(authentication, tables, oldPaths));
            this.Context.InvokeItemsDeleteEvent(authentication, tables, oldPaths);
        }
示例#6
0
        public void InvokeItemsUnlockedEvent(Authentication authentication, IDataBase[] items)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsUnlockedEvent), items);
            var comment  = EventMessageBuilder.UnlockDataBase(authentication, items);
            var metaData = new object[] { LockChangeType.Unlock, new string[] { string.Empty, }, };

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.OnItemsLockChanged(new ItemsEventArgs <IDataBase>(authentication, items, metaData));
        }
示例#7
0
        public void InvokeTypesCreatedEvent(Authentication authentication, Type[] types, CremaDataSet dataSet)
        {
            var args     = types.Select(item => (object)item.TypeInfo).ToArray();
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTypesCreatedEvent), types);
            var message  = EventMessageBuilder.CreateType(authentication, types);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnTypesCreated(new ItemsCreatedEventArgs <IType>(authentication, types, args, dataSet));
            this.Context.InvokeItemsCreatedEvent(authentication, types, args, dataSet);
        }
示例#8
0
        public void InvokeCategoriesRenamedEvent(Authentication authentication, TypeCategory[] categories, string[] oldNames, string[] oldPaths, CremaDataSet dataSet)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeCategoriesRenamedEvent), categories, oldNames, oldPaths);
            var comment  = EventMessageBuilder.RenameTypeCategory(authentication, categories, oldNames);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnCategoriesRenamed(new ItemsRenamedEventArgs <ITypeCategory>(authentication, categories, oldNames, oldPaths, dataSet));
            this.Context.InvokeItemsRenamedEvent(authentication, categories, oldNames, oldPaths, dataSet);
        }
        public void InvokeCategoriesDeletedEvent(Authentication authentication, TableCategory[] categories, string[] categoryPaths)
        {
            var dataSet  = CremaDataSet.Create(new SignatureDateProvider(authentication.ID));
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeCategoriesDeletedEvent), categoryPaths);
            var message  = EventMessageBuilder.DeleteTableCategory(authentication, categories);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnCategoriesDeleted(new ItemsDeletedEventArgs <ITableCategory>(authentication, categories, categoryPaths, dataSet));
            this.Context.InvokeItemsDeletedEvent(authentication, categories, categoryPaths, dataSet);
        }
示例#10
0
        public void InvokeTablesRenamedEvent(Authentication authentication, Table[] tables, string[] oldNames, string[] oldPaths)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesRenamedEvent), tables, oldNames, oldPaths);
            var comment  = EventMessageBuilder.RenameTable(authentication, tables, oldNames);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.UpdateRevision(tables);
            this.OnTablesRenamed(new ItemsRenamedEventArgs <ITable>(authentication, tables, oldNames, oldPaths));
            this.Context.InvokeItemsRenamedEvent(authentication, tables, oldNames, oldPaths);
        }
示例#11
0
        public void InvokeItemsSetAccessMemberEvent(Authentication authentication, IDataBase[] items, string[] memberIDs, AccessType[] accessTypes)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsSetAccessMemberEvent), items, memberIDs, accessTypes);
            var comment  = EventMessageBuilder.SetAccessMemberOfDataBase(authentication, items, memberIDs, accessTypes);
            var metaData = new object[] { AccessChangeType.Set, memberIDs, accessTypes, };

            this.CremaHost.Debug(eventLog);
            //this.repository.Commit(accessInfoPath, comment, authentication, eventLog);
            this.CremaHost.Info(comment);
            this.OnItemsAccessChanged(new ItemsEventArgs <IDataBase>(authentication, items, metaData));
        }
示例#12
0
        public void InvokeItemsSetPrivateEvent(Authentication authentication, IDataBase[] items)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsSetPrivateEvent), items);
            var comment  = EventMessageBuilder.SetPrivateDataBase(authentication, items);
            var metaData = new object[] { AccessChangeType.Private, new string[] { string.Empty, }, new AccessType[] { AccessType.None, }, };

            this.CremaHost.Debug(eventLog);
            //this.repository.Commit(accessInfoPath, comment, authentication, eventLog);
            this.CremaHost.Info(comment);
            this.OnItemsAccessChanged(new ItemsEventArgs <IDataBase>(authentication, items, metaData));
        }
示例#13
0
        public void InvokeCategoriesDeletedEvent(Authentication authentication, UserCategory[] categories, string[] categoryPaths)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeCategoriesDeletedEvent), categoryPaths);
            var comment  = EventMessageBuilder.DeleteUserCategory(authentication, categories);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnCategoriesDeleted(new ItemsDeletedEventArgs <IUserCategory>(authentication, categories, categoryPaths));
            this.Context.InvokeItemsDeleteEvent(authentication, categories, categoryPaths);
        }
示例#14
0
        public void InvokeTypesDeletedEvent(Authentication authentication, Type[] types, string[] oldPaths)
        {
            var dataSet  = CremaDataSet.Create(new SignatureDateProvider(authentication.ID));
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTypesDeletedEvent), oldPaths);
            var message  = EventMessageBuilder.DeleteType(authentication, types);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnTypesDeleted(new ItemsDeletedEventArgs <IType>(authentication, types, oldPaths));
            this.Context.InvokeItemsDeleteEvent(authentication, types, oldPaths, dataSet);
        }
示例#15
0
        public void InvokeUsersUnbannedEvent(Authentication authentication, User[] users)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeUsersUnbannedEvent), users);
            var comment  = EventMessageBuilder.UnbanUser(authentication, users);
            var metaData = EventMetaDataBuilder.Build(users, BanChangeType.Unban);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.OnUsersBanChanged(new ItemsEventArgs <IUser>(authentication, users, metaData));
            this.Context.InvokeItemsChangedEvent(authentication, users);
        }
示例#16
0
        public void InvokeUsersCreatedEvent(Authentication authentication, User[] users)
        {
            var args     = users.Select(item => (object)item.UserInfo).ToArray();
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeUsersCreatedEvent), users);
            var comment  = EventMessageBuilder.CreateUser(authentication, users);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.OnUsersCreated(new ItemsCreatedEventArgs <IUser>(authentication, users, args));
            this.Context.InvokeItemsCreatedEvent(authentication, users, args);
        }
示例#17
0
        public void InvokeItemsRemoveAccessMemberEvent(Authentication authentication, ITableItem[] items, string[] memberIDs)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsRemoveAccessMemberEvent), items, memberIDs);
            var comment  = EventMessageBuilder.RemoveAccessMemberFromTableItem(authentication, items, memberIDs);
            var metaData = EventMetaDataBuilder.Build(items, AccessChangeType.Remove, memberIDs);

            this.CremaHost.Debug(eventLog);
            this.repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnItemsAccessChanged(new ItemsEventArgs <ITableItem>(authentication, items, metaData));
        }
示例#18
0
        public void InvokeTablesCreatedEvent(Authentication authentication, Table[] tables)
        {
            var args     = tables.Select(item => (object)item.TableInfo).ToArray();
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesCreatedEvent), tables);
            var comment  = EventMessageBuilder.CreateTable(authentication, tables);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.OnTablesCreated(new ItemsCreatedEventArgs <ITable>(authentication, tables, args));
            this.Context.InvokeItemsCreatedEvent(authentication, tables, args);
        }
示例#19
0
        public void InvokeCategoriesCreatedEvent(Authentication authentication, TypeCategory[] categories)
        {
            var args     = categories.Select(item => (object)null).ToArray();
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeCategoriesCreatedEvent), categories);
            var message  = EventMessageBuilder.CreateTypeCategory(authentication, categories);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(message);
            this.OnCategoriesCreated(new ItemsCreatedEventArgs <ITypeCategory>(authentication, categories, args));
            this.Context.InvokeItemsCreatedEvent(authentication, categories, args);
        }
示例#20
0
        public void InvokeUsersDeletedEvent(Authentication authentication, User[] users, string[] itemPaths)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeUsersDeletedEvent), itemPaths);
            var comment  = EventMessageBuilder.DeleteUser(authentication, users);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnUsersDeleted(new ItemsDeletedEventArgs <IUser>(authentication, users, itemPaths));
            this.Context.InvokeItemsDeleteEvent(authentication, users, itemPaths);
        }
示例#21
0
        public void InvokeUsersChangedEvent(Authentication authentication, User[] users)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeUsersChangedEvent), users);
            var comment  = EventMessageBuilder.ChangeUserInfo(authentication, users);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnUsersChanged(new ItemsEventArgs <IUser>(authentication, users));
            this.Context.InvokeItemsChangedEvent(authentication, users);
        }
示例#22
0
        public void InvokeTypesDeletedEvent(Authentication authentication, Type[] types, string[] oldPaths, CremaDataSet dataSet)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTypesDeletedEvent), oldPaths);
            var comment  = EventMessageBuilder.DeleteType(authentication, types);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnTypesDeleted(new ItemsDeletedEventArgs <IType>(authentication, types, oldPaths));
            this.Context.InvokeItemsDeleteEvent(authentication, types, oldPaths, dataSet);
        }
示例#23
0
        public void InvokeTablesContentChangedEvent(Authentication authentication, TableContent content, Table[] tables, CremaDataSet dataSet)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesContentChangedEvent), tables);
            var comment  = EventMessageBuilder.ChangeTableContent(authentication, tables);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnTablesChanged(new ItemsEventArgs <ITable>(authentication, tables));
            this.Context.InvokeItemsChangedEvent(authentication, tables, dataSet);
        }
示例#24
0
        public void InvokeTablesMovedEvent(Authentication authentication, Table[] tables, string[] oldPaths, string[] oldCategoryPaths, CremaDataSet dataSet)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesMovedEvent), tables, oldPaths, oldCategoryPaths);
            var comment  = EventMessageBuilder.MoveTable(authentication, tables, oldCategoryPaths);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnTablesMoved(new ItemsMovedEventArgs <ITable>(authentication, tables, oldPaths, oldCategoryPaths, dataSet));
            this.Context.InvokeItemsMovedEvent(authentication, tables, oldPaths, oldCategoryPaths, dataSet);
        }
示例#25
0
        public void InvokeTypesChangedEvent(Authentication authentication, Type[] types)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTypesChangedEvent), types);
            var comment  = EventMessageBuilder.ChangeTypeTemplate(authentication, types);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.UpdateRevision(types);
            this.OnTypesChanged(new ItemsEventArgs <IType>(authentication, types));
            this.Context.InvokeItemsChangedEvent(authentication, types);
        }
示例#26
0
        public void InvokeTypesMovedEvent(Authentication authentication, Type[] types, string[] oldPaths, string[] oldCategoryPaths)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTypesMovedEvent), types, oldPaths, oldCategoryPaths);
            var comment  = EventMessageBuilder.MoveType(authentication, types, oldCategoryPaths);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.UpdateRevision(types);
            this.OnTypesMoved(new ItemsMovedEventArgs <IType>(authentication, types, oldPaths, oldCategoryPaths));
            this.Context.InvokeItemsMovedEvent(authentication, types, oldPaths, oldCategoryPaths);
        }
示例#27
0
        public void InvokeItemsRemoveAccessMemberEvent(Authentication authentication, string basePath, IDataBase[] items, string[] memberIDs)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsRemoveAccessMemberEvent), items, memberIDs);
            var comment  = EventMessageBuilder.RemoveAccessMemberFromDataBase(authentication, items, memberIDs);
            var metaData = EventMetaDataBuilder.Build(items, AccessChangeType.Remove, memberIDs);

            this.CremaHost.Debug(eventLog);
            this.repository.Commit(basePath, comment, authentication, eventLog);
            this.CremaHost.Info(comment);
            this.OnItemsAccessChanged(new ItemsEventArgs <IDataBase>(authentication, items, new object[] { AccessChangeType.Remove, memberIDs, }));
        }
示例#28
0
        public void InvokeItemsSetPrivateEvent(Authentication authentication, string basePath, IDataBase[] items)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeItemsSetPrivateEvent), items);
            var comment  = EventMessageBuilder.SetPrivateDataBase(authentication, items);
            var metaData = EventMetaDataBuilder.Build(items, AccessChangeType.Private);

            this.CremaHost.Debug(eventLog);
            this.repository.Commit(basePath, comment, authentication, eventLog);
            this.CremaHost.Info(comment);
            this.OnItemsAccessChanged(new ItemsEventArgs <IDataBase>(authentication, items, metaData));
        }
示例#29
0
        public void InvokeTablesDeletedEvent(Authentication authentication, Table[] tables, string[] oldPaths)
        {
            var dataSet  = CremaDataSet.Create(new SignatureDateProvider(authentication.ID));
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesDeletedEvent), oldPaths);
            var comment  = EventMessageBuilder.DeleteTable(authentication, tables);

            this.CremaHost.Debug(eventLog);
            this.Repository.Commit(authentication, comment, eventLog);
            this.CremaHost.Info(comment);
            this.OnTablesDeleted(new ItemsDeletedEventArgs <ITable>(authentication, tables, oldPaths, dataSet));
            this.Context.InvokeItemsDeletedEvent(authentication, tables, oldPaths, dataSet);
        }
示例#30
0
        public void InvokeTablesContentChangedEvent(Authentication authentication, TableContent content, Table[] tables)
        {
            var eventLog = EventLogBuilder.BuildMany(authentication, this, nameof(InvokeTablesContentChangedEvent), tables);
            var comment  = EventMessageBuilder.ChangeTableContent(authentication, tables);

            this.CremaHost.Debug(eventLog);
            this.CremaHost.Info(comment);
            this.UpdateRevision(tables);
            this.UpdateTableDetailInfo(tables);
            this.OnTablesChanged(new ItemsEventArgs <ITable>(authentication, tables));
            this.Context.InvokeItemsChangedEvent(authentication, tables);
        }