{"action":"created","comment":{"url":"https://api.github.com/repos/LongoMatch/longomatch/pulls/comments/115194252","pull_request_review_id":36713188,"id":115194252,"diff_hunk":"@@ -0,0 +1,110 @@\n+﻿//\n+//  Copyright (C) 2017 Fluendo S.A.\n+using System;\n+using System.Linq;\n+using LongoMatch.Core.Store;\n+using LongoMatch.Core.ViewModel;\n+using LongoMatch.Services.State;\n+using LongoMatch.Services.ViewModel;\n+using VAS.Core.Events;\n+using VAS.Core.Interfaces.MVVMC;\n+using VAS.Core.MVVMC;\n+\n+namespace LongoMatch.Services.Controller\n+{\n+\t[Controller (SubstitutionsEditorState.NAME)]\n+\tpublic class SubstitutionsEditorController : ControllerBase\n+\t{\n+\t\tSubstitutionsEditorVM substitutionEditor;\n+\t\tLMPlayerVM taggedPlayer;\n+\n+\t\tpublic override void Start ()\n+\t\t{\n+\t\t\tbase.Start ();\n+\t\t\tApp.Current.EventsBroker.Subscribe<UpdateEvent<SubstitutionEvent>> (HandleSaveSubstitutionEvent);\n+\t\t\tApp.Current.EventsBroker.Subscribe<UpdateEvent<LineupEvent>> (HandleSaveLineupEvent);\n+\t\t\tif (substitutionEditor != null) {\n+\t\t\t\tsubstitutionEditor.PropertyChanged += HandleViewModelPropertyChanged;\n+\t\t\t}\n+\t\t}\n+\n+\t\tpublic override void Stop ()\n+\t\t{\n+\t\t\tbase.Stop ();\n+\t\t\tApp.Current.EventsBroker.Unsubscribe<UpdateEvent<SubstitutionEvent>> (HandleSaveSubstitutionEvent);\n+\t\t\tApp.Current.EventsBroker.Unsubscribe<UpdateEvent<LineupEvent>> (HandleSaveLineupEvent);\n+\t\t\tif (substitutionEditor != null) {\n+\t\t\t\tsubstitutionEditor.PropertyChanged -= HandleViewModelPropertyChanged;\n+\t\t\t}\n+\t\t}\n+\n+\t\tpublic override void SetViewModel (IViewModel viewModel)\n+\t\t{\n+\t\t\tsubstitutionEditor = (SubstitutionsEditorVM)viewModel;\n+\t\t}\n+\n+\t\tvoid SwitchPlayers ()\n+\t\t{\n+\t\t\tLMPlayerVM inOutPlayer = null;\n+\t\t\tif (substitutionEditor.InPlayer.Tagged) {\n+\t\t\t\tinOutPlayer = substitutionEditor.InPlayer;\n+\t\t\t}\n+\t\t\tif (substitutionEditor.OutPlayer.Tagged) {\n+\t\t\t\tinOutPlayer = substitutionEditor.OutPlayer;\n+\t\t\t}\n+\n+\t\t\tif (inOutPlayer != null && taggedPlayer != null) {\n+\t\t\t\tinOutPlayer.Tagged = false;\n+\t\t\t\ttaggedPlayer.Tagged = false;\n+\t\t\t\tinOutPlayer.Model = taggedPlayer.Model;\n+\t\t\t\ttaggedPlayer = null;\n+\t\t\t}\n+\t\t}\n+\n+\t\tvoid HandleViewModelPropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)\n+\t\t{\n+\t\t\tif (!substitutionEditor.LineupMode) {\n+\t\t\t\tif (e.PropertyName == \"Tagged\") {\n+\t\t\t\t\tvar player = sender as LMPlayerVM;\n+\t\t\t\t\tif (player != null) {","path":"LongoMatch.Services/Controller/SubstitutionsEditorController.cs","position":74,"original_position":69,"commit_id":"f12d927c2e97cf7cfe85b8aed1c2a11b341c246f","original_commit_id":"cbe3d73949b27b02a744e907391877848aff44d8","user":{"login":"vmartos","id":10826413,"avatar_url":"https://avatars3.githubusercontent.com/u/10826413?v=3","gravatar_id":"","url":"https://api.github.com/users/vmartos","html_url":"https://github.com/vmartos","followers_url":"https://api.github.com/users/vmartos/followers","following_url":"https://api.github.com/users/vmartos/following{/other_user}","gists_url":"https://api.github.com/users/vmartos/gists{/gist_id}","starred_url":"https://api.github.com/users/vmartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmartos/subscriptions","organizations_url":"https://api.github.com/users/vmartos/orgs","repos_url":"https://api.github.com/users/vmartos/repos","events_url":"https://api.github.com/users/vmartos/events{/privacy}","received_events_url":"https://api.github.com/users/vmartos/received_events","type":"User","site_admin":false},"body":"A cast should always performed anyway, I prefer this logic here","created_at":"2017-05-08T08:10:30Z","updated_at":"2017-05-08T08:10:30Z","html_url":"https://github.com/LongoMatch/longomatch/pull/218#discussion_r115194252","pull_request_url":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218","_links":{"self":{"href":"https://api.github.com/repos/LongoMatch/longomatch/pulls/comments/115194252"},"html":{"href":"https://github.com/LongoMatch/longomatch/pull/218#discussion_r115194252"},"pull_request":{"href":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218"}}},"pull_request":{"url":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218","id":118705492,"html_url":"https://github.com/LongoMatch/longomatch/pull/218","diff_url":"https://github.com/LongoMatch/longomatch/pull/218.diff","patch_url":"https://github.com/LongoMatch/longomatch/pull/218.patch","issue_url":"https://api.github.com/repos/LongoMatch/longomatch/issues/218","number":218,"state":"open","locked":false,"title":"Lon 959","user":{"login":"vmartos","id":10826413,"avatar_url":"https://avatars3.githubusercontent.com/u/10826413?v=3","gravatar_id":"","url":"https://api.github.com/users/vmartos","html_url":"https://github.com/vmartos","followers_url":"https://api.github.com/users/vmartos/followers","following_url":"https://api.github.com/users/vmartos/following{/other_user}","gists_url":"https://api.github.com/users/vmartos/gists{/gist_id}","starred_url":"https://api.github.com/users/vmartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmartos/subscriptions","organizations_url":"https://api.github.com/users/vmartos/orgs","repos_url":"https://api.github.com/users/vmartos/repos","events_url":"https://api.github.com/users/vmartos/events{/privacy}","received_events_url":"https://api.github.com/users/vmartos/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-05-03T07:41:37Z","updated_at":"2017-05-08T08:10:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe77b4359a09464dca765a929a9263ef02f35119","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218/commits","review_comments_url":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218/comments","review_comment_url":"https://api.github.com/repos/LongoMatch/longomatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LongoMatch/longomatch/issues/218/comments","statuses_url":"https://api.github.com/repos/LongoMatch/longomatch/statuses/f12d927c2e97cf7cfe85b8aed1c2a11b341c246f","head":{"label":"LongoMatch:LON-959","ref":"LON-959","sha":"f12d927c2e97cf7cfe85b8aed1c2a11b341c246f","user":{"login":"LongoMatch","id":17885145,"avatar_url":"https://avatars1.githubusercontent.com/u/17885145?v=3","gravatar_id":"","url":"https://api.github.com/users/LongoMatch","html_url":"https://github.com/LongoMatch","followers_url":"https://api.github.com/users/LongoMatch/followers","following_url":"https://api.github.com/users/LongoMatch/following{/other_user}","gists_url":"https://api.github.com/users/LongoMatch/gists{/gist_id}","starred_url":"https://api.github.com/users/LongoMatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LongoMatch/subscriptions","organizations_url":"https://api.github.com/users/LongoMatch/orgs","repos_url":"https://api.github.com/users/LongoMatch/repos","events_url":"https://api.github.com/users/LongoMatch/events{/privacy}","received_events_url":"https://api.github.com/users/LongoMatch/received_events","type":"Organization","site_admin":false},"repo":{"id":2885436,"name":"longomatch","full_name":"LongoMatch/longomatch","owner":{"login":"LongoMatch","id":17885145,"avatar_url":"https://avatars1.githubusercontent.com/u/17885145?v=3","gravatar_id":"","url":"https://api.github.com/users/LongoMatch","html_url":"https://github.com/LongoMatch","followers_url":"https://api.github.com/users/LongoMatch/followers","following_url":"https://api.github.com/users/LongoMatch/following{/other_user}","gists_url":"https://api.github.com/users/LongoMatch/gists{/gist_id}","starred_url":"https://api.github.com/users/LongoMatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LongoMatch/subscriptions","organizations_url":"https://api.github.com/users/LongoMatch/orgs","repos_url":"https://api.github.com/users/LongoMatch/repos","events_url":"https://api.github.com/users/LongoMatch/events{/privacy}","received_events_url":"https://api.github.com/users/LongoMatch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LongoMatch/longomatch","description":null,"fork":false,"url":"https://api.github.com/repos/LongoMatch/longomatch","forks_url":"https://api.github.com/repos/LongoMatch/longomatch/forks","keys_url":"https://api.github.com/repos/LongoMatch/longomatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LongoMatch/longomatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LongoMatch/longomatch/teams","hooks_url":"https://api.github.com/repos/LongoMatch/longomatch/hooks","issue_events_url":"https://api.github.com/repos/LongoMatch/longomatch/issues/events{/number}","events_url":"https://api.github.com/repos/LongoMatch/longomatch/events","assignees_url":"https://api.github.com/repos/LongoMatch/longomatch/assignees{/user}","branches_url":"https://api.github.com/repos/LongoMatch/longomatch/branches{/branch}","tags_url":"https://api.github.com/repos/LongoMatch/longomatch/tags","blobs_url":"https://api.github.com/repos/LongoMatch/longomatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LongoMatch/longomatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LongoMatch/longomatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/LongoMatch/longomatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LongoMatch/longomatch/statuses/{sha}","languages_url":"https://api.github.com/repos/LongoMatch/longomatch/languages","stargazers_url":"https://api.github.com/repos/LongoMatch/longomatch/stargazers","contributors_url":"https://api.github.com/repos/LongoMatch/longomatch/contributors","subscribers_url":"https://api.github.com/repos/LongoMatch/longomatch/subscribers","subscription_url":"https://api.github.com/repos/LongoMatch/longomatch/subscription","commits_url":"https://api.github.com/repos/LongoMatch/longomatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/LongoMatch/longomatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/LongoMatch/longomatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/LongoMatch/longomatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/LongoMatch/longomatch/contents/{+path}","compare_url":"https://api.github.com/repos/LongoMatch/longomatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LongoMatch/longomatch/merges","archive_url":"https://api.github.com/repos/LongoMatch/longomatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LongoMatch/longomatch/downloads","issues_url":"https://api.github.com/repos/LongoMatch/longomatch/issues{/number}","pulls_url":"https://api.github.com/repos/LongoMatch/longomatch/pulls{/number}","milestones_url":"https://api.github.com/repos/LongoMatch/longomatch/milestones{/number}","notifications_url":"https://api.github.com/repos/LongoMatch/longomatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LongoMatch/longomatch/labels{/name}","releases_url":"https://api.github.com/repos/LongoMatch/longomatch/releases{/id}","deployments_url":"https://api.github.com/repos/LongoMatch/longomatch/deployments","created_at":"2011-11-30T18:49:28Z","updated_at":"2017-03-26T19:31:55Z","pushed_at":"2017-05-08T08:06:32Z","git_url":"git://github.com/LongoMatch/longomatch.git","ssh_url":"git@github.com:LongoMatch/longomatch.git","clone_url":"https://github.com/LongoMatch/longomatch.git","svn_url":"https://github.com/LongoMatch/longomatch","homepage":"","size":166010,"stargazers_count":4,"watchers_count":4,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":4,"default_branch":"master"}},"base":{"label":"LongoMatch:master","ref":"master","sha":"1f27abf620b8c95bf320c764e0b9f8d2ee98244c","user":{"login":"LongoMatch","id":17885145,"avatar_url":"https://avatars1.githubusercontent.com/u/17885145?v=3","gravatar_id":"","url":"https://api.github.com/users/LongoMatch","html_url":"https://github.com/LongoMatch","followers_url":"https://api.github.com/users/LongoMatch/followers","following_url":"https://api.github.com/users/LongoMatch/following{/other_user}","gists_url":"https://api.github.com/users/LongoMatch/gists{/gist_id}","starred_url":"https://api.github.com/users/LongoMatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LongoMatch/subscriptions","organizations_url":"https://api.github.com/users/LongoMatch/orgs","repos_url":"https://api.github.com/users/LongoMatch/repos","events_url":"https://api.github.com/users/LongoMatch/events{/privacy}","received_events_url":"https://api.github.com/users/LongoMatch/received_events","type":"Organization","site_admin":false},"repo":{"id":2885436,"name":"longomatch","full_name":"LongoMatch/longomatch","owner":{"login":"LongoMatch","id":17885145,"avatar_url":"https://avatars1.githubusercontent.com/u/17885145?v=3","gravatar_id":"","url":"https://api.github.com/users/LongoMatch","html_url":"https://github.com/LongoMatch","followers_url":"https://api.github.com/users/LongoMatch/followers","following_url":"https://api.github.com/users/LongoMatch/following{/other_user}","gists_url":"https://api.github.com/users/LongoMatch/gists{/gist_id}","starred_url":"https://api.github.com/users/LongoMatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LongoMatch/subscriptions","organizations_url":"https://api.github.com/users/LongoMatch/orgs","repos_url":"https://api.github.com/users/LongoMatch/repos","events_url":"https://api.github.com/users/LongoMatch/events{/privacy}","received_events_url":"https://api.github.com/users/LongoMatch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LongoMatch/longomatch","description":null,"fork":false,"url":"https://api.github.com/repos/LongoMatch/longomatch","forks_url":"https://api.github.com/repos/LongoMatch/longomatch/forks","keys_url":"https://api.github.com/repos/LongoMatch/longomatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LongoMatch/longomatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LongoMatch/longomatch/teams","hooks_url":"https://api.github.com/repos/LongoMatch/longomatch/hooks","issue_events_url":"https://api.github.com/repos/LongoMatch/longomatch/issues/events{/number}","events_url":"https://api.github.com/repos/LongoMatch/longomatch/events","assignees_url":"https://api.github.com/repos/LongoMatch/longomatch/assignees{/user}","branches_url":"https://api.github.com/repos/LongoMatch/longomatch/branches{/branch}","tags_url":"https://api.github.com/repos/LongoMatch/longomatch/tags","blobs_url":"https://api.github.com/repos/LongoMatch/longomatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LongoMatch/longomatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LongoMatch/longomatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/LongoMatch/longomatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LongoMatch/longomatch/statuses/{sha}","languages_url":"https://api.github.com/repos/LongoMatch/longomatch/languages","stargazers_url":"https://api.github.com/repos/LongoMatch/longomatch/stargazers","contributors_url":"https://api.github.com/repos/LongoMatch/longomatch/contributors","subscribers_url":"https://api.github.com/repos/LongoMatch/longomatch/subscribers","subscription_url":"https://api.github.com/repos/LongoMatch/longomatch/subscription","commits_url":"https://api.github.com/repos/LongoMatch/longomatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/LongoMatch/longomatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/LongoMatch/longomatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/LongoMatch/longomatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/LongoMatch/longomatch/contents/{+path}","compare_url":"https://api.github.com/repos/LongoMatch/longomatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LongoMatch/longomatch/merges","archive_url":"https://api.github.com/repos/LongoMatch/longomatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LongoMatch/longomatch/downloads","issues_url":"https://api.github.com/repos/LongoMatch/longomatch/issues{/number}","pulls_url":"https://api.github.com/repos/LongoMatch/longomatch/pulls{/number}","milestones_url":"https://api.github.com/repos/LongoMatch/longomatch/milestones{/number}","notifications_url":"https://api.github.com/repos/LongoMatch/longomatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LongoMatch/longomatch/labels{/name}","releases_url":"https://api.github.com/repos/LongoMatch/longomatch/releases{/id}","deployments_url":"https://api.github.com/repos/LongoMatch/longomatch/deployments","created_at":"2011-11-30T18:49:28Z","updated_at":"2017-03-26T19:31:55Z","pushed_at":"2017-05-08T08:06:32Z","git_url":"git://github.com/LongoMatch/longomatch.git","ssh_url":"git@github.com:LongoMatch/longomatch.git","clone_url":"https://github.com/LongoMatch/longomatch.git","svn_url":"https://github.com/LongoMatch/longomatch","homepage":"","size":166010,"stargazers_count":4,"watchers_count":4,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218"},"html":{"href":"https://github.com/LongoMatch/longomatch/pull/218"},"issue":{"href":"https://api.github.com/repos/LongoMatch/longomatch/issues/218"},"comments":{"href":"https://api.github.com/repos/LongoMatch/longomatch/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/LongoMatch/longomatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LongoMatch/longomatch/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/LongoMatch/longomatch/statuses/f12d927c2e97cf7cfe85b8aed1c2a11b341c246f"}}}}
{"actor":{"display_login":"vmartos"}}