{"action":"created","comment":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments/194885790","pull_request_review_id":128144937,"id":194885790,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDg4NTc5MA==","diff_hunk":"@@ -0,0 +1,18 @@\n+﻿using Rubberduck.Refactorings;\n+\n+namespace Rubberduck.UI.Refactorings\n+{\n+    public interface IRefactoringDialogFactory\n+    {\n+        TDialog CreateDialog<TModel, TView, TViewModel, TDialog>(TModel model, TViewModel viewmodel)\n+            where TModel : class\n+            where TView : class, IRefactoringView, new()\n+            where TViewModel : class, IRefactoringViewModel<TModel>\n+            where TDialog : class, IRefactoringDialog<TModel, TView, TViewModel>;\n+        void ReleaseDialog(IRefactoringDialog dialog);","path":"Rubberduck.Core/UI/Refactorings/IRefactoringDialogFactory.cs","position":12,"original_position":12,"commit_id":"7cd7fd05b902790dfea0835a05b7b95a37bd8418","original_commit_id":"7cd7fd05b902790dfea0835a05b7b95a37bd8418","user":{"login":"bclothier","id":2367644,"node_id":"MDQ6VXNlcjIzNjc2NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2367644?v=4","gravatar_id":"","url":"https://api.github.com/users/bclothier","html_url":"https://github.com/bclothier","followers_url":"https://api.github.com/users/bclothier/followers","following_url":"https://api.github.com/users/bclothier/following{/other_user}","gists_url":"https://api.github.com/users/bclothier/gists{/gist_id}","starred_url":"https://api.github.com/users/bclothier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclothier/subscriptions","organizations_url":"https://api.github.com/users/bclothier/orgs","repos_url":"https://api.github.com/users/bclothier/repos","events_url":"https://api.github.com/users/bclothier/events{/privacy}","received_events_url":"https://api.github.com/users/bclothier/received_events","type":"User","site_admin":false},"body":"BTW, one more background info that may help --- originally I had the factory with generics at the top but that put us in the awkward of needing to specifying all the type parameters in the refactoring class, meaning it's now tightly coupled which is no good. \r\n\r\nBy moving the type parameters out of the interface and into the creation method, it becomes easier to substitute the appropriate type. For example, `RenameRefactoring` only need to specify `IRenamePresenter` interface to create it as [seen here](https://github.com/rubberduck-vba/Rubberduck/pull/4072/files/7cd7fd05b902790dfea0835a05b7b95a37bd8418#diff-3aef8b9d20776e2c4da2e947148823f6R85) and CW is able to locate the correct implementation to [this concrete presenter](https://github.com/rubberduck-vba/Rubberduck/pull/4072/files/7cd7fd05b902790dfea0835a05b7b95a37bd8418#diff-e6ab9c62b77591f8b71cf1d0c2071b94R7) without specifying the generics at all inside the refactoring class.","created_at":"2018-06-12T20:55:07Z","updated_at":"2018-06-12T20:55:07Z","html_url":"https://github.com/rubberduck-vba/Rubberduck/pull/4072#discussion_r194885790","pull_request_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments/194885790"},"html":{"href":"https://github.com/rubberduck-vba/Rubberduck/pull/4072#discussion_r194885790"},"pull_request":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072"}},"in_reply_to_id":194820419},"pull_request":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072","id":194071991,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0MDcxOTkx","html_url":"https://github.com/rubberduck-vba/Rubberduck/pull/4072","diff_url":"https://github.com/rubberduck-vba/Rubberduck/pull/4072.diff","patch_url":"https://github.com/rubberduck-vba/Rubberduck/pull/4072.patch","issue_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/4072","number":4072,"state":"open","locked":false,"title":"Refactoring dialog refactor","user":{"login":"bclothier","id":2367644,"node_id":"MDQ6VXNlcjIzNjc2NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2367644?v=4","gravatar_id":"","url":"https://api.github.com/users/bclothier","html_url":"https://github.com/bclothier","followers_url":"https://api.github.com/users/bclothier/followers","following_url":"https://api.github.com/users/bclothier/following{/other_user}","gists_url":"https://api.github.com/users/bclothier/gists{/gist_id}","starred_url":"https://api.github.com/users/bclothier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclothier/subscriptions","organizations_url":"https://api.github.com/users/bclothier/orgs","repos_url":"https://api.github.com/users/bclothier/repos","events_url":"https://api.github.com/users/bclothier/events{/privacy}","received_events_url":"https://api.github.com/users/bclothier/received_events","type":"User","site_admin":false},"body":"This PR Is WIP, pending unit test revisions. However, I want to put up for review by others while I work on the unit tests.\r\n\r\nThe refactor of the refactoring dialogs aims to do the following:\r\n\r\n1) abstract the MVP layer out of the refactoring's concern. In the end, a refactoring class only care about the model and it should be providing a model, and then getting back a model (which may be modified or not) to then proceed with the refactoring.\r\n\r\n2) Move all the logic that don't have to do with UI (e.g. nulling the model) out of presenter factories and into the refactoring, typically set up as `InitializeModel` private method.\r\n\r\n3) Make all refactoring dialogs & presenters use a common generic base to maximize the code reuse, and ensure that all concerns are handled within the view and viewmodel of the MVVM layer.\r\nAll refactoring presenters now derive from `RefactoringPresenterBase<TModel, TDialog, TView, TViewModel>` base. All refactoring dialogs, `RefactoringDialogBase<TModel, TView, TViewModel>`. Refactoring viewmodels for those w/ dialogs derive from `RefactoringViewModel<TModel>`. \r\n\r\nNote that the effort is put in to abstract all the generics away. From the refactoring's POV, they know nothing about the generic types put in because a concrete class is provided. For example, `ExtractInterfaceRefactoring` only needs to ask for `IExtractInterfacePresenter`, which CW will provide the concrete `ExtractInterfacePresenter` class, with all the type arguments provided for.\r\n\r\n4) Make use of CW automagic factory to help with creation of presenter and dialog both to reinforce the separation of concerns between the MVP layer (which should be generic) and the MVVM layer (which usually will be specific to each refactoring).\r\n\r\n5) Remove the `System.Windows.Forms` out of the `Rubberduck.Refactoring` project. I am in the paradoxical position where I need to define the UI interfaces in the project but provide the concretes in the `Rubberduck.Core\\UI\\Refactoring`. \r\n\r\n6) Move the OK and Cancel command for the VM into the base class.\r\n\r\n7) Provide an abstraction for the confirm message in order to decouple the messagebox dependency from the refactoring class, so that it is a strictly a UI dependency rather than a refactoring dependnecy.\r\n\r\nAdditionally fix the splash icon to use the ducky.ico (it wasn't and used the default icon in the taskbar while it's running).\r\n\r\nTODO:\r\n\r\n1) See if we can remove the need to set the captions\r\n2) and likewise the size. I tried to get the dialogs derive from the viewmodel's size but I've found that WPF has a weird notion of what is a \"preferred\" size. :\\ \r\n\r\nResolving the #1 and #2 would remove the need to derive from the `RefactoringDialogBase` and thus can allow direct use of the base class instead for some of the refactoring classes.\r\n\r\n3) Fix up the unit tests. \r\n\r\nAny comments/feedbacks are welcome. ","created_at":"2018-06-11T18:57:34Z","updated_at":"2018-06-12T20:55:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7156f919040815c37acf1c2f98c0f042353122c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":765570372,"node_id":"MDU6TGFiZWw3NjU1NzAzNzI=","url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/PR-Status:%20Review%20Requested","name":"PR-Status: Review Requested","color":"584daf","default":false},{"id":765543834,"node_id":"MDU6TGFiZWw3NjU1NDM4MzQ=","url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/PR-Status:%20WIP","name":"PR-Status: WIP","color":"584daf","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072/commits","review_comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072/comments","review_comment_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/4072/comments","statuses_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/statuses/7cd7fd05b902790dfea0835a05b7b95a37bd8418","head":{"label":"bclothier:RefactoringDialogRefactor","ref":"RefactoringDialogRefactor","sha":"7cd7fd05b902790dfea0835a05b7b95a37bd8418","user":{"login":"bclothier","id":2367644,"node_id":"MDQ6VXNlcjIzNjc2NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2367644?v=4","gravatar_id":"","url":"https://api.github.com/users/bclothier","html_url":"https://github.com/bclothier","followers_url":"https://api.github.com/users/bclothier/followers","following_url":"https://api.github.com/users/bclothier/following{/other_user}","gists_url":"https://api.github.com/users/bclothier/gists{/gist_id}","starred_url":"https://api.github.com/users/bclothier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclothier/subscriptions","organizations_url":"https://api.github.com/users/bclothier/orgs","repos_url":"https://api.github.com/users/bclothier/repos","events_url":"https://api.github.com/users/bclothier/events{/privacy}","received_events_url":"https://api.github.com/users/bclothier/received_events","type":"User","site_admin":false},"repo":{"id":102542787,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI1NDI3ODc=","name":"Rubberduck","full_name":"bclothier/Rubberduck","owner":{"login":"bclothier","id":2367644,"node_id":"MDQ6VXNlcjIzNjc2NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2367644?v=4","gravatar_id":"","url":"https://api.github.com/users/bclothier","html_url":"https://github.com/bclothier","followers_url":"https://api.github.com/users/bclothier/followers","following_url":"https://api.github.com/users/bclothier/following{/other_user}","gists_url":"https://api.github.com/users/bclothier/gists{/gist_id}","starred_url":"https://api.github.com/users/bclothier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclothier/subscriptions","organizations_url":"https://api.github.com/users/bclothier/orgs","repos_url":"https://api.github.com/users/bclothier/repos","events_url":"https://api.github.com/users/bclothier/events{/privacy}","received_events_url":"https://api.github.com/users/bclothier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bclothier/Rubberduck","description":"Every programmer needs a rubberduck. COM add-in for the VBA IDE (VBE).","fork":true,"url":"https://api.github.com/repos/bclothier/Rubberduck","forks_url":"https://api.github.com/repos/bclothier/Rubberduck/forks","keys_url":"https://api.github.com/repos/bclothier/Rubberduck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bclothier/Rubberduck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bclothier/Rubberduck/teams","hooks_url":"https://api.github.com/repos/bclothier/Rubberduck/hooks","issue_events_url":"https://api.github.com/repos/bclothier/Rubberduck/issues/events{/number}","events_url":"https://api.github.com/repos/bclothier/Rubberduck/events","assignees_url":"https://api.github.com/repos/bclothier/Rubberduck/assignees{/user}","branches_url":"https://api.github.com/repos/bclothier/Rubberduck/branches{/branch}","tags_url":"https://api.github.com/repos/bclothier/Rubberduck/tags","blobs_url":"https://api.github.com/repos/bclothier/Rubberduck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bclothier/Rubberduck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bclothier/Rubberduck/git/refs{/sha}","trees_url":"https://api.github.com/repos/bclothier/Rubberduck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bclothier/Rubberduck/statuses/{sha}","languages_url":"https://api.github.com/repos/bclothier/Rubberduck/languages","stargazers_url":"https://api.github.com/repos/bclothier/Rubberduck/stargazers","contributors_url":"https://api.github.com/repos/bclothier/Rubberduck/contributors","subscribers_url":"https://api.github.com/repos/bclothier/Rubberduck/subscribers","subscription_url":"https://api.github.com/repos/bclothier/Rubberduck/subscription","commits_url":"https://api.github.com/repos/bclothier/Rubberduck/commits{/sha}","git_commits_url":"https://api.github.com/repos/bclothier/Rubberduck/git/commits{/sha}","comments_url":"https://api.github.com/repos/bclothier/Rubberduck/comments{/number}","issue_comment_url":"https://api.github.com/repos/bclothier/Rubberduck/issues/comments{/number}","contents_url":"https://api.github.com/repos/bclothier/Rubberduck/contents/{+path}","compare_url":"https://api.github.com/repos/bclothier/Rubberduck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bclothier/Rubberduck/merges","archive_url":"https://api.github.com/repos/bclothier/Rubberduck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bclothier/Rubberduck/downloads","issues_url":"https://api.github.com/repos/bclothier/Rubberduck/issues{/number}","pulls_url":"https://api.github.com/repos/bclothier/Rubberduck/pulls{/number}","milestones_url":"https://api.github.com/repos/bclothier/Rubberduck/milestones{/number}","notifications_url":"https://api.github.com/repos/bclothier/Rubberduck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bclothier/Rubberduck/labels{/name}","releases_url":"https://api.github.com/repos/bclothier/Rubberduck/releases{/id}","deployments_url":"https://api.github.com/repos/bclothier/Rubberduck/deployments","created_at":"2017-09-06T00:21:49Z","updated_at":"2017-09-06T00:21:55Z","pushed_at":"2018-06-12T01:19:40Z","git_url":"git://github.com/bclothier/Rubberduck.git","ssh_url":"git@github.com:bclothier/Rubberduck.git","clone_url":"https://github.com/bclothier/Rubberduck.git","svn_url":"https://github.com/bclothier/Rubberduck","homepage":"","size":63697,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"next"}},"base":{"label":"rubberduck-vba:next","ref":"next","sha":"669a8a27ec9e56fe97cfcaea0536cbc222a0bf95","user":{"login":"rubberduck-vba","id":12832254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODMyMjU0","avatar_url":"https://avatars0.githubusercontent.com/u/12832254?v=4","gravatar_id":"","url":"https://api.github.com/users/rubberduck-vba","html_url":"https://github.com/rubberduck-vba","followers_url":"https://api.github.com/users/rubberduck-vba/followers","following_url":"https://api.github.com/users/rubberduck-vba/following{/other_user}","gists_url":"https://api.github.com/users/rubberduck-vba/gists{/gist_id}","starred_url":"https://api.github.com/users/rubberduck-vba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubberduck-vba/subscriptions","organizations_url":"https://api.github.com/users/rubberduck-vba/orgs","repos_url":"https://api.github.com/users/rubberduck-vba/repos","events_url":"https://api.github.com/users/rubberduck-vba/events{/privacy}","received_events_url":"https://api.github.com/users/rubberduck-vba/received_events","type":"Organization","site_admin":false},"repo":{"id":25800128,"node_id":"MDEwOlJlcG9zaXRvcnkyNTgwMDEyOA==","name":"Rubberduck","full_name":"rubberduck-vba/Rubberduck","owner":{"login":"rubberduck-vba","id":12832254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODMyMjU0","avatar_url":"https://avatars0.githubusercontent.com/u/12832254?v=4","gravatar_id":"","url":"https://api.github.com/users/rubberduck-vba","html_url":"https://github.com/rubberduck-vba","followers_url":"https://api.github.com/users/rubberduck-vba/followers","following_url":"https://api.github.com/users/rubberduck-vba/following{/other_user}","gists_url":"https://api.github.com/users/rubberduck-vba/gists{/gist_id}","starred_url":"https://api.github.com/users/rubberduck-vba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubberduck-vba/subscriptions","organizations_url":"https://api.github.com/users/rubberduck-vba/orgs","repos_url":"https://api.github.com/users/rubberduck-vba/repos","events_url":"https://api.github.com/users/rubberduck-vba/events{/privacy}","received_events_url":"https://api.github.com/users/rubberduck-vba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubberduck-vba/Rubberduck","description":"Every programmer needs a rubberduck. COM add-in for the VBA IDE (VBE).","fork":false,"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck","forks_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/forks","keys_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/teams","hooks_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/hooks","issue_events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/events{/number}","events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/events","assignees_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/assignees{/user}","branches_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/branches{/branch}","tags_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/tags","blobs_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/statuses/{sha}","languages_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/languages","stargazers_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/stargazers","contributors_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/contributors","subscribers_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/subscribers","subscription_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/subscription","commits_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/contents/{+path}","compare_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/merges","archive_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/downloads","issues_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues{/number}","pulls_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls{/number}","milestones_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/milestones{/number}","notifications_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels{/name}","releases_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/releases{/id}","deployments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/deployments","created_at":"2014-10-27T02:35:11Z","updated_at":"2018-06-12T11:51:29Z","pushed_at":"2018-06-12T11:49:39Z","git_url":"git://github.com/rubberduck-vba/Rubberduck.git","ssh_url":"git@github.com:rubberduck-vba/Rubberduck.git","clone_url":"https://github.com/rubberduck-vba/Rubberduck.git","svn_url":"https://github.com/rubberduck-vba/Rubberduck","homepage":"","size":63693,"stargazers_count":597,"watchers_count":597,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":691,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":157,"open_issues":691,"watchers":597,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072"},"html":{"href":"https://github.com/rubberduck-vba/Rubberduck/pull/4072"},"issue":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/4072"},"comments":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/4072/comments"},"review_comments":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072/comments"},"review_comment":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/pulls/4072/commits"},"statuses":{"href":"https://api.github.com/repos/rubberduck-vba/Rubberduck/statuses/7cd7fd05b902790dfea0835a05b7b95a37bd8418"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bclothier"}}