Пример #1
0
        //[TaskMethod(Weight = 10)]
        public async Task RemoveAccessMemberAsync(ITableCategory category, TaskContext context)
        {
            var authentication = context.Authentication;

            if (category.Parent == null)
            {
                return;
            }
            var userContext = category.GetService(typeof(IUserContext)) as IUserContext;
            var memberID    = await userContext.Dispatcher.InvokeAsync(() => userContext.Select(item => item.Path).Random());

            if (NameValidator.VerifyItemPath(memberID) == true)
            {
                await category.RemoveAccessMemberAsync(authentication, new ItemName(memberID).Name);
            }
            else
            {
                await category.RemoveAccessMemberAsync(authentication, memberID);
            }
        }