Пример #1
0
 private void TriggerFileTableEvent(MYPFileTableEventArgs e)
 {
     if (event_FileTable != null)
     {
         event_FileTable(this, e);
     }
 }
Пример #2
0
 private void TriggerFileTableEvent(MYPFileTableEventArgs e)
 {
     if (this.event_FileTable == null)
     {
         return;
     }
     this.event_FileTable((object)this, e);
 }
 /// <summary>
 /// Receive all events related to the file table entries
 /// </summary>
 /// <param name="sender">sender</param>
 /// <param name="e">event args</param>
 private void FileTableEventHandler(object sender, MYPHandler.MYPFileTableEventArgs e)
 {
     //Check if an invoke is required by selecting a random component
     //that might be updated by this event
     if (label_NumOfFiles_Value.InvokeRequired)
     {
         Invoke(OnNewFileTableEvent, e);
     }
     else
     {
         TreatFileTableEvent(e);
     }
 }
 int modulus = 0; //an int to not invoke the winform update every time
 /// <summary>
 /// Treats an event in the UI thread
 /// </summary>
 /// <param name="e">event arguments</param>
 private void TreatFileTableEvent(MYPHandler.MYPFileTableEventArgs e)
 {
     modulus++;
     if (e.Type == Event_FileTableType.FileError)
     {
         label_ReadingErrors_Value.Text = CurrentMypFH.Error_FileEntryNumber.ToString();
     }
     else if (e.Type == Event_FileTableType.NewFile)
     {
         if (modulus % 1000 == 0 && !multipleFilesScan)
         {
             Update_OnFileTableEvent();
         }
         FileListing_Add(e.ArchFile);
     }
     else if (e.Type == Event_FileTableType.UpdateFile)
     {
         if (modulus % 1000 == 0)
         {
             Update_OnFileTableEvent();
         }
     }
     else if (e.Type == Event_FileTableType.Finished)
     {
         //Final update
         Update_OnFileTableEvent();
         if (CurrentMypFH.archiveModifiedFileList.Count > 0 || CurrentMypFH.archiveNewFileList.Count > 0)
         {
             hashDic.SaveHashList();
         }
         //if (!multipleFilesScan || scanFiles.Count == 0) // so that we only update the tree view and everything at the whole end, to take less time when multiple scans is running
         //{
         fileInArchiveDataGridView.DataSource = fileInArchiveBindingSource;
         //fileInArchiveDataGridView.Show();
         Update_TreeView();
         //}
         if (scanFiles.Count == 0)
         {
             OperationFinished();                       // Only if all the files have been scan is the operation finished !!!
         }
     }
 }
Пример #5
0
 private void TriggerFileTableEvent(MYPFileTableEventArgs e)
 {
     if (event_FileTable != null)
     {
         event_FileTable(this, e);
     }
 }