GetFolderSource() public method

public GetFolderSource ( string volume ) : MyEverythingRecord>.Dictionary
volume string
return MyEverythingRecord>.Dictionary
コード例 #1
0
        private void ProcessRenameNewName(PInvokeWin32.USN_RECORD usn, string volume, MyEverythingDB db)
        {
            // frn 没有改变
            // newname = usn.FileName
            // 根据usn.FRN可以从db中获取oldname
            // db.update...
            MyEverythingRecord newRecord = MyEverythingRecord.ParseUSN(usn);
            string             fullpath  = newRecord.Name;

            db.FindRecordPath(newRecord, ref fullpath, db.GetFolderSource(volume));
            newRecord.FullPath = fullpath;
            var    oldRecord = db.FindByFrn(volume, usn.FRN);
            string newname   = newRecord.FullPath;

            Debug.WriteLine(string.Format(">>>> RenameFile {0} to {1}", oldRecord.FullPath, newname));
            db.UpdateRecord(volume, newRecord,
                            usn.IsFolder ? MyEverythingRecordType.Folder : MyEverythingRecordType.File);
            if (RecordRenameEvent != null)
            {
                RecordRenameEvent(oldRecord, newRecord);
            }
            if (newname.Contains("$RECYCLE.BIN"))
            {
                Debug.WriteLine(string.Format(">>>> Means {0} moved to recycle.", oldRecord.FullPath));
            }
        }
コード例 #2
0
 public static void FillPath(string volume, MyEverythingRecord record, MyEverythingDB db)
 {
     if (record == null) return;
     var fdSource = db.GetFolderSource(volume);
     string fullpath = record.Name;
     FindRecordPath(record, ref fullpath, fdSource);
     record.FullPath = fullpath;
 }
コード例 #3
0
ファイル: VolumeMonitor.cs プロジェクト: elainte/MyEverything
 private void ProcessFileCreate(PInvokeWin32.USN_RECORD usn, string volume, MyEverythingDB db)
 {
     MyEverythingRecord record = MyEverythingRecord.ParseUSN(usn);
     string fullpath = record.Name;
     db.FindRecordPath(record, ref fullpath, db.GetFolderSource(volume));
     record.FullPath = fullpath;
     db.AddRecord(volume, record, usn.IsFolder ? MyEverythingRecordType.Folder : MyEverythingRecordType.File);
     Debug.WriteLine(string.Format(">>>> NewFile: {0}", record.FullPath));
     if (RecordAddedEvent != null)
         RecordAddedEvent(record);
 }
コード例 #4
0
ファイル: MyEverything.cs プロジェクト: boomwith/MyEverything
        public static void FillPath(string volume, MyEverythingRecord record, MyEverythingDB db)
        {
            if (record == null)
            {
                return;
            }
            var    fdSource = db.GetFolderSource(volume);
            string fullpath = record.Name;

            FindRecordPath(record, ref fullpath, fdSource);
            record.FullPath = fullpath;
        }
コード例 #5
0
        private void ProcessFileCreate(PInvokeWin32.USN_RECORD usn, string volume, MyEverythingDB db)
        {
            MyEverythingRecord record   = MyEverythingRecord.ParseUSN(usn);
            string             fullpath = record.Name;

            db.FindRecordPath(record, ref fullpath, db.GetFolderSource(volume));
            record.FullPath = fullpath;
            db.AddRecord(volume, record, usn.IsFolder ? MyEverythingRecordType.Folder : MyEverythingRecordType.File);
            Debug.WriteLine(string.Format(">>>> NewFile: {0}", record.FullPath));
            if (RecordAddedEvent != null)
            {
                RecordAddedEvent(record);
            }
        }
コード例 #6
0
ファイル: VolumeMonitor.cs プロジェクト: elainte/MyEverything
 private void ProcessRenameNewName(PInvokeWin32.USN_RECORD usn, string volume, MyEverythingDB db)
 {
     // frn 没有改变
     // newname = usn.FileName
     // 根据usn.FRN可以从db中获取oldname
     // db.update...
     MyEverythingRecord newRecord = MyEverythingRecord.ParseUSN(usn);
     string fullpath = newRecord.Name;
     db.FindRecordPath(newRecord, ref fullpath, db.GetFolderSource(volume));
     newRecord.FullPath = fullpath;
     var oldRecord = db.FindByFrn(volume, usn.FRN);
     string newname = newRecord.FullPath;
     Debug.WriteLine(string.Format(">>>> RenameFile {0} to {1}", oldRecord.FullPath, newname));
     db.UpdateRecord(volume, newRecord,
         usn.IsFolder ? MyEverythingRecordType.Folder : MyEverythingRecordType.File);
     if (RecordRenameEvent != null) RecordRenameEvent(oldRecord, newRecord);
     if (newname.Contains("$RECYCLE.BIN")) {
         Debug.WriteLine(string.Format(">>>> Means {0} moved to recycle.", oldRecord.FullPath));
     }
 }