Exemplo n.º 1
0
 public void GetAccessType(ITableCategory category, TaskContext context)
 {
     category.Dispatcher.Invoke(() =>
     {
         category.GetAccessType(context.Authentication);
     });
 }
Exemplo n.º 2
0
        public TableCategoryDescriptor(Authentication authentication, ITableCategory category, DescriptorTypes descriptorTypes, object owner)
            : base(authentication, category, descriptorTypes)
        {
            this.category = category;
            this.owner    = owner ?? this;
            this.category.Dispatcher.VerifyAccess();
            this.categoryName = category.Name;
            this.categoryPath = category.Path;
            this.accessInfo   = category.AccessInfo;
            this.lockInfo     = category.LockInfo;
            this.accessType   = category.GetAccessType(authentication);

            this.tablesReadonly     = new ReadOnlyObservableCollection <TableDescriptor>(this.tables);
            this.categoriesReadonly = new ReadOnlyObservableCollection <TableCategoryDescriptor>(this.categories);

            if (this.descriptorTypes.HasFlag(DescriptorTypes.IsSubscriptable) == true)
            {
                this.category.Renamed       += Category_Renamed;
                this.category.Moved         += Category_Moved;
                this.category.Deleted       += Category_Deleted;
                this.category.AccessChanged += Category_AccessChanged;
                this.category.LockChanged   += Category_LockChanged;
            }

            if (this.descriptorTypes.HasFlag(DescriptorTypes.IsRecursive) == true)
            {
                if (this.descriptorTypes.HasFlag(DescriptorTypes.IsSubscriptable) == true)
                {
                    this.category.Tables.CollectionChanged     += Tables_CollectionChanged;
                    this.category.Categories.CollectionChanged += Categories_CollectionChanged;
                }

                foreach (var item in this.category.Categories)
                {
                    var descriptor = new TableCategoryDescriptor(this.authentication, item, this.descriptorTypes, this.owner);
                    item.ExtendedProperties[this.owner] = descriptor;
                    this.categories.Add(descriptor);
                }

                foreach (var item in this.category.Tables)
                {
                    if (item.Parent != null)
                    {
                        continue;
                    }
                    var descriptor = new TableDescriptor(this.authentication, item, this.descriptorTypes, this.owner);
                    item.ExtendedProperties[this.owner] = descriptor;
                    this.tables.Add(descriptor);
                }
            }
        }
Exemplo n.º 3
0
        public async Task AddNewCategoryAsync(ITableCategory category, TaskContext context)
        {
            var authentication = context.Authentication;
            var categoryNanme  = RandomUtility.NextIdentifier();

            if (context.AllowException == false)
            {
                if (category.GetAccessType(authentication) < AccessType.Master)
                {
                    return;
                }
            }
            await category.AddNewCategoryAsync(authentication, categoryNanme);
        }
 public void GetAccessType()
 {
     category.GetAccessType(authentication);
 }
Exemplo n.º 5
0
 public async Task GetAccessTypeAsync(ITableCategory category, TaskContext context)
 {
     var authentication = context.Authentication;
     await category.Dispatcher.InvokeAsync(() => category.GetAccessType(authentication));
 }