{"action":"created","issue":{"url":"https://api.github.com/repos/tjscience/RoboSharp/issues/13","repository_url":"https://api.github.com/repos/tjscience/RoboSharp","labels_url":"https://api.github.com/repos/tjscience/RoboSharp/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/tjscience/RoboSharp/issues/13/comments","events_url":"https://api.github.com/repos/tjscience/RoboSharp/issues/13/events","html_url":"https://github.com/tjscience/RoboSharp/issues/13","id":162832734,"number":13,"title":"Event Handler Not Firing OnCopyProgressChanged","user":{"login":"solemnpaladin","id":13835005,"avatar_url":"https://avatars.githubusercontent.com/u/13835005?v=3","gravatar_id":"","url":"https://api.github.com/users/solemnpaladin","html_url":"https://github.com/solemnpaladin","followers_url":"https://api.github.com/users/solemnpaladin/followers","following_url":"https://api.github.com/users/solemnpaladin/following{/other_user}","gists_url":"https://api.github.com/users/solemnpaladin/gists{/gist_id}","starred_url":"https://api.github.com/users/solemnpaladin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solemnpaladin/subscriptions","organizations_url":"https://api.github.com/users/solemnpaladin/orgs","repos_url":"https://api.github.com/users/solemnpaladin/repos","events_url":"https://api.github.com/users/solemnpaladin/events{/privacy}","received_events_url":"https://api.github.com/users/solemnpaladin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-29T03:18:49Z","updated_at":"2016-06-29T18:55:29Z","closed_at":null,"body":"Hi, \r\n\r\nFirst, I want to say that I am really liking this library and it has already saved me ton of time and effort on a current project!  With that said, I believe that I have run into and issue with the OnCopyProgressChanged event handler not firing properly. I have set a breakpoint in the event handler and it never fires. I have included snippets of the logic I am using just encase I am doing something bone-headed.\r\n\r\nMy Button Click Event:\r\n```\r\npublic FormMain()\r\n{\r\n      InitializeComponent();\r\n\r\n}\r\n\r\nprivate static Logger logger;\r\nRoboCommand roboCMD = new RoboCommand();\r\n\r\n// Lots of code in between :-)\r\n\r\nprivate void buttonFMMigrate_Click(object sender, EventArgs e)\r\n {\r\n        buttonFMMigrate.Enabled = false;\r\n        buttonMigrationToggle.Visible = true;\r\n        buttonStopMigration.Visible = true;\r\n\r\n        MigrateFiles();\r\n\r\n        buttonFMMigrate.Enabled = true;            \r\n        buttonMigrationToggle.Visible = false;\r\n        buttonStopMigration.Visible = false;    \r\n           \r\n }\r\n```\r\n\r\n\r\nMigrateFiles() Starts things up:\r\n\r\n```\r\npublic void MigrateFiles()  \r\n {\r\n         // Set Event Handlers\r\n         roboCMD.OnCopyProgressChanged += roboCMD_OnCopyProgressChanged;\r\n         roboCMD.OnFileProcessed += roboCMD_OnFileProcessed;\r\n         roboCMD.OnCommandCompleted += roboCMD_OnCommandCompleted;\r\n\r\n         // Set Copy Options\r\n         roboCMD.CopyOptions.Source = textBoxFMDisplaySourcePath.Text;\r\n         roboCMD.CopyOptions.Destination = textBoxFMDisplayDestinationPath.Text;\r\n         roboCMD.CopyOptions.UseUnbufferedIo = true;\r\n\r\n         if (checkBoxFMCopySubDir.Checked)\r\n         {\r\n             roboCMD.CopyOptions.CopySubdirectories = true;\r\n         }\r\n\r\n         else if (checkBoxFMCopySubEmpty.Checked)\r\n         {\r\n             roboCMD.CopyOptions.CopySubdirectoriesIncludingEmpty = true;\r\n          }\r\n          logger.Info(textBoxFMFileCount.Text + \" Files Found\");\r\n          logger.Info(\"Starting Migration...\");\r\n\r\n           roboCMD.Start();\r\n\r\n }\r\n\r\n```\r\nAnd finally the \"On_CopyProgressChanged\" Event Handler:\r\n\r\n```\r\nprivate void roboCMD_OnCopyProgressChanged(object sender, CopyProgressEventArgs e)\r\n{\r\n           progressBarFM.Invoke((MethodInvoker)delegate\r\n           {\r\n               progressBarFM.Value = (int)e.CurrentFileProgress;\r\n           });\r\n\r\n           labelFMPercentage.Invoke((MethodInvoker)delegate\r\n           {\r\n               labelFMPercentage.Text = string.Format(\"{0}\", e.CurrentFileProgress.ToString());\r\n           });\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/tjscience/RoboSharp/issues/comments/229453559","html_url":"https://github.com/tjscience/RoboSharp/issues/13#issuecomment-229453559","issue_url":"https://api.github.com/repos/tjscience/RoboSharp/issues/13","id":229453559,"user":{"login":"tjscience","id":3706870,"avatar_url":"https://avatars.githubusercontent.com/u/3706870?v=3","gravatar_id":"","url":"https://api.github.com/users/tjscience","html_url":"https://github.com/tjscience","followers_url":"https://api.github.com/users/tjscience/followers","following_url":"https://api.github.com/users/tjscience/following{/other_user}","gists_url":"https://api.github.com/users/tjscience/gists{/gist_id}","starred_url":"https://api.github.com/users/tjscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjscience/subscriptions","organizations_url":"https://api.github.com/users/tjscience/orgs","repos_url":"https://api.github.com/users/tjscience/repos","events_url":"https://api.github.com/users/tjscience/events{/privacy}","received_events_url":"https://api.github.com/users/tjscience/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T18:55:29Z","updated_at":"2016-06-29T18:55:29Z","body":"I just checked the sample app and the OnCopyProgressChanged event is being hit. Can you try to put a Console.WriteLine(e) at the very top of the callback method? Maybe, the code inside of the MethodInvoker is not being executed properly."}}
{"actor":{"display_login":"tjscience"}}