{"action":"created","comment":{"url":"https://api.github.com/repos/Midova/mcounter/pulls/comments/93568824","pull_request_review_id":14097960,"id":93568824,"diff_hunk":"@@ -1,12 +1,158 @@\n-﻿using System;\n-using System.Collections.Generic;\n-using System.Linq;\n-using System.Text;\n-using System.Threading.Tasks;\n+﻿using Catel.MVVM;\n+using MoneyCounter.Services;\n+using System.IO;\n+using System.Windows.Input;\n+using System;\n+using Catel.Data;\n \n namespace MoneyCounter\n {\n-\tpublic class MainViewModel\n-\t{\n+\t/// <summary>\n+\t/// Класс, работы с главным окном.\n+\t/// </summary>\n+\tpublic class MainViewModel : ObservableObject\n+\t{\t\t\n+\t\tpublic MainViewModel(IOpenProjectFileService fileOpenDialogService,\n+\t\t\tISaveProjectFileService fileSaveDialogService, IConfirmationRequestService confirmationRequestService)\n+\t\t{\n+\t\t\t_FileOpenDialogService = fileOpenDialogService;\n+\t\t\t_FileSaveDialogService = fileSaveDialogService;\n+\t\t\t_ConfirmationRequestService = confirmationRequestService;\n+\t\t\tSession = new Session();\n+\n+\t\t\tLoadSessionCommand = new Command(LoadSession);\n+\t\t\tSaveSessionCommand = new Command(SaveSession, ChangedSession);\n+\t\t\tSaveAsSessionCommand = new Command(SaveAsSession);\n+\n+\t\t\tCloseSessionCommand = new Command(CloseSession, CanCloseSession);\n+\n+\t\t\tPropertyChanged += MainViewModel_PropertyChanged;\t\t\n+\t\t}\n+\n+\t\tprivate void MainViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n+\t\t{\n+\t\t\t((Command)CloseSessionCommand).RaiseCanExecuteChanged();\n+\t\t}\n+\n+\t\t#region Infrastructure\n+\n+\t\t/// <summary>\n+\t\t/// Сервис загрузки данных из файла.\n+\t\t/// </summary>\n+\t\tprivate IOpenProjectFileService _FileOpenDialogService;\n+\n+\t\t/// <summary>\n+\t\t/// Сервис сохранения данных в файл.\n+\t\t/// </summary>\n+\t\tprivate ISaveProjectFileService _FileSaveDialogService;\n+\n+\t\t/// <summary>\n+\t\t/// Сервис работы с окном сообщений.\n+\t\t/// </summary>\n+\t\tprivate IConfirmationRequestService _ConfirmationRequestService;\n+\t\t#endregion\n+\n+\t\t/// <summary>\n+\t\t/// Текущая загруженная сессия.\n+\t\t/// </summary>\n+\t\tpublic Session Session { get; private set; }\n+\t\t\n+\t\t/// <summary>\n+\t\t/// Получает обработчик загрузки проекта из файла.\n+\t\t/// </summary>\n+\t\tpublic ICommand LoadSessionCommand { get; private set; }\n+\n+\t\t/// <summary>\n+\t\t/// Загрузка проекта из файла.\n+\t\t/// </summary>\n+\t\tprivate void LoadSession()\n+\t\t{\n+\t\t\tstring path;\n+\t\t\tvar result = _FileOpenDialogService.OpenProjectFile(out path);\n+\n+\t\t\tif (result != true)\n+\t\t\t\treturn;\n+\n+\t\t\tSession.Load(path);\n+\n+\t\t\tSession.FilePath = path;","path":"MoneyCounter/MoneyCounter/MainViewModel.cs","position":85,"original_position":85,"commit_id":"904a89bc4deb261588aef6f42662e30321eb5669","original_commit_id":"904a89bc4deb261588aef6f42662e30321eb5669","user":{"login":"vladidemidov","id":24290026,"avatar_url":"https://avatars.githubusercontent.com/u/24290026?v=3","gravatar_id":"","url":"https://api.github.com/users/vladidemidov","html_url":"https://github.com/vladidemidov","followers_url":"https://api.github.com/users/vladidemidov/followers","following_url":"https://api.github.com/users/vladidemidov/following{/other_user}","gists_url":"https://api.github.com/users/vladidemidov/gists{/gist_id}","starred_url":"https://api.github.com/users/vladidemidov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladidemidov/subscriptions","organizations_url":"https://api.github.com/users/vladidemidov/orgs","repos_url":"https://api.github.com/users/vladidemidov/repos","events_url":"https://api.github.com/users/vladidemidov/events{/privacy}","received_events_url":"https://api.github.com/users/vladidemidov/received_events","type":"User","site_admin":false},"body":"Это свойство так до сих пор ничем не инициализированно и тут будет явно NullReferenceException. Надо быть внимательнее к тому что выкладываешь. Если нет возможности проетсировать в реальной работе надо покрывать это тестом.","created_at":"2016-12-22T05:40:07Z","updated_at":"2016-12-22T06:04:07Z","html_url":"https://github.com/Midova/mcounter/pull/19#discussion_r93568824","pull_request_url":"https://api.github.com/repos/Midova/mcounter/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/Midova/mcounter/pulls/comments/93568824"},"html":{"href":"https://github.com/Midova/mcounter/pull/19#discussion_r93568824"},"pull_request":{"href":"https://api.github.com/repos/Midova/mcounter/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/Midova/mcounter/pulls/19","id":98623264,"html_url":"https://github.com/Midova/mcounter/pull/19","diff_url":"https://github.com/Midova/mcounter/pull/19.diff","patch_url":"https://github.com/Midova/mcounter/pull/19.patch","issue_url":"https://api.github.com/repos/Midova/mcounter/issues/19","number":19,"state":"open","locked":false,"title":"Feature#18","user":{"login":"Midova","id":21021872,"avatar_url":"https://avatars.githubusercontent.com/u/21021872?v=3","gravatar_id":"","url":"https://api.github.com/users/Midova","html_url":"https://github.com/Midova","followers_url":"https://api.github.com/users/Midova/followers","following_url":"https://api.github.com/users/Midova/following{/other_user}","gists_url":"https://api.github.com/users/Midova/gists{/gist_id}","starred_url":"https://api.github.com/users/Midova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Midova/subscriptions","organizations_url":"https://api.github.com/users/Midova/orgs","repos_url":"https://api.github.com/users/Midova/repos","events_url":"https://api.github.com/users/Midova/events{/privacy}","received_events_url":"https://api.github.com/users/Midova/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-19T19:18:04Z","updated_at":"2016-12-22T06:04:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5a596e4f85ee182184ada766136203e10b0af3c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Midova/mcounter/pulls/19/commits","review_comments_url":"https://api.github.com/repos/Midova/mcounter/pulls/19/comments","review_comment_url":"https://api.github.com/repos/Midova/mcounter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Midova/mcounter/issues/19/comments","statuses_url":"https://api.github.com/repos/Midova/mcounter/statuses/904a89bc4deb261588aef6f42662e30321eb5669","head":{"label":"Midova:feature#18","ref":"feature#18","sha":"904a89bc4deb261588aef6f42662e30321eb5669","user":{"login":"Midova","id":21021872,"avatar_url":"https://avatars.githubusercontent.com/u/21021872?v=3","gravatar_id":"","url":"https://api.github.com/users/Midova","html_url":"https://github.com/Midova","followers_url":"https://api.github.com/users/Midova/followers","following_url":"https://api.github.com/users/Midova/following{/other_user}","gists_url":"https://api.github.com/users/Midova/gists{/gist_id}","starred_url":"https://api.github.com/users/Midova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Midova/subscriptions","organizations_url":"https://api.github.com/users/Midova/orgs","repos_url":"https://api.github.com/users/Midova/repos","events_url":"https://api.github.com/users/Midova/events{/privacy}","received_events_url":"https://api.github.com/users/Midova/received_events","type":"User","site_admin":false},"repo":{"id":75209138,"name":"mcounter","full_name":"Midova/mcounter","owner":{"login":"Midova","id":21021872,"avatar_url":"https://avatars.githubusercontent.com/u/21021872?v=3","gravatar_id":"","url":"https://api.github.com/users/Midova","html_url":"https://github.com/Midova","followers_url":"https://api.github.com/users/Midova/followers","following_url":"https://api.github.com/users/Midova/following{/other_user}","gists_url":"https://api.github.com/users/Midova/gists{/gist_id}","starred_url":"https://api.github.com/users/Midova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Midova/subscriptions","organizations_url":"https://api.github.com/users/Midova/orgs","repos_url":"https://api.github.com/users/Midova/repos","events_url":"https://api.github.com/users/Midova/events{/privacy}","received_events_url":"https://api.github.com/users/Midova/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Midova/mcounter","description":null,"fork":false,"url":"https://api.github.com/repos/Midova/mcounter","forks_url":"https://api.github.com/repos/Midova/mcounter/forks","keys_url":"https://api.github.com/repos/Midova/mcounter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Midova/mcounter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Midova/mcounter/teams","hooks_url":"https://api.github.com/repos/Midova/mcounter/hooks","issue_events_url":"https://api.github.com/repos/Midova/mcounter/issues/events{/number}","events_url":"https://api.github.com/repos/Midova/mcounter/events","assignees_url":"https://api.github.com/repos/Midova/mcounter/assignees{/user}","branches_url":"https://api.github.com/repos/Midova/mcounter/branches{/branch}","tags_url":"https://api.github.com/repos/Midova/mcounter/tags","blobs_url":"https://api.github.com/repos/Midova/mcounter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Midova/mcounter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Midova/mcounter/git/refs{/sha}","trees_url":"https://api.github.com/repos/Midova/mcounter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Midova/mcounter/statuses/{sha}","languages_url":"https://api.github.com/repos/Midova/mcounter/languages","stargazers_url":"https://api.github.com/repos/Midova/mcounter/stargazers","contributors_url":"https://api.github.com/repos/Midova/mcounter/contributors","subscribers_url":"https://api.github.com/repos/Midova/mcounter/subscribers","subscription_url":"https://api.github.com/repos/Midova/mcounter/subscription","commits_url":"https://api.github.com/repos/Midova/mcounter/commits{/sha}","git_commits_url":"https://api.github.com/repos/Midova/mcounter/git/commits{/sha}","comments_url":"https://api.github.com/repos/Midova/mcounter/comments{/number}","issue_comment_url":"https://api.github.com/repos/Midova/mcounter/issues/comments{/number}","contents_url":"https://api.github.com/repos/Midova/mcounter/contents/{+path}","compare_url":"https://api.github.com/repos/Midova/mcounter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Midova/mcounter/merges","archive_url":"https://api.github.com/repos/Midova/mcounter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Midova/mcounter/downloads","issues_url":"https://api.github.com/repos/Midova/mcounter/issues{/number}","pulls_url":"https://api.github.com/repos/Midova/mcounter/pulls{/number}","milestones_url":"https://api.github.com/repos/Midova/mcounter/milestones{/number}","notifications_url":"https://api.github.com/repos/Midova/mcounter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Midova/mcounter/labels{/name}","releases_url":"https://api.github.com/repos/Midova/mcounter/releases{/id}","deployments_url":"https://api.github.com/repos/Midova/mcounter/deployments","created_at":"2016-11-30T17:11:12Z","updated_at":"2016-11-30T17:31:48Z","pushed_at":"2016-12-21T18:40:37Z","git_url":"git://github.com/Midova/mcounter.git","ssh_url":"git@github.com:Midova/mcounter.git","clone_url":"https://github.com/Midova/mcounter.git","svn_url":"https://github.com/Midova/mcounter","homepage":null,"size":95,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Midova:master","ref":"master","sha":"fa889ff671d5bda74fc3314c5c9ae634e0581eb8","user":{"login":"Midova","id":21021872,"avatar_url":"https://avatars.githubusercontent.com/u/21021872?v=3","gravatar_id":"","url":"https://api.github.com/users/Midova","html_url":"https://github.com/Midova","followers_url":"https://api.github.com/users/Midova/followers","following_url":"https://api.github.com/users/Midova/following{/other_user}","gists_url":"https://api.github.com/users/Midova/gists{/gist_id}","starred_url":"https://api.github.com/users/Midova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Midova/subscriptions","organizations_url":"https://api.github.com/users/Midova/orgs","repos_url":"https://api.github.com/users/Midova/repos","events_url":"https://api.github.com/users/Midova/events{/privacy}","received_events_url":"https://api.github.com/users/Midova/received_events","type":"User","site_admin":false},"repo":{"id":75209138,"name":"mcounter","full_name":"Midova/mcounter","owner":{"login":"Midova","id":21021872,"avatar_url":"https://avatars.githubusercontent.com/u/21021872?v=3","gravatar_id":"","url":"https://api.github.com/users/Midova","html_url":"https://github.com/Midova","followers_url":"https://api.github.com/users/Midova/followers","following_url":"https://api.github.com/users/Midova/following{/other_user}","gists_url":"https://api.github.com/users/Midova/gists{/gist_id}","starred_url":"https://api.github.com/users/Midova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Midova/subscriptions","organizations_url":"https://api.github.com/users/Midova/orgs","repos_url":"https://api.github.com/users/Midova/repos","events_url":"https://api.github.com/users/Midova/events{/privacy}","received_events_url":"https://api.github.com/users/Midova/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Midova/mcounter","description":null,"fork":false,"url":"https://api.github.com/repos/Midova/mcounter","forks_url":"https://api.github.com/repos/Midova/mcounter/forks","keys_url":"https://api.github.com/repos/Midova/mcounter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Midova/mcounter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Midova/mcounter/teams","hooks_url":"https://api.github.com/repos/Midova/mcounter/hooks","issue_events_url":"https://api.github.com/repos/Midova/mcounter/issues/events{/number}","events_url":"https://api.github.com/repos/Midova/mcounter/events","assignees_url":"https://api.github.com/repos/Midova/mcounter/assignees{/user}","branches_url":"https://api.github.com/repos/Midova/mcounter/branches{/branch}","tags_url":"https://api.github.com/repos/Midova/mcounter/tags","blobs_url":"https://api.github.com/repos/Midova/mcounter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Midova/mcounter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Midova/mcounter/git/refs{/sha}","trees_url":"https://api.github.com/repos/Midova/mcounter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Midova/mcounter/statuses/{sha}","languages_url":"https://api.github.com/repos/Midova/mcounter/languages","stargazers_url":"https://api.github.com/repos/Midova/mcounter/stargazers","contributors_url":"https://api.github.com/repos/Midova/mcounter/contributors","subscribers_url":"https://api.github.com/repos/Midova/mcounter/subscribers","subscription_url":"https://api.github.com/repos/Midova/mcounter/subscription","commits_url":"https://api.github.com/repos/Midova/mcounter/commits{/sha}","git_commits_url":"https://api.github.com/repos/Midova/mcounter/git/commits{/sha}","comments_url":"https://api.github.com/repos/Midova/mcounter/comments{/number}","issue_comment_url":"https://api.github.com/repos/Midova/mcounter/issues/comments{/number}","contents_url":"https://api.github.com/repos/Midova/mcounter/contents/{+path}","compare_url":"https://api.github.com/repos/Midova/mcounter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Midova/mcounter/merges","archive_url":"https://api.github.com/repos/Midova/mcounter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Midova/mcounter/downloads","issues_url":"https://api.github.com/repos/Midova/mcounter/issues{/number}","pulls_url":"https://api.github.com/repos/Midova/mcounter/pulls{/number}","milestones_url":"https://api.github.com/repos/Midova/mcounter/milestones{/number}","notifications_url":"https://api.github.com/repos/Midova/mcounter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Midova/mcounter/labels{/name}","releases_url":"https://api.github.com/repos/Midova/mcounter/releases{/id}","deployments_url":"https://api.github.com/repos/Midova/mcounter/deployments","created_at":"2016-11-30T17:11:12Z","updated_at":"2016-11-30T17:31:48Z","pushed_at":"2016-12-21T18:40:37Z","git_url":"git://github.com/Midova/mcounter.git","ssh_url":"git@github.com:Midova/mcounter.git","clone_url":"https://github.com/Midova/mcounter.git","svn_url":"https://github.com/Midova/mcounter","homepage":null,"size":95,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Midova/mcounter/pulls/19"},"html":{"href":"https://github.com/Midova/mcounter/pull/19"},"issue":{"href":"https://api.github.com/repos/Midova/mcounter/issues/19"},"comments":{"href":"https://api.github.com/repos/Midova/mcounter/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/Midova/mcounter/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/Midova/mcounter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Midova/mcounter/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/Midova/mcounter/statuses/904a89bc4deb261588aef6f42662e30321eb5669"}}}}
{"actor":{"display_login":"vladidemidov"}}