public void SetAttributes(string name, ICSharpCode.SharpZipLib.VirtualFileSystem.FileAttributes attributes)
 {
     System.IO.FileAttributes attrs = 0;
     if (attributes.HasFlag(ICSharpCode.SharpZipLib.VirtualFileSystem.FileAttributes.Normal))
     {
         attrs |= System.IO.FileAttributes.Normal;
     }
     if (attributes.HasFlag(ICSharpCode.SharpZipLib.VirtualFileSystem.FileAttributes.ReadOnly))
     {
         attrs |= System.IO.FileAttributes.ReadOnly;
     }
     if (attributes.HasFlag(ICSharpCode.SharpZipLib.VirtualFileSystem.FileAttributes.Hidden))
     {
         attrs |= System.IO.FileAttributes.Hidden;
     }
     if (attributes.HasFlag(ICSharpCode.SharpZipLib.VirtualFileSystem.FileAttributes.Directory))
     {
         attrs |= System.IO.FileAttributes.Directory;
     }
     if (attributes.HasFlag(ICSharpCode.SharpZipLib.VirtualFileSystem.FileAttributes.Archive))
     {
         attrs |= System.IO.FileAttributes.Archive;
     }
     File.SetAttributes(name, attrs);
 }
예제 #2
0
 public void SetAttributes(string name, VFileAttributes attributes)
 {
     System.IO.FileAttributes attrs = 0;
     if (attributes.HasFlag(VFileAttributes.Normal))
     {
         attrs |= System.IO.FileAttributes.Normal;
     }
     if (attributes.HasFlag(VFileAttributes.ReadOnly))
     {
         attrs |= System.IO.FileAttributes.ReadOnly;
     }
     if (attributes.HasFlag(VFileAttributes.Hidden))
     {
         attrs |= System.IO.FileAttributes.Hidden;
     }
     if (attributes.HasFlag(VFileAttributes.Directory))
     {
         attrs |= System.IO.FileAttributes.Directory;
     }
     if (attributes.HasFlag(VFileAttributes.Archive))
     {
         attrs |= System.IO.FileAttributes.Archive;
     }
     File.SetAttributes(name, attrs);
 }