Beispiel #1
0
        //public FileSystemFolder(DirectoryInfo directoryInfo, IAdapterItem parent, AdapterBase adapter, bool isDrive)
        //    : base(directoryInfo.Name, parent, adapter, SyncAdapterItemType.Directory)
        //{
        //    this.FileSystemInfo = directoryInfo;

        //    //if (directoryInfo.Attributes.HasFlag(FileAttributes.Hidden) && !isDrive)
        //    //{
        //    //    this.IsHidden = true;
        //    //}
        //}

        //public FileSystemFolder(FileSystemInfo fileInfo, IAdapterItem parent, AdapterBase adapter)
        //    : base(
        //        fileInfo.Name,
        //        parent,
        //        adapter,
        //        fileInfo.Attributes.HasFlag(FileAttributes.Directory) ? SyncAdapterItemType.Directory : SyncAdapterItemType.File)
        //{
        //    this.FileSystemInfo = fileInfo;

        //    //if (fileInfo.Attributes.HasFlag(FileAttributes.Hidden))
        //    //{
        //    //    this.IsHidden = true;
        //    //}
        //}

        //public FileSystemFolder(DirectoryInfo directoryInfo, AdapterBase adapter, bool isDrive)
        //    : base(directoryInfo.Name, null, adapter, SyncAdapterItemType.Directory)
        //{
        //    this.FileSystemInfo = directoryInfo;

        //    //if (directoryInfo.Attributes.HasFlag(FileAttributes.Hidden) && !isDrive)
        //    //{
        //    //    this.IsHidden = true;
        //    //}

        //    //this.DisplayName = displayName;
        //}

        public static string GetUniqueIdForFileSystemInfo(FileSystemInfo fileInfo)
        {
            if (fileInfo.Attributes.HasFlag(FileAttributes.Directory))
            {
                return(Convert.ToBase64String(NativeMethodHelpers.GetDirectoryObjectId(fileInfo.FullName)));
            }

            return(Convert.ToBase64String(NativeMethodHelpers.GetFileObjectId(fileInfo.FullName)));
        }
Beispiel #2
0
        private static string GetItemId(string fullName, bool isDirectory)
        {
            if (isDirectory)
            {
                // Item is a directory.
                return(Convert.ToBase64String(NativeMethodHelpers.GetDirectoryObjectId(fullName)));
            }

            return(Convert.ToBase64String(NativeMethodHelpers.GetFileObjectId(fullName)));
        }