{"action":"created","comment":{"url":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/comments/30097726","id":30097726,"diff_hunk":"@@ -0,0 +1,89 @@\n+using System;\r\n+using System.Collections;\r\n+using Microsoft.SPOT;\r\n+\r\n+namespace Windows.Devices.Gpio\r\n+{\r\n+    internal class GpioPinEvent : BaseEvent\r\n+    {\r\n+        public int PinNumber;\r\n+        public GpioPinEdge Edge;\r\n+    }\r\n+\r\n+    internal class GpioPinEventListener : IEventProcessor, IEventListener\r\n+    {\r\n+        // Construction and destruction\r\n+\r\n+        public GpioPinEventListener()\r\n+        {\r\n+            EventSink.AddEventProcessor(EventCategory.Gpio, this);\r\n+            EventSink.AddEventListener(EventCategory.Gpio, this);\r\n+        }\r\n+\r\n+        // IEventProcessor methods\r\n+\r\n+        public BaseEvent ProcessEvent(uint data1, uint data2, DateTime time)\r\n+        {\r\n+            return new GpioPinEvent\r\n+            {\r\n+                // Data1 is packed by PostManagedEvent, so we need to unpack the high word.\r\n+                PinNumber = (int)((data1 >> 16) & 65535u),\r\n+                Edge = (data2 == 0) ? GpioPinEdge.FallingEdge : GpioPinEdge.RisingEdge,\r\n+            };\r\n+        }\r\n+\r\n+        // IEventListener methods\r\n+\r\n+        public void InitializeForEventSource()\r\n+        {\r\n+        }\r\n+\r\n+        public bool OnEvent(BaseEvent ev)\r\n+        {\r\n+            var pinEvent = (GpioPinEvent)ev;\r\n+            GpioPin pin = null;\r\n+\r\n+            lock (m_pinMap)\r\n+            {\r\n+                if (m_pinMap.Contains(pinEvent.PinNumber))\r\n+                {\r\n+                    pin = (GpioPin)m_pinMap[pinEvent.PinNumber];\r\n+                }\r\n+            }\r\n+\r\n+            // Avoid calling this under a lock to prevent a potential lock inversion.\r\n+            if (pin != null)\r\n+            {\r\n+                pin.OnPinChangedInternal(pinEvent.Edge);\r\n+            }\r\n+\r\n+            return true;\r\n+        }\r\n+\r\n+        // Public methods\r","path":"Framework/Core/Windows/Devices/Gpio/GpioPinEventListener.cs","position":63,"original_position":63,"commit_id":"4e30bfac9eb1c072efb9df5c20626afcacae0bcb","original_commit_id":"4e30bfac9eb1c072efb9df5c20626afcacae0bcb","user":{"login":"ColinA-MSFT","id":11339146,"avatar_url":"https://avatars.githubusercontent.com/u/11339146?v=3","gravatar_id":"","url":"https://api.github.com/users/ColinA-MSFT","html_url":"https://github.com/ColinA-MSFT","followers_url":"https://api.github.com/users/ColinA-MSFT/followers","following_url":"https://api.github.com/users/ColinA-MSFT/following{/other_user}","gists_url":"https://api.github.com/users/ColinA-MSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/ColinA-MSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColinA-MSFT/subscriptions","organizations_url":"https://api.github.com/users/ColinA-MSFT/orgs","repos_url":"https://api.github.com/users/ColinA-MSFT/repos","events_url":"https://api.github.com/users/ColinA-MSFT/events{/privacy}","received_events_url":"https://api.github.com/users/ColinA-MSFT/received_events","type":"User","site_admin":false},"body":"Updated to use region/endregion.  Pragma region no longer appears to work.","created_at":"2015-05-12T01:12:56Z","updated_at":"2015-05-12T01:12:56Z","html_url":"https://github.com/NETMF/netmf-interpreter/pull/97#discussion_r30097726","pull_request_url":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/comments/30097726"},"html":{"href":"https://github.com/NETMF/netmf-interpreter/pull/97#discussion_r30097726"},"pull_request":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97","id":35034697,"html_url":"https://github.com/NETMF/netmf-interpreter/pull/97","diff_url":"https://github.com/NETMF/netmf-interpreter/pull/97.diff","patch_url":"https://github.com/NETMF/netmf-interpreter/pull/97.patch","issue_url":"https://api.github.com/repos/NETMF/netmf-interpreter/issues/97","number":97,"state":"open","locked":false,"title":"Add Windows.Devices assembly","user":{"login":"ColinA-MSFT","id":11339146,"avatar_url":"https://avatars.githubusercontent.com/u/11339146?v=3","gravatar_id":"","url":"https://api.github.com/users/ColinA-MSFT","html_url":"https://github.com/ColinA-MSFT","followers_url":"https://api.github.com/users/ColinA-MSFT/followers","following_url":"https://api.github.com/users/ColinA-MSFT/following{/other_user}","gists_url":"https://api.github.com/users/ColinA-MSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/ColinA-MSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColinA-MSFT/subscriptions","organizations_url":"https://api.github.com/users/ColinA-MSFT/orgs","repos_url":"https://api.github.com/users/ColinA-MSFT/repos","events_url":"https://api.github.com/users/ColinA-MSFT/events{/privacy}","received_events_url":"https://api.github.com/users/ColinA-MSFT/received_events","type":"User","site_admin":false},"body":"Add a new assembly for Windows.Devices, with initial support for Gpio and I2c.","created_at":"2015-05-08T18:36:15Z","updated_at":"2015-05-12T01:12:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76a3ac1948dc371aecd2e05466da42dc33c7d2f9","assignee":{"login":"smaillet-ms","id":8934567,"avatar_url":"https://avatars.githubusercontent.com/u/8934567?v=3","gravatar_id":"","url":"https://api.github.com/users/smaillet-ms","html_url":"https://github.com/smaillet-ms","followers_url":"https://api.github.com/users/smaillet-ms/followers","following_url":"https://api.github.com/users/smaillet-ms/following{/other_user}","gists_url":"https://api.github.com/users/smaillet-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/smaillet-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smaillet-ms/subscriptions","organizations_url":"https://api.github.com/users/smaillet-ms/orgs","repos_url":"https://api.github.com/users/smaillet-ms/repos","events_url":"https://api.github.com/users/smaillet-ms/events{/privacy}","received_events_url":"https://api.github.com/users/smaillet-ms/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97/commits","review_comments_url":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97/comments","review_comment_url":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NETMF/netmf-interpreter/issues/97/comments","statuses_url":"https://api.github.com/repos/NETMF/netmf-interpreter/statuses/4e30bfac9eb1c072efb9df5c20626afcacae0bcb","head":{"label":"ColinA-MSFT:Windows_Devices","ref":"Windows_Devices","sha":"4e30bfac9eb1c072efb9df5c20626afcacae0bcb","user":{"login":"ColinA-MSFT","id":11339146,"avatar_url":"https://avatars.githubusercontent.com/u/11339146?v=3","gravatar_id":"","url":"https://api.github.com/users/ColinA-MSFT","html_url":"https://github.com/ColinA-MSFT","followers_url":"https://api.github.com/users/ColinA-MSFT/followers","following_url":"https://api.github.com/users/ColinA-MSFT/following{/other_user}","gists_url":"https://api.github.com/users/ColinA-MSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/ColinA-MSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColinA-MSFT/subscriptions","organizations_url":"https://api.github.com/users/ColinA-MSFT/orgs","repos_url":"https://api.github.com/users/ColinA-MSFT/repos","events_url":"https://api.github.com/users/ColinA-MSFT/events{/privacy}","received_events_url":"https://api.github.com/users/ColinA-MSFT/received_events","type":"User","site_admin":false},"repo":{"id":32597990,"name":"netmf-interpreter","full_name":"ColinA-MSFT/netmf-interpreter","owner":{"login":"ColinA-MSFT","id":11339146,"avatar_url":"https://avatars.githubusercontent.com/u/11339146?v=3","gravatar_id":"","url":"https://api.github.com/users/ColinA-MSFT","html_url":"https://github.com/ColinA-MSFT","followers_url":"https://api.github.com/users/ColinA-MSFT/followers","following_url":"https://api.github.com/users/ColinA-MSFT/following{/other_user}","gists_url":"https://api.github.com/users/ColinA-MSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/ColinA-MSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColinA-MSFT/subscriptions","organizations_url":"https://api.github.com/users/ColinA-MSFT/orgs","repos_url":"https://api.github.com/users/ColinA-MSFT/repos","events_url":"https://api.github.com/users/ColinA-MSFT/events{/privacy}","received_events_url":"https://api.github.com/users/ColinA-MSFT/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ColinA-MSFT/netmf-interpreter","description":".NET Micro Framework Interpreter","fork":true,"url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter","forks_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/forks","keys_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/teams","hooks_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/hooks","issue_events_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/issues/events{/number}","events_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/events","assignees_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/assignees{/user}","branches_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/branches{/branch}","tags_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/tags","blobs_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/git/refs{/sha}","trees_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/statuses/{sha}","languages_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/languages","stargazers_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/stargazers","contributors_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/contributors","subscribers_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/subscribers","subscription_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/subscription","commits_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/commits{/sha}","git_commits_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/git/commits{/sha}","comments_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/comments{/number}","issue_comment_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/issues/comments{/number}","contents_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/contents/{+path}","compare_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/merges","archive_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/downloads","issues_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/issues{/number}","pulls_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/pulls{/number}","milestones_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/milestones{/number}","notifications_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/labels{/name}","releases_url":"https://api.github.com/repos/ColinA-MSFT/netmf-interpreter/releases{/id}","created_at":"2015-03-20T17:39:07Z","updated_at":"2015-04-27T19:42:40Z","pushed_at":"2015-05-08T18:34:34Z","git_url":"git://github.com/ColinA-MSFT/netmf-interpreter.git","ssh_url":"git@github.com:ColinA-MSFT/netmf-interpreter.git","clone_url":"https://github.com/ColinA-MSFT/netmf-interpreter.git","svn_url":"https://github.com/ColinA-MSFT/netmf-interpreter","homepage":"http://netmf.github.io/netmf-interpreter/","size":13651,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"NETMF:dev","ref":"dev","sha":"8b606ebfbeba07afd01a2cfbc1eb2750edd6dab7","user":{"login":"NETMF","id":11064702,"avatar_url":"https://avatars.githubusercontent.com/u/11064702?v=3","gravatar_id":"","url":"https://api.github.com/users/NETMF","html_url":"https://github.com/NETMF","followers_url":"https://api.github.com/users/NETMF/followers","following_url":"https://api.github.com/users/NETMF/following{/other_user}","gists_url":"https://api.github.com/users/NETMF/gists{/gist_id}","starred_url":"https://api.github.com/users/NETMF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NETMF/subscriptions","organizations_url":"https://api.github.com/users/NETMF/orgs","repos_url":"https://api.github.com/users/NETMF/repos","events_url":"https://api.github.com/users/NETMF/events{/privacy}","received_events_url":"https://api.github.com/users/NETMF/received_events","type":"Organization","site_admin":false},"repo":{"id":31919195,"name":"netmf-interpreter","full_name":"NETMF/netmf-interpreter","owner":{"login":"NETMF","id":11064702,"avatar_url":"https://avatars.githubusercontent.com/u/11064702?v=3","gravatar_id":"","url":"https://api.github.com/users/NETMF","html_url":"https://github.com/NETMF","followers_url":"https://api.github.com/users/NETMF/followers","following_url":"https://api.github.com/users/NETMF/following{/other_user}","gists_url":"https://api.github.com/users/NETMF/gists{/gist_id}","starred_url":"https://api.github.com/users/NETMF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NETMF/subscriptions","organizations_url":"https://api.github.com/users/NETMF/orgs","repos_url":"https://api.github.com/users/NETMF/repos","events_url":"https://api.github.com/users/NETMF/events{/privacy}","received_events_url":"https://api.github.com/users/NETMF/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NETMF/netmf-interpreter","description":".NET Micro Framework Interpreter","fork":false,"url":"https://api.github.com/repos/NETMF/netmf-interpreter","forks_url":"https://api.github.com/repos/NETMF/netmf-interpreter/forks","keys_url":"https://api.github.com/repos/NETMF/netmf-interpreter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NETMF/netmf-interpreter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NETMF/netmf-interpreter/teams","hooks_url":"https://api.github.com/repos/NETMF/netmf-interpreter/hooks","issue_events_url":"https://api.github.com/repos/NETMF/netmf-interpreter/issues/events{/number}","events_url":"https://api.github.com/repos/NETMF/netmf-interpreter/events","assignees_url":"https://api.github.com/repos/NETMF/netmf-interpreter/assignees{/user}","branches_url":"https://api.github.com/repos/NETMF/netmf-interpreter/branches{/branch}","tags_url":"https://api.github.com/repos/NETMF/netmf-interpreter/tags","blobs_url":"https://api.github.com/repos/NETMF/netmf-interpreter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NETMF/netmf-interpreter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NETMF/netmf-interpreter/git/refs{/sha}","trees_url":"https://api.github.com/repos/NETMF/netmf-interpreter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NETMF/netmf-interpreter/statuses/{sha}","languages_url":"https://api.github.com/repos/NETMF/netmf-interpreter/languages","stargazers_url":"https://api.github.com/repos/NETMF/netmf-interpreter/stargazers","contributors_url":"https://api.github.com/repos/NETMF/netmf-interpreter/contributors","subscribers_url":"https://api.github.com/repos/NETMF/netmf-interpreter/subscribers","subscription_url":"https://api.github.com/repos/NETMF/netmf-interpreter/subscription","commits_url":"https://api.github.com/repos/NETMF/netmf-interpreter/commits{/sha}","git_commits_url":"https://api.github.com/repos/NETMF/netmf-interpreter/git/commits{/sha}","comments_url":"https://api.github.com/repos/NETMF/netmf-interpreter/comments{/number}","issue_comment_url":"https://api.github.com/repos/NETMF/netmf-interpreter/issues/comments{/number}","contents_url":"https://api.github.com/repos/NETMF/netmf-interpreter/contents/{+path}","compare_url":"https://api.github.com/repos/NETMF/netmf-interpreter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NETMF/netmf-interpreter/merges","archive_url":"https://api.github.com/repos/NETMF/netmf-interpreter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NETMF/netmf-interpreter/downloads","issues_url":"https://api.github.com/repos/NETMF/netmf-interpreter/issues{/number}","pulls_url":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls{/number}","milestones_url":"https://api.github.com/repos/NETMF/netmf-interpreter/milestones{/number}","notifications_url":"https://api.github.com/repos/NETMF/netmf-interpreter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NETMF/netmf-interpreter/labels{/name}","releases_url":"https://api.github.com/repos/NETMF/netmf-interpreter/releases{/id}","created_at":"2015-03-09T19:50:43Z","updated_at":"2015-05-11T05:50:21Z","pushed_at":"2015-05-10T17:52:45Z","git_url":"git://github.com/NETMF/netmf-interpreter.git","ssh_url":"git@github.com:NETMF/netmf-interpreter.git","clone_url":"https://github.com/NETMF/netmf-interpreter.git","svn_url":"https://github.com/NETMF/netmf-interpreter","homepage":"http://netmf.github.io/netmf-interpreter/","size":15415,"stargazers_count":97,"watchers_count":97,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":16,"forks":38,"open_issues":16,"watchers":97,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97"},"html":{"href":"https://github.com/NETMF/netmf-interpreter/pull/97"},"issue":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/issues/97"},"comments":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/NETMF/netmf-interpreter/statuses/4e30bfac9eb1c072efb9df5c20626afcacae0bcb"}}}}