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

            return(true);
        }
Example #2
0
        public void InvokeTypeItemSetPrivate(Authentication authentication, ITypeItem typeItem, AccessInfo accessInfo)
        {
            this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTypeItemSetPrivate), typeItem);
            var accessInfoPath = typeItem.GetAccessInfoPath();

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