public FileSystemInfoListViewItem(DroidExplorer.Core.IO.FileSystemInfo fsi)
            : base(fsi.Name)
        {
            FileSystemInfo = fsi;
            string type = "Directory";

            this.ImageIndex = (int)Icons.Directory;
            if (fsi.IsLink)
            {
                this.ImageIndex = fsi.IsDirectory ? (int)Icons.DirectoryLink : fsi.IsExecutable ? (int)Icons.ExecutableLink : (int)Icons.FileLink;
                type            = "Link";
            }

            if (fsi is DroidExplorer.Core.IO.FileInfo)
            {
                if (fsi.IsExecutable)
                {
                    this.ImageIndex = (int)Icons.Executable;
                    type            = "Executable";
                }
                else
                {
                    this.ImageIndex = (int)Icons.File;
                    type            = "File";
                }
            }

            this.SubItems.Add(type);
            this.SubItems.Add(fsi.LastModificationDateTime.ToString( ));
            this.SubItems.Add(String.Format(new FileSizeFormatProvider( ), "{0:fs}", fsi.Size));
        }
Beispiel #2
0
 private bool IsFilterMatch(DroidExplorer.Core.IO.FileSystemInfo fsi, string filter)
 {
     string[] split = filter.Split(";".ToCharArray( ), StringSplitOptions.RemoveEmptyEntries);
     foreach (var item in split)
     {
         if (string.Compare(item, "*", true) == 0 || string.Compare(item, "*.*", true) == 0)
         {
             return(true);
         }
         Regex regex = new Regex(item.Replace(".", "\\.").Replace("*", ".*").Replace("?", ".{1}"), RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
         if (regex.IsMatch(fsi.Name))
         {
             return(true);
         }
     }
     return(false);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="FileProperiesDialog"/> class.
        /// </summary>
        /// <param name="fsi">The fsi.</param>
        public FileProperiesDialog( FileSystemInfo fsi )
            : this()
        {
            FileSystemInfo = fsi;
            this.permissionTypes.Items.Clear ( );
            ListViewItem lvi = new ListViewItem ( "User" );
            lvi.Tag = FileSystemInfo.UserPermissions;
            this.permissionTypes.Items.Add ( lvi );

            lvi = new ListViewItem ( "Group" );
            lvi.Tag = FileSystemInfo.GroupPermissions;
            this.permissionTypes.Items.Add ( lvi );

            lvi = new ListViewItem ( "Other" );
            lvi.Tag = FileSystemInfo.OtherPermissions;
            this.permissionTypes.Items.Add ( lvi );

            this.permissionTypes.SelectedIndices.Add ( 0 );

            this.isReadOnly.Visible = CommandRunner.Instance.IsMountPoint ( FileSystemInfo.FullPath );

            SetDialogValues ( );
        }
 /// <summary>
 /// Gets the ListView item.
 /// </summary>
 /// <param name="fsi">The fsi.</param>
 /// <returns></returns>
 public System.Windows.Forms.ListViewItem GetListViewItem(FileSystemInfo fsi)
 {
     return new FileSystemInfoListViewItem(fsi);
 }
 public FileSystemInfoListViewItem(DroidExplorer.Core.IO.FileSystemInfo fsi, int imageIndex)
     : this( fsi ) {
     this.ImageIndex = imageIndex;
 }
Beispiel #6
0
 public static string GetCacheKey(FileSystemInfo file)
 {
     return GetCacheKey(file.FullPath);
 }
Beispiel #7
0
 public System.Windows.Forms.ListViewItem GetListViewItem(FileSystemInfo fsi)
 {
     var path = Cache.GetPath(Cache.APK_IMAGE_CACHE);
     var result = CommandRunner.Instance.GetApkInformationFromLocalCache(fsi.FullPath, path);
     return new ApkFileSystemInfoListViewItem(fsi, result);
 }