{"action":"created","comment":{"url":"https://api.github.com/repos/vslavik/winsparkle/pulls/comments/48447925","id":48447925,"diff_hunk":"@@ -0,0 +1,155 @@\n+﻿using System;\n+using System.Windows.Forms;\n+using WinSparkleDotNet;\n+\n+namespace example_dotnet\n+{\n+    public partial class WinSparkleDemoForm : Form\n+    {\n+        private readonly WinSparkleNet _sparkleNet;\n+\n+        public WinSparkleDemoForm()\n+        {\n+            InitializeComponent();\n+            try\n+            {\n+                _sparkleNet = new WinSparkleNet();\n+            }\n+            catch (Exception ex)\n+            {\n+                MessageBox.Show(@\"Error was : \"+ex, @\"Error during SparkleNet instantiation\",\n+                    MessageBoxButtons.OK, MessageBoxIcon.Error);\n+                return;\n+            }\n+            //Callback\n+            _sparkleNet.SetCanShutdownCallback(this.CanShutDownCallback);\n+            _sparkleNet.SetShutdownRequestCallback(this.ShutDownRequestCallback);\n+            _sparkleNet.SetDidFindUpdateCallback(this.DidFindAnUpdateCallback);\n+            _sparkleNet.SetDidNotFindUpdateCallback(this.DidNotFindAnUpdateCallback);\n+            _sparkleNet.SetUpdateCancelledCallback(this.UpdateCancelledCallback);\n+            _sparkleNet.SetErrorCallback(this.ErrorCallback);\n+            //Init\n+            _sparkleNet.Initialize();\n+            _sparkleNet.CheckForUpdate();\n+        }\n+\n+        private void Form_FormClosed(object sender, FormClosedEventArgs e)\n+        {\n+            _sparkleNet.Cleanup();\n+        }\n+\n+        private void Form_Load(object sender, System.EventArgs e)\n+        {\n+            txtb_lastChecked.Text = _sparkleNet.LastCheckTime.ToString(\"dd'/'MM'/'yyyy HH:mm:ss\");\n+            txtb_updateInterval.Text = _sparkleNet.UpdateInterval.Seconds.ToString();\n+            ckb_autoCheckUpdate.Checked = _sparkleNet.AutomaticCheckForUpdates;\n+            llbl_appCastUrl.Text = _sparkleNet.AppCastUrl;\n+        }\n+\n+        private void btn_checkUpdate_Click(object sender, System.EventArgs e)\n+        {\n+            _sparkleNet.CheckForUpdate();\n+        }\n+\n+        private void btn_checkUpdateNoUI_Click(object sender, EventArgs e)\n+        {\n+            _sparkleNet.CheckForUpdate(false);\n+        }\n+\n+        private void btn_checkUpdateAndInstall_Click(object sender, EventArgs e)\n+        {\n+            _sparkleNet.CheckForUpdate(true, true);\n+        }\n+\n+        private void btn_close_Click(object sender, EventArgs e)\n+        {\n+            this.Close();\n+        }\n+\n+        private bool CanShutDownCallback()\n+        {\n+            try\n+            {\n+                var result = MessageBox.Show(@\"Here you can simulate if the application can be closed or not to proceed the update\", @\"CanShutDownCallback\",\n+                    MessageBoxButtons.YesNo, MessageBoxIcon.Question);\n+                return result == DialogResult.Yes;\n+            }\n+            catch (Exception ex)\n+            {\n+                MessageBox.Show(ex.Message, @\"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n+                return false;\n+            }\n+        }\n+\n+        private void DidFindAnUpdateCallback()\n+        {\n+            try\n+            {\n+                MessageBox.Show(@\"Callback called if an update has been found.\", @\"DidFindUpdateCallback\",\n+                    MessageBoxButtons.OK, MessageBoxIcon.Information);\n+            }\n+            catch (Exception ex)\n+            {\n+                MessageBox.Show(ex.Message, @\"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n+            }\n+        }\n+\n+        private void DidNotFindAnUpdateCallback()\n+        {\n+            try\n+            {\n+                MessageBox.Show(@\"Callback called if an update hasn't been found.\", @\"DidNotFindUpdateCallback\",\n+                    MessageBoxButtons.OK, MessageBoxIcon.Information);\n+            }\n+            catch (Exception ex)\n+            {\n+                MessageBox.Show(ex.Message, @\"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n+            }\n+        }\n+\n+        private void UpdateCancelledCallback()\n+        {\n+            try\n+            {\n+                MessageBox.Show(@\"Callback called if an update has been cancelled/ignored by user.\", @\"UpdateCancelledCallback\",\n+                    MessageBoxButtons.OK, MessageBoxIcon.Information);\n+            }\n+            catch (Exception ex)\n+            {\n+                MessageBox.Show(ex.Message, @\"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n+            }\n+        }\n+\n+        private void ErrorCallback()\n+        {\n+            try\n+            {\n+                MessageBox.Show(@\"Callback called if WinSparkle get an error.\", @\"ErrorCallback\",\n+                    MessageBoxButtons.OK, MessageBoxIcon.Information);\n+            }\n+            catch (Exception ex)\n+            {\n+                MessageBox.Show(ex.Message, @\"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n+            }\n+        }\n+\n+        private void ShutDownRequestCallback()\n+        {\n+            try\n+            {\n+                if (System.Windows.Forms.Application.MessageLoop)\n+                {\n+                    System.Windows.Forms.Application.Exit();\n+                }\n+                else\n+                {\n+                    System.Environment.Exit(1);","path":"examples/example_dotnet/WinSparkleDemoForm.cs","position":146,"original_position":146,"commit_id":"810d1e02a7fa3f218424609a34460d4aeccd5a06","original_commit_id":"810d1e02a7fa3f218424609a34460d4aeccd5a06","user":{"login":"Phrohdoh","id":4861023,"avatar_url":"https://avatars.githubusercontent.com/u/4861023?v=3","gravatar_id":"","url":"https://api.github.com/users/Phrohdoh","html_url":"https://github.com/Phrohdoh","followers_url":"https://api.github.com/users/Phrohdoh/followers","following_url":"https://api.github.com/users/Phrohdoh/following{/other_user}","gists_url":"https://api.github.com/users/Phrohdoh/gists{/gist_id}","starred_url":"https://api.github.com/users/Phrohdoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phrohdoh/subscriptions","organizations_url":"https://api.github.com/users/Phrohdoh/orgs","repos_url":"https://api.github.com/users/Phrohdoh/repos","events_url":"https://api.github.com/users/Phrohdoh/events{/privacy}","received_events_url":"https://api.github.com/users/Phrohdoh/received_events","type":"User","site_admin":false},"body":"Why exit with 1?\r\nExiting with anything other than 0 indicates errors/failure.","created_at":"2015-12-26T15:56:23Z","updated_at":"2015-12-26T15:56:23Z","html_url":"https://github.com/vslavik/winsparkle/pull/73#discussion_r48447925","pull_request_url":"https://api.github.com/repos/vslavik/winsparkle/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/vslavik/winsparkle/pulls/comments/48447925"},"html":{"href":"https://github.com/vslavik/winsparkle/pull/73#discussion_r48447925"},"pull_request":{"href":"https://api.github.com/repos/vslavik/winsparkle/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/vslavik/winsparkle/pulls/73","id":45597156,"html_url":"https://github.com/vslavik/winsparkle/pull/73","diff_url":"https://github.com/vslavik/winsparkle/pull/73.diff","patch_url":"https://github.com/vslavik/winsparkle/pull/73.patch","issue_url":"https://api.github.com/repos/vslavik/winsparkle/issues/73","number":73,"state":"open","locked":false,"title":"Net Wrapper + Example ","user":{"login":"Herve-M","id":1846023,"avatar_url":"https://avatars.githubusercontent.com/u/1846023?v=3","gravatar_id":"","url":"https://api.github.com/users/Herve-M","html_url":"https://github.com/Herve-M","followers_url":"https://api.github.com/users/Herve-M/followers","following_url":"https://api.github.com/users/Herve-M/following{/other_user}","gists_url":"https://api.github.com/users/Herve-M/gists{/gist_id}","starred_url":"https://api.github.com/users/Herve-M/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Herve-M/subscriptions","organizations_url":"https://api.github.com/users/Herve-M/orgs","repos_url":"https://api.github.com/users/Herve-M/repos","events_url":"https://api.github.com/users/Herve-M/events{/privacy}","received_events_url":"https://api.github.com/users/Herve-M/received_events","type":"User","site_admin":false},"body":"This PR take part of solving issue #20.\r\n\r\nIt keep the way project where organized.\r\n- New C# assembly project into WinSparkle-2013 and WinSparkle-2015 (WinSparkleDotNet)\r\n- New WinForm example project into examples-2013 and examples-2015 (example_dotnet.csproj)\r\n\r\nAnd try to correct most of the problems from pull #55.\r\n\r\nThis don't add the feature as unique DLL for C#. This will come after, if this is validated.\r\nTarget WinSparkle API 0.5.X (from master)\r\n","created_at":"2015-09-21T20:41:35Z","updated_at":"2015-12-26T15:56:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75c9f8354bbbb18b35d976c83dd0f96ad89e0f54","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vslavik/winsparkle/pulls/73/commits","review_comments_url":"https://api.github.com/repos/vslavik/winsparkle/pulls/73/comments","review_comment_url":"https://api.github.com/repos/vslavik/winsparkle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vslavik/winsparkle/issues/73/comments","statuses_url":"https://api.github.com/repos/vslavik/winsparkle/statuses/810d1e02a7fa3f218424609a34460d4aeccd5a06","head":{"label":"Herve-M:feat-net-wrapper","ref":"feat-net-wrapper","sha":"810d1e02a7fa3f218424609a34460d4aeccd5a06","user":{"login":"Herve-M","id":1846023,"avatar_url":"https://avatars.githubusercontent.com/u/1846023?v=3","gravatar_id":"","url":"https://api.github.com/users/Herve-M","html_url":"https://github.com/Herve-M","followers_url":"https://api.github.com/users/Herve-M/followers","following_url":"https://api.github.com/users/Herve-M/following{/other_user}","gists_url":"https://api.github.com/users/Herve-M/gists{/gist_id}","starred_url":"https://api.github.com/users/Herve-M/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Herve-M/subscriptions","organizations_url":"https://api.github.com/users/Herve-M/orgs","repos_url":"https://api.github.com/users/Herve-M/repos","events_url":"https://api.github.com/users/Herve-M/events{/privacy}","received_events_url":"https://api.github.com/users/Herve-M/received_events","type":"User","site_admin":false},"repo":{"id":42827020,"name":"winsparkle","full_name":"Herve-M/winsparkle","owner":{"login":"Herve-M","id":1846023,"avatar_url":"https://avatars.githubusercontent.com/u/1846023?v=3","gravatar_id":"","url":"https://api.github.com/users/Herve-M","html_url":"https://github.com/Herve-M","followers_url":"https://api.github.com/users/Herve-M/followers","following_url":"https://api.github.com/users/Herve-M/following{/other_user}","gists_url":"https://api.github.com/users/Herve-M/gists{/gist_id}","starred_url":"https://api.github.com/users/Herve-M/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Herve-M/subscriptions","organizations_url":"https://api.github.com/users/Herve-M/orgs","repos_url":"https://api.github.com/users/Herve-M/repos","events_url":"https://api.github.com/users/Herve-M/events{/privacy}","received_events_url":"https://api.github.com/users/Herve-M/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Herve-M/winsparkle","description":"[Fork]","fork":true,"url":"https://api.github.com/repos/Herve-M/winsparkle","forks_url":"https://api.github.com/repos/Herve-M/winsparkle/forks","keys_url":"https://api.github.com/repos/Herve-M/winsparkle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Herve-M/winsparkle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Herve-M/winsparkle/teams","hooks_url":"https://api.github.com/repos/Herve-M/winsparkle/hooks","issue_events_url":"https://api.github.com/repos/Herve-M/winsparkle/issues/events{/number}","events_url":"https://api.github.com/repos/Herve-M/winsparkle/events","assignees_url":"https://api.github.com/repos/Herve-M/winsparkle/assignees{/user}","branches_url":"https://api.github.com/repos/Herve-M/winsparkle/branches{/branch}","tags_url":"https://api.github.com/repos/Herve-M/winsparkle/tags","blobs_url":"https://api.github.com/repos/Herve-M/winsparkle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Herve-M/winsparkle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Herve-M/winsparkle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Herve-M/winsparkle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Herve-M/winsparkle/statuses/{sha}","languages_url":"https://api.github.com/repos/Herve-M/winsparkle/languages","stargazers_url":"https://api.github.com/repos/Herve-M/winsparkle/stargazers","contributors_url":"https://api.github.com/repos/Herve-M/winsparkle/contributors","subscribers_url":"https://api.github.com/repos/Herve-M/winsparkle/subscribers","subscription_url":"https://api.github.com/repos/Herve-M/winsparkle/subscription","commits_url":"https://api.github.com/repos/Herve-M/winsparkle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Herve-M/winsparkle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Herve-M/winsparkle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Herve-M/winsparkle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Herve-M/winsparkle/contents/{+path}","compare_url":"https://api.github.com/repos/Herve-M/winsparkle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Herve-M/winsparkle/merges","archive_url":"https://api.github.com/repos/Herve-M/winsparkle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Herve-M/winsparkle/downloads","issues_url":"https://api.github.com/repos/Herve-M/winsparkle/issues{/number}","pulls_url":"https://api.github.com/repos/Herve-M/winsparkle/pulls{/number}","milestones_url":"https://api.github.com/repos/Herve-M/winsparkle/milestones{/number}","notifications_url":"https://api.github.com/repos/Herve-M/winsparkle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Herve-M/winsparkle/labels{/name}","releases_url":"https://api.github.com/repos/Herve-M/winsparkle/releases{/id}","created_at":"2015-09-20T19:48:53Z","updated_at":"2015-09-20T19:49:16Z","pushed_at":"2015-12-25T14:59:03Z","git_url":"git://github.com/Herve-M/winsparkle.git","ssh_url":"git@github.com:Herve-M/winsparkle.git","clone_url":"https://github.com/Herve-M/winsparkle.git","svn_url":"https://github.com/Herve-M/winsparkle","homepage":"http://winsparkle.org","size":26955,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vslavik:master","ref":"master","sha":"5102565d22c9beb09223c389141e0bd1ab7f4f88","user":{"login":"vslavik","id":145881,"avatar_url":"https://avatars.githubusercontent.com/u/145881?v=3","gravatar_id":"","url":"https://api.github.com/users/vslavik","html_url":"https://github.com/vslavik","followers_url":"https://api.github.com/users/vslavik/followers","following_url":"https://api.github.com/users/vslavik/following{/other_user}","gists_url":"https://api.github.com/users/vslavik/gists{/gist_id}","starred_url":"https://api.github.com/users/vslavik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vslavik/subscriptions","organizations_url":"https://api.github.com/users/vslavik/orgs","repos_url":"https://api.github.com/users/vslavik/repos","events_url":"https://api.github.com/users/vslavik/events{/privacy}","received_events_url":"https://api.github.com/users/vslavik/received_events","type":"User","site_admin":false},"repo":{"id":467582,"name":"winsparkle","full_name":"vslavik/winsparkle","owner":{"login":"vslavik","id":145881,"avatar_url":"https://avatars.githubusercontent.com/u/145881?v=3","gravatar_id":"","url":"https://api.github.com/users/vslavik","html_url":"https://github.com/vslavik","followers_url":"https://api.github.com/users/vslavik/followers","following_url":"https://api.github.com/users/vslavik/following{/other_user}","gists_url":"https://api.github.com/users/vslavik/gists{/gist_id}","starred_url":"https://api.github.com/users/vslavik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vslavik/subscriptions","organizations_url":"https://api.github.com/users/vslavik/orgs","repos_url":"https://api.github.com/users/vslavik/repos","events_url":"https://api.github.com/users/vslavik/events{/privacy}","received_events_url":"https://api.github.com/users/vslavik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vslavik/winsparkle","description":"App update framework for Windows, inspired by Sparkle for OS X","fork":false,"url":"https://api.github.com/repos/vslavik/winsparkle","forks_url":"https://api.github.com/repos/vslavik/winsparkle/forks","keys_url":"https://api.github.com/repos/vslavik/winsparkle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vslavik/winsparkle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vslavik/winsparkle/teams","hooks_url":"https://api.github.com/repos/vslavik/winsparkle/hooks","issue_events_url":"https://api.github.com/repos/vslavik/winsparkle/issues/events{/number}","events_url":"https://api.github.com/repos/vslavik/winsparkle/events","assignees_url":"https://api.github.com/repos/vslavik/winsparkle/assignees{/user}","branches_url":"https://api.github.com/repos/vslavik/winsparkle/branches{/branch}","tags_url":"https://api.github.com/repos/vslavik/winsparkle/tags","blobs_url":"https://api.github.com/repos/vslavik/winsparkle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vslavik/winsparkle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vslavik/winsparkle/git/refs{/sha}","trees_url":"https://api.github.com/repos/vslavik/winsparkle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vslavik/winsparkle/statuses/{sha}","languages_url":"https://api.github.com/repos/vslavik/winsparkle/languages","stargazers_url":"https://api.github.com/repos/vslavik/winsparkle/stargazers","contributors_url":"https://api.github.com/repos/vslavik/winsparkle/contributors","subscribers_url":"https://api.github.com/repos/vslavik/winsparkle/subscribers","subscription_url":"https://api.github.com/repos/vslavik/winsparkle/subscription","commits_url":"https://api.github.com/repos/vslavik/winsparkle/commits{/sha}","git_commits_url":"https://api.github.com/repos/vslavik/winsparkle/git/commits{/sha}","comments_url":"https://api.github.com/repos/vslavik/winsparkle/comments{/number}","issue_comment_url":"https://api.github.com/repos/vslavik/winsparkle/issues/comments{/number}","contents_url":"https://api.github.com/repos/vslavik/winsparkle/contents/{+path}","compare_url":"https://api.github.com/repos/vslavik/winsparkle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vslavik/winsparkle/merges","archive_url":"https://api.github.com/repos/vslavik/winsparkle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vslavik/winsparkle/downloads","issues_url":"https://api.github.com/repos/vslavik/winsparkle/issues{/number}","pulls_url":"https://api.github.com/repos/vslavik/winsparkle/pulls{/number}","milestones_url":"https://api.github.com/repos/vslavik/winsparkle/milestones{/number}","notifications_url":"https://api.github.com/repos/vslavik/winsparkle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vslavik/winsparkle/labels{/name}","releases_url":"https://api.github.com/repos/vslavik/winsparkle/releases{/id}","created_at":"2010-01-11T16:13:10Z","updated_at":"2015-12-25T14:34:52Z","pushed_at":"2015-12-25T14:59:03Z","git_url":"git://github.com/vslavik/winsparkle.git","ssh_url":"git@github.com:vslavik/winsparkle.git","clone_url":"https://github.com/vslavik/winsparkle.git","svn_url":"https://github.com/vslavik/winsparkle","homepage":"http://winsparkle.org","size":27265,"stargazers_count":328,"watchers_count":328,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":9,"forks":101,"open_issues":9,"watchers":328,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vslavik/winsparkle/pulls/73"},"html":{"href":"https://github.com/vslavik/winsparkle/pull/73"},"issue":{"href":"https://api.github.com/repos/vslavik/winsparkle/issues/73"},"comments":{"href":"https://api.github.com/repos/vslavik/winsparkle/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/vslavik/winsparkle/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/vslavik/winsparkle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vslavik/winsparkle/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/vslavik/winsparkle/statuses/810d1e02a7fa3f218424609a34460d4aeccd5a06"}}}}