예제 #1
0
        public void SetHidden(string path, bool isHidden)
        {
            if (_sharpCifsFileSystem.IsEnabledForPath(path))
            {
                _sharpCifsFileSystem.SetHidden(path, isHidden);
                return;
            }

            var info = GetFileInfo(path);

            if (info.Exists && info.IsHidden != isHidden)
            {
                if (isHidden)
                {
                    File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
                }
                else
                {
                    FileAttributes attributes = File.GetAttributes(path);
                    attributes = RemoveAttribute(attributes, FileAttributes.Hidden);
                    File.SetAttributes(path, attributes);
                }
            }
        }