示例#1
0
 private void OnFileRenamed(object sender, RenamedEventArgs e)
 {
     watcher.EnableRaisingEvents = false;
     logger.SaveRenamedFileLog(e.FullPath, e.OldName, e.Name, DateTime.Now);
     watcher.EnableRaisingEvents = true;
     FileAction?.Invoke(WatcherChangeTypes.Renamed, e.Name);
 }
示例#2
0
 private void OnFileChanged(object sender, FileSystemEventArgs e)
 {
     watcher.EnableRaisingEvents = false;
     logger.SaveChangedOrCreatedFileLog(e.FullPath, e.Name, DateTime.Now);
     watcher.EnableRaisingEvents = true;
     FileAction?.Invoke(WatcherChangeTypes.Changed, e.Name);
 }
 private void Invoke(ListViewItem item, ActionType actionType)
 {
     if (item != null && item.Tag != null)
     {
         if (item.Tag is Directory)
         {
             DirectoryAction?.Invoke(this, (Directory)item.Tag, actionType);
         }
         else if (item.Tag is File)
         {
             FileAction?.Invoke(this, (File)item.Tag, actionType);
         }
     }
 }
        private void InvokeContextMenu(ActionType actionType)
        {
            switch ((EntryType)contextMenuStrip.Tag)
            {
            case EntryType.FILE:
            {
                FileAction?.Invoke(this, SelectedFile, actionType);
                break;
            }

            case EntryType.DIRECTORY:
            {
                DirectoryAction?.Invoke(this, SelectedDirectory, actionType);
                break;
            }
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="containerName"></param>
 /// <param name="fileName"></param>
 /// <param name="loadAction"></param>
 public void Load(String containerName, String fileName, FileAction loadAction)
 {
     loadAction.Invoke(TitleContainer.OpenStream(String.Join(@"\", containerName, fileName)));
 }
 public void ExecForFile(string par1)
 {
     FileAction.Invoke(par1, Parameter);
 }
示例#7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="containerName"></param>
 /// <param name="fileName"></param>
 /// <param name="loadAction"></param>
 public void Load(String containerName, String fileName, FileAction loadAction)
 {
     loadAction.Invoke(TitleContainer.OpenStream(String.Join(@"\", containerName, fileName)));
 }
 private void ImageFileToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     FileAction?.Invoke(this, null, ActionType.NEW_IMAGE_FILE);
 }
 private void AudioFileToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     FileAction?.Invoke(this, null, ActionType.NEW_AUDIO_FILE);
 }
 private void UploadFileToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     FileAction?.Invoke(this, null, ActionType.UPLOAD_FILE);
 }