{"action":"created","comment":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/26552766","id":26552766,"diff_hunk":"@@ -0,0 +1,144 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Diagnostics;\n+using System.IO;\n+using System.Linq;\n+using System.Reflection;\n+using System.Text;\n+using System.Xml.Serialization;\n+using Dynamo.Models;\n+using ProtoCore.Lang;\n+\n+namespace Dynamo.Core\n+{\n+    public struct FileVersion\n+    {\n+        public readonly int MajorPart;\n+        public readonly int MinorPart;\n+\n+        public FileVersion(int majorPart, int minorPart)\n+        {\n+            MajorPart = majorPart;\n+            MinorPart = minorPart;\n+        }\n+    }\n+\n+    /// <summary>\n+    /// Base class for all versions of Dynamo classes relating to\n+    /// migrating preferences, packages and definitions from older versions\n+    /// </summary>\n+    internal abstract class DynamoMigratorBase\n+    {\n+        protected readonly string rootFolder;\n+\n+        /// <summary>\n+        /// Returns the path to the user AppData directory for the current version\n+        /// </summary>\n+        public string CurrentVersionPath\n+        {\n+            get\n+            {\n+                return Path.Combine(rootFolder, String.Format(\"{0}.{1}\", DynamoVersion.MajorPart, DynamoVersion.MinorPart));\n+            }\n+        }\n+\n+        public abstract FileVersion DynamoVersion { get; }\n+        \n+        protected DynamoMigratorBase()\n+        {\n+        }\n+\n+        protected DynamoMigratorBase(string rootFolder)\n+        {\n+            this.rootFolder = rootFolder;\n+        }\n+\n+        /// <summary>\n+        /// Reads the preference settings for the currently installed Dynamo version\n+        /// </summary>\n+        /// <returns> preference settings full file path </returns>\n+        public abstract string ReadPreferences();\n+\n+        /// <summary>\n+        /// Reads preference settings from input file and deserializes it into \n+        /// PreferenceSettings object in memory\n+        /// </summary>\n+        /// <param name=\"preferenceSettingsFilePath\"></param>\n+        /// <returns> returns the deserialized settings object </returns>\n+        public abstract PreferenceSettings WritePreferences(string preferenceSettingsFilePath);\n+    }\n+\n+    internal class DynamoMigrator07 : DynamoMigratorBase\n+    {\n+        public override FileVersion DynamoVersion\n+        {\n+            get { return new FileVersion(0, 7); }\n+        }\n+        \n+        public DynamoMigrator07()\n+        {\n+        }\n+\n+        public DynamoMigrator07(string rootFolder) : base(rootFolder)\n+        {\n+        }\n+        \n+        public override string ReadPreferences()\n+        {\n+            const string preferenceSettingsFileName = \"DynamoSettings.xml\";","path":"src/DynamoCore/Core/DynamoMigrator.cs","position":88,"original_position":88,"commit_id":"db96ce6fa88ac666614d0875d0561643e00f8572","original_commit_id":"db96ce6fa88ac666614d0875d0561643e00f8572","user":{"login":"Benglin","id":5086849,"avatar_url":"https://avatars.githubusercontent.com/u/5086849?v=3","gravatar_id":"","url":"https://api.github.com/users/Benglin","html_url":"https://github.com/Benglin","followers_url":"https://api.github.com/users/Benglin/followers","following_url":"https://api.github.com/users/Benglin/following{/other_user}","gists_url":"https://api.github.com/users/Benglin/gists{/gist_id}","starred_url":"https://api.github.com/users/Benglin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Benglin/subscriptions","organizations_url":"https://api.github.com/users/Benglin/orgs","repos_url":"https://api.github.com/users/Benglin/repos","events_url":"https://api.github.com/users/Benglin/events{/privacy}","received_events_url":"https://api.github.com/users/Benglin/received_events","type":"User","site_admin":false},"body":"Let me expose these from `PathManager` for you, hang on.","created_at":"2015-03-17T07:00:40Z","updated_at":"2015-03-17T07:00:40Z","html_url":"https://github.com/DynamoDS/Dynamo/pull/4004#discussion_r26552766","pull_request_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004","_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/26552766"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/4004#discussion_r26552766"},"pull_request":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004"}}},"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004","id":31310397,"html_url":"https://github.com/DynamoDS/Dynamo/pull/4004","diff_url":"https://github.com/DynamoDS/Dynamo/pull/4004.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/4004.patch","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4004","number":4004,"state":"open","locked":false,"title":"Added migration to copy settings over from previous versions","user":{"login":"aparajit-pratap","id":5710686,"avatar_url":"https://avatars.githubusercontent.com/u/5710686?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajit-pratap","html_url":"https://github.com/aparajit-pratap","followers_url":"https://api.github.com/users/aparajit-pratap/followers","following_url":"https://api.github.com/users/aparajit-pratap/following{/other_user}","gists_url":"https://api.github.com/users/aparajit-pratap/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajit-pratap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajit-pratap/subscriptions","organizations_url":"https://api.github.com/users/aparajit-pratap/orgs","repos_url":"https://api.github.com/users/aparajit-pratap/repos","events_url":"https://api.github.com/users/aparajit-pratap/events{/privacy}","received_events_url":"https://api.github.com/users/aparajit-pratap/received_events","type":"User","site_admin":false},"body":"Refer PR: https://github.com/DynamoDS/Dynamo/pull/3994\r\n\r\n@Benglin PTAL","created_at":"2015-03-17T06:29:35Z","updated_at":"2015-03-17T07:00:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f246016159fe1d6f0d59798e00a093b7d119f14","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004/commits","review_comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004/comments","review_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4004/comments","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/db96ce6fa88ac666614d0875d0561643e00f8572","head":{"label":"aparajit-pratap:migratePrefPartTwo","ref":"migratePrefPartTwo","sha":"db96ce6fa88ac666614d0875d0561643e00f8572","user":{"login":"aparajit-pratap","id":5710686,"avatar_url":"https://avatars.githubusercontent.com/u/5710686?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajit-pratap","html_url":"https://github.com/aparajit-pratap","followers_url":"https://api.github.com/users/aparajit-pratap/followers","following_url":"https://api.github.com/users/aparajit-pratap/following{/other_user}","gists_url":"https://api.github.com/users/aparajit-pratap/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajit-pratap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajit-pratap/subscriptions","organizations_url":"https://api.github.com/users/aparajit-pratap/orgs","repos_url":"https://api.github.com/users/aparajit-pratap/repos","events_url":"https://api.github.com/users/aparajit-pratap/events{/privacy}","received_events_url":"https://api.github.com/users/aparajit-pratap/received_events","type":"User","site_admin":false},"repo":{"id":15271868,"name":"Dynamo","full_name":"aparajit-pratap/Dynamo","owner":{"login":"aparajit-pratap","id":5710686,"avatar_url":"https://avatars.githubusercontent.com/u/5710686?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajit-pratap","html_url":"https://github.com/aparajit-pratap","followers_url":"https://api.github.com/users/aparajit-pratap/followers","following_url":"https://api.github.com/users/aparajit-pratap/following{/other_user}","gists_url":"https://api.github.com/users/aparajit-pratap/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajit-pratap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajit-pratap/subscriptions","organizations_url":"https://api.github.com/users/aparajit-pratap/orgs","repos_url":"https://api.github.com/users/aparajit-pratap/repos","events_url":"https://api.github.com/users/aparajit-pratap/events{/privacy}","received_events_url":"https://api.github.com/users/aparajit-pratap/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aparajit-pratap/Dynamo","description":"Visual Programming For Revit","fork":true,"url":"https://api.github.com/repos/aparajit-pratap/Dynamo","forks_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/forks","keys_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/teams","hooks_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/events","assignees_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/tags","blobs_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/languages","stargazers_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/subscription","commits_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/merges","archive_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/downloads","issues_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/aparajit-pratap/Dynamo/releases{/id}","created_at":"2013-12-18T02:34:41Z","updated_at":"2014-11-20T02:55:13Z","pushed_at":"2015-03-17T06:27:55Z","git_url":"git://github.com/aparajit-pratap/Dynamo.git","ssh_url":"git@github.com:aparajit-pratap/Dynamo.git","clone_url":"https://github.com/aparajit-pratap/Dynamo.git","svn_url":"https://github.com/aparajit-pratap/Dynamo","homepage":"http://dynamobim.org","size":780105,"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":"master"}},"base":{"label":"DynamoDS:master","ref":"master","sha":"40f99db5fdf9ed1f072b9bb1a68094e770f7eb6b","user":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"repo":{"id":3395179,"name":"Dynamo","full_name":"DynamoDS/Dynamo","owner":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoDS/Dynamo","description":"Visual Programming","fork":false,"url":"https://api.github.com/repos/DynamoDS/Dynamo","forks_url":"https://api.github.com/repos/DynamoDS/Dynamo/forks","keys_url":"https://api.github.com/repos/DynamoDS/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoDS/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoDS/Dynamo/teams","hooks_url":"https://api.github.com/repos/DynamoDS/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/events","assignees_url":"https://api.github.com/repos/DynamoDS/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoDS/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/tags","blobs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoDS/Dynamo/languages","stargazers_url":"https://api.github.com/repos/DynamoDS/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/DynamoDS/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscription","commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoDS/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoDS/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoDS/Dynamo/merges","archive_url":"https://api.github.com/repos/DynamoDS/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoDS/Dynamo/downloads","issues_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoDS/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoDS/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/DynamoDS/Dynamo/releases{/id}","created_at":"2012-02-09T07:35:33Z","updated_at":"2015-03-17T05:14:55Z","pushed_at":"2015-03-17T05:14:55Z","git_url":"git://github.com/DynamoDS/Dynamo.git","ssh_url":"git@github.com:DynamoDS/Dynamo.git","clone_url":"https://github.com/DynamoDS/Dynamo.git","svn_url":"https://github.com/DynamoDS/Dynamo","homepage":"http://dynamobim.org","size":898443,"stargazers_count":204,"watchers_count":204,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":145,"mirror_url":null,"open_issues_count":555,"forks":145,"open_issues":555,"watchers":204,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/4004"},"issue":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4004"},"comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4004/comments"},"review_comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004/comments"},"review_comment":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4004/commits"},"statuses":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/db96ce6fa88ac666614d0875d0561643e00f8572"}}}}