Example #1
0
        private void InvokeRemoteDriveEvent(RemoteDriveEventType type, RemoteDriveItem item = null,
                                            string message = null, Exception exception = null)
        {
            RemoteDriveEventArgs args = new RemoteDriveEventArgs(type, item, message, exception);

            this.RemoteDriveEvent?.Invoke(this, args);
        }
Example #2
0
 private void RemoteDriveEventHandler(object sender, RemoteDriveEventArgs args)
 {
     if (args.Type == RemoteDriveEventType.ReadRemoteOk)
     {
         this.Invoke(new Action(() => {
             if (this.CompareNeeded())
             {
                 this.Compare();
             }
             this.notifyIcon.Icon = Resource.media_black;
         }));
     }
     if (args.Type == RemoteDriveEventType.ReadLocalOk)
     {
         this.Invoke(new Action(() => {
             this.listViewLocal.Items.Clear();
             this.textBoxCwdLocal.Text = this.PathResolver.FilterName(args.Item.Name);
             args.Item.Children().ToList().ForEach(i => { this.AddRemoteDriveItemLocal(i); });
             if (this.CompareNeeded())
             {
                 this.Compare();
             }
             this.notifyIcon.Icon = Resource.media_black;
         }));
     }
     if (args.Type == RemoteDriveEventType.DownloadOk || args.Type == RemoteDriveEventType.DeleteLocalOk ||
         args.Type == RemoteDriveEventType.CreateLocalOk || args.Type == RemoteDriveEventType.CreateRemoteOk ||
         args.Type == RemoteDriveEventType.DeleteRemoteOk || args.Type == RemoteDriveEventType.MoveRemoteOk)
     {
         this.Invoke(new Action(() => { this.RemoteDrive.Navigate(this.RemoteDrive.DirectoryLocal.FullPath); }));
     }
     if (args.Type == RemoteDriveEventType.CreateLocalBegin || args.Type == RemoteDriveEventType.CreateRemoteBegin ||
         args.Type == RemoteDriveEventType.DeleteRemoteBegin || args.Type == RemoteDriveEventType.DownloadBegin ||
         args.Type == RemoteDriveEventType.DeleteLocalBegin || args.Type == RemoteDriveEventType.MoveRemoteBegin)
     {
         this.Invoke(new Action(() => { this.notifyIcon.Icon = Resource.media_white; }));
     }
 }