예제 #1
0
        private bool PredicateFunc(ITableItem tableItem)
        {
            if (this.Type != null && this.Type.IsAssignableFrom(tableItem.GetType()) == false)
            {
                return(false);
            }
            if (this.HasParent == true && tableItem.Parent == null)
            {
                return(false);
            }
            if (this.HasChilds == true && tableItem.Childs.Any() == false)
            {
                return(false);
            }
            if (this.IsLeaf == true && tableItem.Childs.Any() == true)
            {
                return(false);
            }
            if (this.TargetToMove != null && CanMove(this.TargetToMove, tableItem.Path) == false)
            {
                return(false);
            }
            if (this.ExcludedItems != null && this.ExcludedItems.Contains(tableItem) == true)
            {
                return(false);
            }
            if (this.Predicate != null && this.Predicate(tableItem) == false)
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        public void InvokeTableItemSetPrivate(Authentication authentication, ITableItem tableItem, AccessInfo accessInfo)
        {
            this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTableItemSetPrivate), tableItem);
            var accessInfoPath = tableItem.GetAccessInfoPath();

            try
            {
                accessInfo.SetPrivate(tableItem.GetType().Name, authentication.SignatureDate);
                tableItem.WriteAccessInfo(accessInfoPath, accessInfo);
                this.repository.Add(accessInfoPath);
            }
            catch (Exception e)
            {
                this.CremaHost.Error(e);
                this.repository.Revert();
                throw e;
            }
        }