Example #1
0
 public void InvokeTypeItemMove(Authentication authentication, ITypeItem typeItem, string newCategoryPath)
 {
     if (typeItem.AccessInfo.Path == typeItem.Path)
     {
         var accessInfoPath1 = typeItem.GetAccessInfoPath();
         var accessInfoPath2 = typeItem.GetAccessInfoPath(newCategoryPath);
         if (File.Exists(accessInfoPath1) == true)
         {
             this.repository.Move(accessInfoPath1, accessInfoPath2);
         }
     }
 }
Example #2
0
 public void InvokeTypeItemDelete(Authentication authentication, ITypeItem typeItem)
 {
     if (typeItem.AccessInfo.Path == typeItem.Path)
     {
         var accessInfoPath = typeItem.GetAccessInfoPath();
         if (File.Exists(accessInfoPath) == true)
         {
             this.repository.Delete(accessInfoPath);
         }
     }
 }
Example #3
0
 public void InvokeTypeItemRename(Authentication authentication, ITypeItem typeItem, string newName)
 {
     if (typeItem.AccessInfo.Path == typeItem.Path)
     {
         var accessInfoPath1 = typeItem.GetAccessInfoPath();
         var directoryName   = Path.GetDirectoryName(accessInfoPath1);
         var extension       = Path.GetExtension(accessInfoPath1);
         var accessInfoPath2 = Path.Combine(directoryName, newName + extension);
         if (File.Exists(accessInfoPath1) == true && accessInfoPath1 != accessInfoPath2)
         {
             this.repository.Move(accessInfoPath1, accessInfoPath2);
         }
     }
 }
Example #4
0
        public void InvokeTypeItemSetPublic(Authentication authentication, ITypeItem typeItem, AccessInfo accessInfo)
        {
            this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTypeItemSetPrivate), typeItem);
            var accessInfoPath = typeItem.GetAccessInfoPath();

            try
            {
                accessInfo.SetPublic();
                this.repository.Delete(accessInfoPath);
            }
            catch (Exception e)
            {
                this.CremaHost.Error(e);
                this.repository.Revert();
                throw e;
            }
        }
Example #5
0
        public void InvokeTypeItemRemoveAccessMember(Authentication authentication, ITypeItem typeItem, AccessInfo accessInfo, string memberID)
        {
            this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTypeItemRemoveAccessMember), typeItem, memberID);
            var accessInfoPath = typeItem.GetAccessInfoPath();

            try
            {
                accessInfo.Remove(authentication.SignatureDate, memberID);
                typeItem.WriteAccessInfo(accessInfoPath, accessInfo);
            }
            catch (Exception e)
            {
                this.CremaHost.Error(e);
                this.repository.Revert();
                throw e;
            }
        }
Example #6
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;
            }
        }