├── .editorconfig ├── .gitattributes ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── Checklist.md ├── GitHubExtension.Test ├── AssemblySetup.cs ├── Converters │ ├── EnumToStringConverterTest.cs │ ├── MarkdownConverterTest.cs │ └── StringToColorConverterTest.cs ├── GitHubExtension.Test.csproj ├── Mocks │ ├── AddCommentMock.cs │ ├── GitHubApiMock.cs │ ├── IssueEditorMock.cs │ ├── LoginViewMock.cs │ ├── OptionsProviderMock.cs │ ├── OutputWriterMock.cs │ └── ResponseMock.cs ├── Model │ ├── AuthenticationHelpersTest.cs │ ├── CacheTest.cs │ ├── CredentialCacheTest.cs │ ├── GitHubApiBaseTest.cs │ ├── RepositoryHelperTest.cs │ └── RepositoryWrapperTest.cs ├── Modules │ └── MocksModule.cs ├── OutputWriterTests.cs ├── Properties │ └── AssemblyInfo.cs ├── Styles │ └── StyleLoaderTests.cs ├── ViewModel │ ├── AddCommentTest.cs │ ├── IssueEditorTest.cs │ ├── IssueListRefreshTest.cs │ ├── IssueListTest.cs │ ├── IssueTest.cs │ ├── LoginTest.cs │ └── UserTest.cs ├── app.config └── packages.config ├── GitHubExtension.sln ├── GitHubExtension.sln.DotSettings ├── GitHubExtension ├── Fonts │ └── fontawesome-webfont.ttf ├── GitHubExtension.csproj ├── GitHubExtension.vsct ├── GitHubExtensionPackage.cs ├── GlobalSuppressions.cs ├── Guids.cs ├── Interfaces │ ├── IAddComment.cs │ ├── IAvatar.cs │ ├── IClosable.cs │ ├── IDialogWindow.cs │ ├── IEnableable.cs │ ├── IIssueEditor.cs │ ├── IIssueToolWindow.cs │ ├── IIssueViewer.cs │ ├── ILabel.cs │ ├── ILabelPicker.cs │ └── ILoginView.cs ├── IssueListToolWindow.cs ├── IssueToolWindow.cs ├── License.rtf ├── Modules │ ├── UtilityModules.cs │ ├── ViewModelModule.cs │ └── ViewModule.cs ├── NLog.config ├── PkgCmdID.cs ├── Properties │ └── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Resources │ ├── Images.png │ ├── Package.ico │ └── Preview.png ├── VSPackage.resx ├── View │ ├── AddComment.xaml │ ├── AddComment.xaml.cs │ ├── Avatar.xaml │ ├── Avatar.xaml.cs │ ├── Controls │ │ ├── IssueListItem.xaml │ │ ├── IssueListItem.xaml.cs │ │ ├── LabelControl.xaml │ │ ├── LabelControl.xaml.cs │ │ ├── UserView.xaml │ │ ├── UserView.xaml.cs │ │ ├── WatermarkAdorner.cs │ │ └── WatermarkService.cs │ ├── Issue.xaml │ ├── Issue.xaml.cs │ ├── IssueEditor.xaml │ ├── IssueEditor.xaml.cs │ ├── IssueList.xaml │ ├── IssueList.xaml.cs │ ├── LabelPicker.xaml │ ├── LabelPicker.xaml.cs │ ├── LightTheme.xaml │ ├── Login.xaml │ ├── Login.xaml.cs │ ├── OutputWriter.cs │ ├── RelayCommand.cs │ ├── Theme.cs │ ├── Theme.xaml │ ├── VisualStudioMessageBox.cs │ └── WebBrowserBehavior.cs ├── ViewModel │ ├── AddCommentViewModel.cs │ ├── AvatarViewModel.cs │ ├── BaseGitHubViewModel.cs │ ├── BaseUserViewModel.cs │ ├── BaseViewModel.cs │ ├── IssueEditorViewModel.cs │ ├── IssueListViewModel.cs │ ├── IssueViewModel.cs │ ├── LabelModel.cs │ ├── LoginViewModel.cs │ └── UserViewModel.cs ├── app.config ├── packages.config └── source.extension.vsixmanifest ├── GitHubIssues ├── Converters │ ├── ColorExtensions.cs │ ├── EnumToStringConverter.cs │ ├── MarkdownConverter.cs │ ├── StringToColorConverter.cs │ └── StringToInverseColorConverter.cs ├── Extensions │ ├── ControlExtensions.cs │ ├── ObservableExtensions.cs │ └── ServiceProviderExtensions.cs ├── Factory.cs ├── Filters │ ├── RepositoryFilter.cs │ ├── UserFilter.cs │ └── UserFilterType.cs ├── GitHub.ico ├── GitHubIssues.csproj ├── Interfaces │ └── IOptionsProvider.cs ├── Logging │ ├── BaseOutputWriter.cs │ ├── IOutputWriter.cs │ └── LogLevel.cs ├── Model │ ├── AuthenticationHelpers.cs │ ├── Cache.cs │ ├── CredentialCache.cs │ ├── GitHubApi.cs │ ├── GitHubApiBase.cs │ ├── ICache.cs │ ├── OptionsPage.cs │ ├── RepositoryHelper.cs │ ├── RepositoryWrapper.cs │ └── Secrets.cs ├── Modules │ └── GitHubModule.cs ├── Properties │ ├── Annotations.cs │ ├── AssemblyInfo.cs │ ├── AssemblyInfoCommon.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Styles │ ├── IssueTheme.cs │ ├── StyleLoader.cs │ ├── dark_theme.css │ └── light_theme.css ├── app.config └── packages.config ├── LICENSE ├── README.md ├── images ├── issue.png ├── issue_list.png └── logon.png └── packages └── repositories.config /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org# top-most EditorConfig file 2 | 3 | root = true 4 | end_of_line = crlf 5 | insert_final_newline = false 6 | indent_style = space 7 | 8 | [*.cs] 9 | indent_size = 4 10 | 11 | [*.{xml,vsixmanifest,config,csproj}] 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | 65 | # Resharper DotSettings files are in Unix Format 66 | *.DotSettings text eol=lf 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | .vs 9 | 10 | # Build results 11 | 12 | [Dd]ebug/ 13 | [Rr]elease/ 14 | x64/ 15 | build/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | 19 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 20 | !packages/*/build/ 21 | 22 | # MSTest test Results 23 | [Tt]est[Rr]esult*/ 24 | [Bb]uild[Ll]og.* 25 | 26 | *_i.c 27 | *_p.c 28 | *.ilk 29 | *.meta 30 | *.obj 31 | *.pch 32 | *.pdb 33 | *.pgc 34 | *.pgd 35 | *.rsp 36 | *.sbr 37 | *.tlb 38 | *.tli 39 | *.tlh 40 | *.tmp 41 | *.tmp_proj 42 | *.log 43 | *.vspscc 44 | *.vssscc 45 | .builds 46 | *.pidb 47 | *.log 48 | *.scc 49 | 50 | # Visual C++ cache files 51 | ipch/ 52 | *.aps 53 | *.ncb 54 | *.opensdf 55 | *.sdf 56 | *.cachefile 57 | 58 | # Visual C# cache files 59 | *.sln.ide/ 60 | 61 | # Visual Studio profiler 62 | *.psess 63 | *.vsp 64 | *.vspx 65 | 66 | # Guidance Automation Toolkit 67 | *.gpState 68 | 69 | # ReSharper is a .NET coding add-in 70 | _ReSharper*/ 71 | *.[Rr]e[Ss]harper 72 | 73 | # TeamCity is a build add-in 74 | _TeamCity* 75 | 76 | # DotCover is a Code Coverage Tool 77 | *.dotCover 78 | 79 | # NCrunch 80 | *.ncrunch* 81 | .*crunch*.local.xml 82 | 83 | # Installshield output folder 84 | [Ee]xpress/ 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish/ 98 | 99 | # Publish Web Output 100 | *.Publish.xml 101 | 102 | # NuGet Packages Directory 103 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 104 | #packages/ 105 | 106 | # Windows Azure Build Output 107 | csx 108 | *.build.csdef 109 | 110 | # Windows Store app package directory 111 | AppPackages/ 112 | 113 | # Others 114 | sql/ 115 | *.Cache 116 | ClientBin/ 117 | [Ss]tyle[Cc]op.* 118 | ~$* 119 | *~ 120 | *.dbmdl 121 | *.[Pp]ublish.xml 122 | *.pfx 123 | *.publishsettings 124 | 125 | # RIA/Silverlight projects 126 | Generated_Code/ 127 | 128 | # Backup & report files from converting an old project file to a newer 129 | # Visual Studio version. Backup files are not needed, because we have git ;-) 130 | _UpgradeReport_Files/ 131 | Backup*/ 132 | UpgradeLog*.XML 133 | UpgradeLog*.htm 134 | 135 | # SQL Server files 136 | App_Data/*.mdf 137 | App_Data/*.ldf 138 | 139 | 140 | #LightSwitch generated files 141 | GeneratedArtifacts/ 142 | _Pvt_Extensions/ 143 | ModelManifest.xml 144 | 145 | # ========================= 146 | # Windows detritus 147 | # ========================= 148 | 149 | # Windows image file caches 150 | Thumbs.db 151 | ehthumbs.db 152 | 153 | # Folder config file 154 | Desktop.ini 155 | 156 | # Recycle Bin used on file shares 157 | $RECYCLE.BIN/ 158 | 159 | # Mac desktop service store files 160 | .DS_Store 161 | 162 | #Nuget Packages 163 | packages/ 164 | !packages/repositories.config 165 | 166 | GitHubExtension/ViewModel/LocalMachine/ 167 | README.html 168 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/.gitmodules -------------------------------------------------------------------------------- /Checklist.md: -------------------------------------------------------------------------------- 1 | # Release Checklist 2 | 3 | ## Build 4 | 5 | - On Master branch 6 | - Git fetch and pull to get latest 7 | - Secrets.cs has the keys set 8 | - Version is updated in all locations 9 | - Release build 10 | - Clean and full rebuild 11 | 12 | ## Test 13 | 14 | - All unit tests pass 15 | - Install in VS 2103 and 2015 16 | - Smoke test walk-through of the application 17 | 18 | ## Release 19 | 20 | - Update the changelog 21 | - All completed issues are assigned to the milestone 22 | - Close the milestone 23 | - Create release on GitHub 24 | - Update the VS Extensions website 25 | - Upload release to VS Gallery 26 | -------------------------------------------------------------------------------- /GitHubExtension.Test/AssemblySetup.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System.Reflection; 26 | using Alteridem.GitHub.Extension.ViewModel; 27 | using NUnit.Framework; 28 | 29 | namespace Alteridem.GitHub.Extension.Test 30 | { 31 | [SetUpFixture] 32 | public class AssemblySetup 33 | { 34 | [OneTimeSetUp] 35 | public void SetUp() 36 | { 37 | Factory.AddAssembly(Assembly.GetAssembly(typeof(BaseGitHubViewModel))); 38 | Factory.AddAssembly(Assembly.GetExecutingAssembly()); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Converters/EnumToStringConverterTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.Globalization; 29 | using System.Runtime.InteropServices; 30 | using Alteridem.GitHub.Converters; 31 | using NUnit.Framework; 32 | 33 | #endregion 34 | 35 | namespace Alteridem.GitHub.Extension.Test.Converters 36 | { 37 | [TestFixture] 38 | public class EnumToStringConverterTest 39 | { 40 | private readonly EnumToStringConverter _converter = new EnumToStringConverter(); 41 | 42 | public enum TestEnum 43 | { 44 | None, 45 | ThreeBlindMice 46 | } 47 | 48 | [TestCase(TestEnum.None, "None")] 49 | [TestCase(TestEnum.ThreeBlindMice, "Three Blind Mice")] 50 | public void CanConvertEnumToString(TestEnum value, string expected) 51 | { 52 | Assert.That(_converter.Convert(value, typeof(string), null, CultureInfo.InvariantCulture), Is.EqualTo(expected)); 53 | } 54 | 55 | [TestCase(TestEnum.None, "None")] 56 | [TestCase(TestEnum.ThreeBlindMice, "Three Blind Mice")] 57 | public void CanConvertStringToEnum(TestEnum expected, string value) 58 | { 59 | Assert.That(_converter.ConvertBack(value, typeof(TestEnum), null, CultureInfo.InvariantCulture), Is.EqualTo(expected)); 60 | } 61 | 62 | [Test] 63 | public void NullConvertsToEmptyString() 64 | { 65 | Assert.That(_converter.Convert(null, typeof(string), null, CultureInfo.InvariantCulture), Is.EqualTo(string.Empty)); 66 | } 67 | 68 | [Test] 69 | public void NullValueThrowsArgumentNullExceptions() 70 | { 71 | Assert.That(() => _converter.ConvertBack(null, typeof(string), null, CultureInfo.InvariantCulture), Throws.InstanceOf()); 72 | } 73 | 74 | [Test] 75 | public void NotEnumTypeThrowsArgumentExceptions() 76 | { 77 | Assert.That(() => _converter.ConvertBack("Three Blind Mice", typeof(int), null, CultureInfo.InvariantCulture), Throws.ArgumentException); 78 | } 79 | 80 | [Test] 81 | public void InvalidEnumValueThrowsFormatException() 82 | { 83 | Assert.That(() => _converter.ConvertBack("Bad Value", typeof(TestEnum), null, CultureInfo.InvariantCulture), Throws.ArgumentException); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /GitHubExtension.Test/Converters/MarkdownConverterTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.Globalization; 29 | using Alteridem.GitHub.Converters; 30 | using NUnit.Framework; 31 | using Alteridem.GitHub.Styles; 32 | using Alteridem.GitHub.Interfaces; 33 | 34 | #endregion 35 | 36 | namespace Alteridem.GitHub.Extension.Test.Converters 37 | { 38 | [TestFixture] 39 | public class MarkdownConverterTest 40 | { 41 | [Test] 42 | public void TestConvert([Values]IssueTheme theme) 43 | { 44 | var options = Factory.Get(); 45 | Assert.That(options, Is.Not.Null); 46 | Assert.That(options.Options, Is.Not.Null); 47 | 48 | options.Options.IssueTheme = theme; 49 | 50 | var converter = new MarkdownConverter(); 51 | string html = converter.Convert("##Header##", typeof(string), null, CultureInfo.CurrentCulture) as string; 52 | Assert.That(html, Is.Not.Null); 53 | Assert.That(html, Contains.Substring("

Header

")); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Converters/StringToColorConverterTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.Globalization; 29 | using System.Windows.Media; 30 | using Alteridem.GitHub.Converters; 31 | using NUnit.Framework; 32 | using NUnit.Framework.Constraints; 33 | 34 | #endregion 35 | 36 | namespace Alteridem.GitHub.Extension.Test.Converters 37 | { 38 | [TestFixture] 39 | public class StringToColorConverterTest 40 | { 41 | [TestCase("FF0000", 0xFF, 0x00, 0x00)] 42 | [TestCase("FFFFFF", 0xFF, 0xFF, 0xFF)] 43 | [TestCase("336699", 0x33, 0x66, 0x99)] 44 | [TestCase("FFF", 0xFF, 0xFF, 0xFF)] 45 | public void TestColorConversion(string str, byte r, byte g, byte b) 46 | { 47 | var converter = new StringToColorConverter(); 48 | var result = converter.Convert(str, typeof(SolidColorBrush), null, CultureInfo.CurrentCulture) as SolidColorBrush; 49 | Assert.That(result, Is.Not.Null); 50 | Assert.That(result.Color.A, Is.EqualTo(0xFF)); 51 | Assert.That(result.Color.R, Is.EqualTo(r)); 52 | Assert.That(result.Color.G, Is.EqualTo(g)); 53 | Assert.That(result.Color.B, Is.EqualTo(b)); 54 | } 55 | 56 | [TestCase("")] 57 | [TestCase("#FFFFFF")] 58 | [TestCase("Red")] 59 | public void TestInvalidColorReturnsTransparent(string str) 60 | { 61 | var converter = new StringToColorConverter(); 62 | var result = converter.Convert(str, typeof(SolidColorBrush), null, CultureInfo.CurrentCulture) as SolidColorBrush; 63 | Assert.That( result, Is.Not.Null ); 64 | Assert.That( result.Color.A, Is.EqualTo( 0x00 ) ); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Mocks/AddCommentMock.cs: -------------------------------------------------------------------------------- 1 | using Alteridem.GitHub.Extension.Interfaces; 2 | using Alteridem.GitHub.Model; 3 | 4 | namespace Alteridem.GitHub.Extension.Test.Mocks 5 | { 6 | public class AddCommentMock : IAddComment 7 | { 8 | public bool? ShowModal() 9 | { 10 | var api = Factory.Get(); 11 | api.AddComment(api.Issue, "new comment"); 12 | return true; 13 | } 14 | 15 | public void Close() 16 | { 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Mocks/IssueEditorMock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Alteridem.GitHub.Extension.Interfaces; 3 | using Alteridem.GitHub.Model; 4 | using Octokit; 5 | 6 | namespace Alteridem.GitHub.Extension.Test.Mocks 7 | { 8 | public class IssueEditorMock : IIssueEditor 9 | { 10 | private Issue _issue; 11 | 12 | public void Close() 13 | { 14 | } 15 | 16 | public bool? ShowModal() 17 | { 18 | _issue = new Issue(null, null, null, _issue.Number, ItemState.Open, "new title", "new body", null, null, null, null, 1, null, null, DateTimeOffset.Now, null); 19 | 20 | var api = Factory.Get(); 21 | api.Issue = _issue; 22 | 23 | return true; 24 | } 25 | 26 | public bool IsEnabled { get; set; } 27 | 28 | /// 29 | /// Sets the issue to add/edit 30 | /// 31 | /// The issue. 32 | public void SetIssue(Issue issue) 33 | { 34 | _issue = issue ?? new Issue(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Mocks/LoginViewMock.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using Alteridem.GitHub.Extension.Interfaces; 26 | using Alteridem.GitHub.Model; 27 | 28 | namespace Alteridem.GitHub.Extension.Test.Mocks 29 | { 30 | public class LoginViewMock : ILoginView 31 | { 32 | public bool? ShowModal() 33 | { 34 | var api = Factory.Get(); 35 | api.Login("user", "pass", null); 36 | return true; 37 | } 38 | 39 | public void Close() 40 | { 41 | } 42 | 43 | public bool IsEnabled { get; set; } 44 | } 45 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Mocks/OptionsProviderMock.cs: -------------------------------------------------------------------------------- 1 | using Alteridem.GitHub.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Alteridem.GitHub.Extension.Test.Mocks 9 | { 10 | public class OptionsProviderMock: IOptionsProvider 11 | { 12 | public OptionsProviderMock() 13 | { 14 | Options = new GitHub.Model.OptionsPage(); 15 | } 16 | 17 | public GitHub.Model.OptionsPage Options { get; private set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /GitHubExtension.Test/Mocks/OutputWriterMock.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Logging; 28 | 29 | #endregion 30 | 31 | namespace Alteridem.GitHub.Extension.Test.Mocks 32 | { 33 | public class OutputWriterMock : BaseOutputWriter 34 | { 35 | public bool WriteMessageCalled { get; set; } 36 | public bool ShowMessageCalled { get; set; } 37 | public string LastMessageWritten { get; set; } 38 | public string LastMessageShown { get; set; } 39 | 40 | /// 41 | /// Logs the specified message. 42 | /// 43 | /// The message. 44 | protected override void WriteMessage(string message) 45 | { 46 | WriteMessageCalled = true; 47 | LastMessageWritten = message; 48 | } 49 | 50 | /// 51 | /// Shows the specified message. 52 | /// 53 | /// The message. 54 | protected override void ShowMessage(string message) 55 | { 56 | ShowMessageCalled = true; 57 | LastMessageShown = message; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /GitHubExtension.Test/Mocks/ResponseMock.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System; 26 | using System.Collections.Generic; 27 | using System.Collections.ObjectModel; 28 | using System.Net; 29 | using Octokit; 30 | 31 | namespace Alteridem.GitHub.Extension.Test.Mocks 32 | { 33 | public class ResponseMock : IResponse 34 | { 35 | public ResponseMock() 36 | { 37 | Headers = new ReadOnlyDictionary(new Dictionary()); 38 | } 39 | public object BodyAsObject { get; set; } 40 | public object Body { get; set; } 41 | public IReadOnlyDictionary Headers { get; private set; } 42 | public Uri ResponseUri { get; set; } 43 | public ApiInfo ApiInfo { get; set; } 44 | public HttpStatusCode StatusCode { get; set; } 45 | public string ContentType { get; set; } 46 | } 47 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Model/AuthenticationHelpersTest.cs: -------------------------------------------------------------------------------- 1 | using Alteridem.GitHub.Model; 2 | using NUnit.Framework; 3 | 4 | namespace Alteridem.GitHub.Extension.Test.Model 5 | { 6 | [TestFixture] 7 | public class AuthenticationHelpersTest 8 | { 9 | [Test] 10 | public void CanGetFingerprint() 11 | { 12 | string fingerprint = AuthenticationHelpers.GetFingerprint(); 13 | Assert.That(fingerprint, Is.Not.Null); 14 | Assert.That(fingerprint, Is.Not.Empty); 15 | } 16 | 17 | [Test] 18 | public void CanGetMachineName() 19 | { 20 | string name = AuthenticationHelpers.GetMachineName(); 21 | Assert.That(name, Is.Not.Null); 22 | Assert.That(name, Is.Not.Empty); 23 | } 24 | 25 | [Test] 26 | public void CanCreateSha256Hash() 27 | { 28 | const string hello = "Hello World"; 29 | var hash = AuthenticationHelpers.Sha256Hash(hello); 30 | Assert.That(hash, Is.Not.Null); 31 | Assert.That(hash, Is.Not.Empty); 32 | Assert.That(hash, Is.Not.EqualTo(hello)); 33 | Assert.That(hash, Is.EqualTo("a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e")); 34 | } 35 | 36 | [Test] 37 | public void CanResolveNetworkInterface() 38 | { 39 | var net = AuthenticationHelpers.GetNetworkInterface(); 40 | Assert.That(net, Is.Not.Null); 41 | Assert.That(net, Is.Not.Empty); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /GitHubExtension.Test/Model/CredentialCacheTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using Alteridem.GitHub.Model; 29 | using NUnit.Framework; 30 | 31 | #endregion 32 | 33 | namespace Alteridem.GitHub.Extension.Test.Model 34 | { 35 | [TestFixture] 36 | public class CredentialCacheTest 37 | { 38 | [Test] 39 | public void TestRoundTrip() 40 | { 41 | var credentials = new CredentialCache { Logon = "user", Password = "password", AccessToken = string.Empty }; 42 | var cache = credentials.ToString(); 43 | Assert.That(cache, Is.Not.Null); 44 | Assert.That(cache, Does.Contain("user")); 45 | Assert.That(cache, Does.Not.Contain("password")); 46 | 47 | var parsed = CredentialCache.FromString(cache); 48 | Assert.That(parsed, Is.Not.Null); 49 | Assert.That(parsed.Logon, Is.EqualTo("user")); 50 | Assert.That(parsed.Password, Is.EqualTo("password")); 51 | Assert.That(parsed.AccessToken, Is.EqualTo(string.Empty)); 52 | } 53 | 54 | [Test] 55 | public void FromNullStringReturnsNull() 56 | { 57 | Assert.That(CredentialCache.FromString(null), Is.Null); 58 | } 59 | 60 | [Test] 61 | public void FromEmptyStringReturnsNull() 62 | { 63 | Assert.That(CredentialCache.FromString(string.Empty), Is.Null); 64 | } 65 | 66 | [Test] 67 | public void FromBlankStringReturnsNull() 68 | { 69 | Assert.That(CredentialCache.FromString(" "), Is.Null); 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Model/RepositoryHelperTest.cs: -------------------------------------------------------------------------------- 1 | using Alteridem.GitHub.Model; 2 | using NUnit.Framework; 3 | using System; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Reflection; 7 | 8 | namespace Alteridem.GitHub.Extension.Test.Model 9 | { 10 | [TestFixture] 11 | public class RepositoryHelperTest 12 | { 13 | [Test] 14 | public void CanGetGitRemotes() 15 | { 16 | // Gets the Git remotes for the repository that this source is 17 | // maintained in. Assumes that one of the remotes is on GitHub 18 | var path = Assembly.GetExecutingAssembly().Location; 19 | var root = RepositoryHelper.GetRemotes(path).ToArray(); 20 | 21 | Assert.That(root, Is.Not.Null); 22 | Assert.That(root.Length, Is.GreaterThan(0)); 23 | } 24 | 25 | [Test] 26 | public void CanFindRootOfRepositoryFromFile() 27 | { 28 | var path = Assembly.GetExecutingAssembly().Location; 29 | var root = RepositoryHelper.FindRepositoryRoot(path); 30 | Assert.That(root, Is.Not.Null); 31 | Assert.That(root, Does.Exist); 32 | } 33 | 34 | [Test] 35 | public void CanFindRootOfRepositoryFromDirectory() 36 | { 37 | var path = Assembly.GetExecutingAssembly().Location; 38 | var file = new FileInfo(path); 39 | path = file.DirectoryName; 40 | 41 | var root = RepositoryHelper.FindRepositoryRoot(path); 42 | Assert.That(root, Is.Not.Null); 43 | Assert.That(root, Does.Exist); 44 | } 45 | 46 | [Test] 47 | public void NotRepositoryReturnsNull() 48 | { 49 | string windowDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows); 50 | Assert.That(windowDir, Is.Not.Null.And.Not.Empty); 51 | 52 | var root = RepositoryHelper.FindRepositoryRoot(windowDir); 53 | Assert.That(root, Is.Null); 54 | } 55 | 56 | [Test] 57 | public void NotValidFileOrDirectoryReturnsNull() 58 | { 59 | var root = RepositoryHelper.FindRepositoryRoot("C:\\Garbage\\Does\\Not\\Exist"); 60 | Assert.That(root, Is.Null); 61 | } 62 | 63 | [TestCase(null)] 64 | [TestCase("")] 65 | [TestCase(" ")] 66 | public void NullOrEmptyPathThrowsAnArgumentException(string path) 67 | { 68 | Assert.That(() => RepositoryHelper.FindRepositoryRoot(path), Throws.ArgumentException); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /GitHubExtension.Test/Model/RepositoryWrapperTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using Alteridem.GitHub.Model; 29 | using NUnit.Framework; 30 | using Octokit; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Extension.Test.Model 35 | { 36 | [TestFixture] 37 | public class RepositoryWrapperTest 38 | { 39 | private RepositoryWrapper _one; 40 | private RepositoryWrapper _two; 41 | private RepositoryWrapper _three; 42 | 43 | [OneTimeSetUp] 44 | public void FixtureSetUp() 45 | { 46 | _one = CreateWrapper(1, "test"); 47 | _two = CreateWrapper(1, "test"); 48 | _three = CreateWrapper(3, "three"); 49 | } 50 | 51 | private RepositoryWrapper CreateWrapper(int id, string name) 52 | { 53 | var repository = new Repository(null, null, null, null, null, null, null, id, null, name, "", "", "", "", 54 | false, false, 0, 0, 0, "master", 1, null, DateTimeOffset.Now, DateTimeOffset.Now, null, null, null, null, 55 | true, true, true); 56 | return new RepositoryWrapper(repository); 57 | 58 | } 59 | 60 | [Test] 61 | public void TestEquals() 62 | { 63 | Assert.That(_one, Is.EqualTo(_two)); 64 | Assert.That(_one.Equals(_two), Is.True); 65 | } 66 | 67 | [Test] 68 | public void TestNotEquals() 69 | { 70 | Assert.That(_one, Is.Not.EqualTo(_three)); 71 | Assert.That(_one.Equals(_three), Is.False); 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Modules/MocksModule.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using Alteridem.GitHub.Extension.Test.Mocks; 26 | using Alteridem.GitHub.Interfaces; 27 | using Alteridem.GitHub.Logging; 28 | using Ninject.Modules; 29 | 30 | namespace Alteridem.GitHub.Extension.Test.Modules 31 | { 32 | public class MocksModule : NinjectModule 33 | { 34 | /// 35 | /// Loads the module into the kernel. 36 | /// 37 | public override void Load() 38 | { 39 | //Rebind().To().InSingletonScope(); 40 | //Rebind().To(); 41 | Rebind().To().InSingletonScope(); 42 | Rebind().To().InSingletonScope(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("GitHubExtension.Test")] 6 | [assembly: AssemblyDescription("Tests for the Visual Studio extension for working with GitHub")] -------------------------------------------------------------------------------- /GitHubExtension.Test/Styles/StyleLoaderTests.cs: -------------------------------------------------------------------------------- 1 | using Alteridem.GitHub.Interfaces; 2 | using Alteridem.GitHub.Styles; 3 | using NUnit.Framework; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Alteridem.GitHub.Extension.Test.Styles 11 | { 12 | [TestFixture] 13 | public class StyleLoaderTests 14 | { 15 | [TestCase("Alteridem.GitHub.Styles.light_theme.css")] 16 | public void CanLoadResource(string resourceName) 17 | { 18 | string css = StyleLoader.LoadResource(resourceName); 19 | Assert.That(css, Is.Not.Null); 20 | Assert.That(css, Is.Not.Empty); 21 | Assert.That(css, Does.Contain("body").IgnoreCase); 22 | } 23 | 24 | [Test] 25 | public void CanLoadCss([Values]IssueTheme theme) 26 | { 27 | var options = Factory.Get(); 28 | Assert.That(options, Is.Not.Null); 29 | Assert.That(options.Options, Is.Not.Null); 30 | 31 | options.Options.IssueTheme = theme; 32 | 33 | string css = StyleLoader.LoadCss(); 34 | Assert.That(css, Is.Not.Null); 35 | Assert.That(css, Is.Not.Empty); 36 | Assert.That(css, Does.Contain("body").IgnoreCase); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /GitHubExtension.Test/ViewModel/IssueListRefreshTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.ComponentModel.Composition.Hosting; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.Test.Mocks; 30 | using Alteridem.GitHub.Extension.ViewModel; 31 | using Alteridem.GitHub.Model; 32 | using NUnit.Framework; 33 | using Moq; 34 | 35 | #endregion 36 | 37 | namespace Alteridem.GitHub.Extension.Test.ViewModel 38 | { 39 | [TestFixture] 40 | public class IssueListRefreshTest 41 | { 42 | private Mock _mockApi; 43 | private IssueListViewModel _viewModel; 44 | 45 | [SetUp] 46 | public void SetUp() 47 | { 48 | var mockCache = new Mock(); 49 | _mockApi = new Mock(mockCache.Object); 50 | Factory.Rebind().ToConstant(_mockApi.Object); 51 | _viewModel = Factory.Get(); 52 | } 53 | 54 | [Test] 55 | public void IssuesAreRefreshed() 56 | { 57 | _viewModel.RefreshCommand.Execute(null); 58 | 59 | _mockApi.Verify(x => x.GetIssues()); 60 | } 61 | 62 | [Test] 63 | public void MilestonesAreRefreshed() 64 | { 65 | _viewModel.RefreshCommand.Execute(null); 66 | 67 | _mockApi.Verify(x => x.GetMilestones()); 68 | } 69 | 70 | [Test] 71 | public void LabelsAreRefreshed() 72 | { 73 | _viewModel.RefreshCommand.Execute(null); 74 | 75 | _mockApi.Verify(x => x.GetLabels()); 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/ViewModel/IssueListTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.ComponentModel.Composition.Hosting; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.Test.Mocks; 30 | using Alteridem.GitHub.Extension.ViewModel; 31 | using Alteridem.GitHub.Model; 32 | using NUnit.Framework; 33 | 34 | #endregion 35 | 36 | namespace Alteridem.GitHub.Extension.Test.ViewModel 37 | { 38 | [TestFixture] 39 | public class IssueListTest 40 | { 41 | private IssueListViewModel _viewModel; 42 | 43 | [SetUp] 44 | public void SetUp() 45 | { 46 | var issuesAssemblyCatalog = new AssemblyCatalog(typeof(Cache).Assembly); 47 | var mockServicesCatalog = new TypeCatalog(typeof(Model.CacheTest.MockServiceProvider)); 48 | var catalog = new AggregateCatalog(issuesAssemblyCatalog, mockServicesCatalog); 49 | var exportProvider = new CompositionContainer(catalog); 50 | 51 | Factory.Rebind().ToConstant(exportProvider.GetExportedValue()); 52 | Factory.Rebind().To().InScope(o => this); 53 | Factory.Rebind().To(); 54 | _viewModel = Factory.Get(); 55 | } 56 | 57 | [Test] 58 | public void CanAddIssueTest() 59 | { 60 | var save = _viewModel.Repository; 61 | _viewModel.Repository = null; 62 | Assert.That(_viewModel.CanAddIssue(), Is.False); 63 | 64 | _viewModel.Repository = save; 65 | Assert.That(_viewModel.CanAddIssue(), Is.True); 66 | } 67 | 68 | [Test] 69 | public void AddIssueTest() 70 | { 71 | Assert.That(_viewModel.Issue, Is.Not.Null); 72 | Assert.That(_viewModel.Issue.Title, Is.Not.EqualTo("new title")); 73 | Assert.That(_viewModel.Issue.Body, Is.Not.EqualTo("new body")); 74 | 75 | _viewModel.AddIssue(); 76 | 77 | Assert.That(_viewModel.Issue, Is.Not.Null); 78 | Assert.That(_viewModel.Issue.Title, Is.EqualTo("new title")); 79 | Assert.That(_viewModel.Issue.Body, Is.EqualTo("new body")); 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/ViewModel/IssueTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.Test.Mocks; 30 | using Alteridem.GitHub.Extension.ViewModel; 31 | using Alteridem.GitHub.Model; 32 | using NUnit.Framework; 33 | 34 | #endregion 35 | 36 | namespace Alteridem.GitHub.Extension.Test.ViewModel 37 | { 38 | [TestFixture] 39 | public class IssueTest 40 | { 41 | private IssueViewModel _gitHubViewModel; 42 | 43 | [SetUp] 44 | public void SetUp() 45 | { 46 | Factory.Rebind().To().InScope(o => this); 47 | Factory.Rebind().To(); 48 | Factory.Rebind().To(); 49 | Factory.Rebind().To(); 50 | _gitHubViewModel = Factory.Get(); 51 | } 52 | 53 | [Test] 54 | public void TestIssue() 55 | { 56 | Assert.That(_gitHubViewModel.Issue, Is.Not.Null); 57 | Assert.That(_gitHubViewModel.Issue.Title, Is.EqualTo("title")); 58 | } 59 | 60 | [Test] 61 | public void TestIssueMarkdown() 62 | { 63 | Assert.That(_gitHubViewModel.IssueMarkdown, Is.EqualTo("##body##")); 64 | } 65 | 66 | [Test] 67 | public void TestCanAddComment() 68 | { 69 | Assert.That(_gitHubViewModel.IssueIsNotNull(), Is.True); 70 | } 71 | 72 | [Test] 73 | public void TestCanEditIssue() 74 | { 75 | Assert.That(_gitHubViewModel.CanEditIssue(), Is.True); 76 | } 77 | 78 | [Test] 79 | public void TestAddComment() 80 | { 81 | var api = Factory.Get(); 82 | api.IssueMarkdown = "body"; 83 | 84 | _gitHubViewModel.AddComment(); 85 | 86 | Assert.That(api.IssueMarkdown, Contains.Substring("new comment")); 87 | } 88 | 89 | [Test] 90 | public void TestEditIssue() 91 | { 92 | var api = Factory.Get(); 93 | Assert.That(api.Issue, Is.Not.Null); 94 | 95 | _gitHubViewModel.EditIssue(); 96 | 97 | Assert.That(api.Issue.Title, Contains.Substring("new title")); 98 | Assert.That(api.Issue.Body, Contains.Substring("new body")); 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/ViewModel/LoginTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.Threading; 29 | using System.Windows.Controls; 30 | using Alteridem.GitHub.Extension.Interfaces; 31 | using Alteridem.GitHub.Extension.Test.Mocks; 32 | using Alteridem.GitHub.Extension.ViewModel; 33 | using Alteridem.GitHub.Model; 34 | using NUnit.Framework; 35 | 36 | #endregion 37 | 38 | namespace Alteridem.GitHub.Extension.Test.ViewModel 39 | { 40 | [TestFixture] 41 | [Apartment(ApartmentState.STA)] 42 | public class LoginTest 43 | { 44 | private LoginViewModel _gitHubViewModel; 45 | 46 | [SetUp] 47 | public void SetUp() 48 | { 49 | Factory.Rebind().To().InScope(o => this); 50 | Factory.Rebind().To(); 51 | _gitHubViewModel = Factory.Get(); 52 | } 53 | 54 | [Test] 55 | public void TestCanLogon() 56 | { 57 | _gitHubViewModel.Username = ""; 58 | Assert.That(_gitHubViewModel.CanLogon(), Is.False); 59 | _gitHubViewModel.Username = "user"; 60 | Assert.That(_gitHubViewModel.CanLogon(), Is.True); 61 | } 62 | 63 | [Test] 64 | public void TestLogon() 65 | { 66 | var api = Factory.Get(); 67 | api.Logout(); 68 | Assert.That(api.LoggedIn, Is.False); 69 | 70 | _gitHubViewModel.Username = "user"; 71 | _gitHubViewModel.Logon(new PasswordBox()); 72 | 73 | Assert.That(api.LoggedIn, Is.True); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/ViewModel/UserTest.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.Test.Mocks; 30 | using Alteridem.GitHub.Extension.ViewModel; 31 | using Alteridem.GitHub.Model; 32 | using NUnit.Framework; 33 | 34 | #endregion 35 | 36 | namespace Alteridem.GitHub.Extension.Test.ViewModel 37 | { 38 | [TestFixture] 39 | public class UserTest 40 | { 41 | private UserViewModel _viewModel; 42 | 43 | [SetUp] 44 | public void SetUp() 45 | { 46 | Factory.Rebind().To().InScope(o => this); 47 | Factory.Rebind().To(); 48 | _viewModel = Factory.Get(); 49 | } 50 | 51 | [Test] 52 | public void TestCanLogin() 53 | { 54 | var api = Factory.Get(); 55 | api.Logout(); 56 | Assert.That(api.LoggedIn, Is.False); 57 | 58 | _viewModel.Login(); 59 | 60 | Assert.That(api.LoggedIn, Is.True); 61 | } 62 | 63 | [Test] 64 | public void TestCanLogout() 65 | { 66 | var api = Factory.Get(); 67 | api.Login("user", "pass", null); 68 | Assert.That(api.LoggedIn, Is.True); 69 | 70 | _viewModel.Login(); 71 | 72 | Assert.That(api.LoggedIn, Is.False); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /GitHubExtension.Test/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /GitHubExtension.Test/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /GitHubExtension.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHubExtension", "GitHubExtension\GitHubExtension.csproj", "{848A709C-6756-4790-BBAE-C13D1C7D496C}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{49156AED-CE96-446A-B09C-3282E05A6F17}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | .gitattributes = .gitattributes 12 | .gitignore = .gitignore 13 | CHANGELOG.md = CHANGELOG.md 14 | Checklist.md = Checklist.md 15 | LICENSE = LICENSE 16 | README.md = README.md 17 | EndProjectSection 18 | EndProject 19 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHubIssues", "GitHubIssues\GitHubIssues.csproj", "{64740CE5-68C6-4B63-B607-831BF8C205F0}" 20 | EndProject 21 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHubExtension.Test", "GitHubExtension.Test\GitHubExtension.Test.csproj", "{CF36DB6C-FA8F-4102-B042-9BC990202DE9}" 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | Debug|Any CPU = Debug|Any CPU 26 | Release|Any CPU = Release|Any CPU 27 | EndGlobalSection 28 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 29 | {848A709C-6756-4790-BBAE-C13D1C7D496C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {848A709C-6756-4790-BBAE-C13D1C7D496C}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {848A709C-6756-4790-BBAE-C13D1C7D496C}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {848A709C-6756-4790-BBAE-C13D1C7D496C}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {64740CE5-68C6-4B63-B607-831BF8C205F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {64740CE5-68C6-4B63-B607-831BF8C205F0}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {64740CE5-68C6-4B63-B607-831BF8C205F0}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {64740CE5-68C6-4B63-B607-831BF8C205F0}.Release|Any CPU.Build.0 = Release|Any CPU 37 | {CF36DB6C-FA8F-4102-B042-9BC990202DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 38 | {CF36DB6C-FA8F-4102-B042-9BC990202DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU 39 | {CF36DB6C-FA8F-4102-B042-9BC990202DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU 40 | {CF36DB6C-FA8F-4102-B042-9BC990202DE9}.Release|Any CPU.Build.0 = Release|Any CPU 41 | EndGlobalSection 42 | GlobalSection(SolutionProperties) = preSolution 43 | HideSolutionNode = FALSE 44 | EndGlobalSection 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /GitHubExtension/Fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/GitHubExtension/Fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /GitHubExtension/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. Project-level 3 | // suppressions either have no target or are given a specific target 4 | // and scoped to a namespace, type, member, etc. 5 | // 6 | // To add a suppression to this file, right-click the message in the 7 | // Error List, point to "Suppress Message(s)", and click "In Project 8 | // Suppression File". You do not need to add suppressions to this 9 | // file manually. 10 | 11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")] 12 | -------------------------------------------------------------------------------- /GitHubExtension/Guids.cs: -------------------------------------------------------------------------------- 1 | // Guids.cs 2 | // MUST match guids.h 3 | 4 | using System; 5 | 6 | namespace Alteridem.GitHub.Extension 7 | { 8 | static class GuidList 9 | { 10 | public const string guidGitHubExtensionPkgString = "dae607b6-043f-400a-bd24-ffda143b13f4"; 11 | public const string guidGitHubExtensionCmdSetString = "bf6a82ac-344c-427e-bafc-77b978131c65"; 12 | public const string guidIssueListWindowPersistanceString = "04baf945-0cc3-4594-87ca-1656d83fdcfe"; 13 | public const string guidIssueWindowPersistanceString = "05AF9426-E44E-404C-9653-0ADE833D1EAD"; 14 | 15 | public static readonly Guid guidGitHubExtensionCmdSet = new Guid(guidGitHubExtensionCmdSetString); 16 | }; 17 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IAddComment.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | namespace Alteridem.GitHub.Extension.Interfaces 25 | { 26 | public interface IAddComment : IDialogWindow, IClosable 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IAvatar.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | namespace Alteridem.GitHub.Extension.Interfaces 25 | { 26 | public interface IAvatar 27 | { 28 | string AvatarUrl { get; set; } 29 | double Size { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IClosable.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | namespace Alteridem.GitHub.Extension.Interfaces 25 | { 26 | public interface IClosable 27 | { 28 | void Close(); 29 | } 30 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IDialogWindow.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | using System.Windows; 25 | 26 | namespace Alteridem.GitHub.Extension.Interfaces 27 | { 28 | /// 29 | /// Wraps the common functions we need from a window 30 | /// 31 | public interface IDialogWindow 32 | { 33 | bool? ShowModal(); 34 | } 35 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IEnableable.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | namespace Alteridem.GitHub.Extension.Interfaces 25 | { 26 | public interface IEnableable 27 | { 28 | bool IsEnabled { get; set; } 29 | } 30 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IIssueEditor.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using Octokit; 26 | 27 | namespace Alteridem.GitHub.Extension.Interfaces 28 | { 29 | public interface IIssueEditor : IClosable, IDialogWindow, IEnableable 30 | { 31 | /// 32 | /// Sets the issue to add/edit 33 | /// 34 | /// The issue. 35 | void SetIssue(Issue issue); 36 | } 37 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IIssueToolWindow.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | namespace Alteridem.GitHub.Extension.Interfaces 25 | { 26 | public interface IIssueToolWindow 27 | { 28 | void Show(); 29 | } 30 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/IIssueViewer.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | namespace Alteridem.GitHub.Extension.Interfaces 26 | { 27 | public interface IIssueViewer : IDialogWindow 28 | { 29 | } 30 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/ILabel.cs: -------------------------------------------------------------------------------- 1 | namespace Alteridem.GitHub.Extension.Interfaces 2 | { 3 | public interface ILabel 4 | { 5 | string Name { get; } 6 | string Color { get; } 7 | } 8 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/ILabelPicker.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Extension.ViewModel; 28 | 29 | #endregion 30 | 31 | namespace Alteridem.GitHub.Extension.Interfaces 32 | { 33 | public interface ILabelPicker : IClosable, IDialogWindow, IEnableable 34 | { 35 | void SetViewModel(IssueEditorViewModel viewModel); 36 | } 37 | } -------------------------------------------------------------------------------- /GitHubExtension/Interfaces/ILoginView.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | namespace Alteridem.GitHub.Extension.Interfaces 25 | { 26 | public interface ILoginView : IDialogWindow, IClosable, IEnableable 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /GitHubExtension/IssueListToolWindow.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Runtime.InteropServices; 28 | using Alteridem.GitHub.Extension.View; 29 | using Microsoft.VisualStudio.Shell; 30 | 31 | #endregion 32 | 33 | namespace Alteridem.GitHub.Extension 34 | { 35 | /// 36 | /// This class implements the tool window exposed by this package and hosts a user control. 37 | /// 38 | /// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane, 39 | /// usually implemented by the package implementer. 40 | /// 41 | /// This class derives from the ToolWindowPane class provided from the MPF in order to use its 42 | /// implementation of the IVsUIElementPane interface. 43 | /// 44 | [Guid("04baf945-0cc3-4594-87ca-1656d83fdcfe")] 45 | public class IssueListToolWindow : ToolWindowPane 46 | { 47 | /// 48 | /// Standard constructor for the tool window. 49 | /// 50 | public IssueListToolWindow() : 51 | base(null) 52 | { 53 | // Set the window title reading it from the resources. 54 | Caption = Resources.IssueListWindowTitle; 55 | // Set the image that will appear on the tab of the window frame 56 | // when docked with an other window 57 | // The resource ID correspond to the one defined in the resx file 58 | // while the Index is the offset in the bitmap strip. Each image in 59 | // the strip being 16x16. 60 | BitmapResourceID = 301; 61 | BitmapIndex = 1; 62 | 63 | // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, 64 | // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on 65 | // the object returned by the Content property. 66 | base.Content = new IssueList(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /GitHubExtension/IssueToolWindow.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.Diagnostics; 29 | using System.Runtime.InteropServices; 30 | using Alteridem.GitHub.Extension.Interfaces; 31 | using Alteridem.GitHub.Extension.View; 32 | using Microsoft.VisualStudio; 33 | using Microsoft.VisualStudio.Shell; 34 | using Microsoft.VisualStudio.Shell.Interop; 35 | using Octokit; 36 | using Issue = Alteridem.GitHub.Extension.View.Issue; 37 | 38 | #endregion 39 | 40 | namespace Alteridem.GitHub.Extension 41 | { 42 | /// 43 | /// This class implements the tool window exposed by this package and hosts a user control. 44 | /// 45 | /// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane, 46 | /// usually implemented by the package implementer. 47 | /// 48 | /// This class derives from the ToolWindowPane class provided from the MPF in order to use its 49 | /// implementation of the IVsUIElementPane interface. 50 | /// 51 | [Guid("05AF9426-E44E-404C-9653-0ADE833D1EAD")] 52 | public class IssueToolWindow : ToolWindowPane, IIssueToolWindow 53 | { 54 | private readonly Issue _issue; 55 | 56 | /// 57 | /// Standard constructor for the tool window. 58 | /// 59 | public IssueToolWindow() : 60 | base(null) 61 | { 62 | // Set the window title reading it from the resources. 63 | Caption = Resources.IssueWindowTitle; 64 | // Set the image that will appear on the tab of the window frame 65 | // when docked with an other window 66 | // The resource ID correspond to the one defined in the resx file 67 | // while the Index is the offset in the bitmap strip. Each image in 68 | // the strip being 16x16. 69 | BitmapResourceID = 301; 70 | BitmapIndex = 0; 71 | 72 | // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, 73 | // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on 74 | // the object returned by the Content property. 75 | _issue = new Issue(); 76 | base.Content = _issue; 77 | } 78 | 79 | #region Implementation of IIssueToolWindow 80 | 81 | public void Show() 82 | { 83 | if(null == Frame) 84 | { 85 | throw new NotSupportedException(Resources.CanNotCreateWindow); 86 | } 87 | var windowFrame = (IVsWindowFrame)Frame; 88 | ErrorHandler.ThrowOnFailure(windowFrame.Show()); 89 | } 90 | 91 | #endregion 92 | } 93 | } -------------------------------------------------------------------------------- /GitHubExtension/Modules/UtilityModules.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Extension.View; 28 | using Alteridem.GitHub.Logging; 29 | using EnvDTE; 30 | using Ninject.Modules; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Extension.Modules 35 | { 36 | public class UtilityModules : NinjectModule 37 | { 38 | /// 39 | /// Loads the module into the kernel. 40 | /// 41 | public override void Load() 42 | { 43 | Bind().To().InSingletonScope(); 44 | Bind().ToConstant((OutputWindowPane)null); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /GitHubExtension/Modules/ViewModelModule.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using Alteridem.GitHub.Extension.Interfaces; 26 | using Alteridem.GitHub.Extension.ViewModel; 27 | using Ninject.Modules; 28 | 29 | namespace Alteridem.GitHub.Extension.Modules 30 | { 31 | public class ViewModelModule : NinjectModule 32 | { 33 | /// 34 | /// Loads the module into the kernel. 35 | /// 36 | public override void Load() 37 | { 38 | Bind().To(); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /GitHubExtension/Modules/ViewModule.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Extension.Interfaces; 28 | using Alteridem.GitHub.Extension.View; 29 | using Ninject.Modules; 30 | 31 | #endregion 32 | 33 | namespace Alteridem.GitHub.Extension.Modules 34 | { 35 | public class ViewModule : NinjectModule 36 | { 37 | public override void Load() 38 | { 39 | Bind().To(); 40 | Bind().To(); 41 | Bind().To(); 42 | Bind().To(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /GitHubExtension/NLog.config: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | 10 | 21 | 22 | 25 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /GitHubExtension/PkgCmdID.cs: -------------------------------------------------------------------------------- 1 | // PkgCmdID.cs 2 | // MUST match PkgCmdID.h 3 | 4 | namespace Alteridem.GitHub.Extension 5 | { 6 | static class PkgCmdIDList 7 | { 8 | public const uint cmdidNewIssue = 0x100; 9 | public const uint cmdidIssues = 0x101; 10 | public const uint cmdidIssueWindow = 0x102; 11 | }; 12 | } -------------------------------------------------------------------------------- /GitHubExtension/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("GitHubExtension")] 8 | [assembly: AssemblyDescription("A Visual Studio extension for working with GitHub")] 9 | 10 | [assembly: InternalsVisibleTo("GitHubExtension.Test")] 11 | -------------------------------------------------------------------------------- /GitHubExtension/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34011 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Alteridem.GitHub.Extension { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Alteridem.GitHub.Extension.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Can not create tool window.. 65 | /// 66 | internal static string CanNotCreateWindow { 67 | get { 68 | return ResourceManager.GetString("CanNotCreateWindow", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to GitHub Issue List. 74 | /// 75 | internal static string IssueListWindowTitle { 76 | get { 77 | return ResourceManager.GetString("IssueListWindowTitle", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to GitHub Issue. 83 | /// 84 | internal static string IssueWindowTitle { 85 | get { 86 | return ResourceManager.GetString("IssueWindowTitle", resourceCulture); 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /GitHubExtension/Resources/Images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/GitHubExtension/Resources/Images.png -------------------------------------------------------------------------------- /GitHubExtension/Resources/Package.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/GitHubExtension/Resources/Package.ico -------------------------------------------------------------------------------- /GitHubExtension/Resources/Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/GitHubExtension/Resources/Preview.png -------------------------------------------------------------------------------- /GitHubExtension/View/AddComment.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.ViewModel; 30 | 31 | #endregion 32 | 33 | namespace Alteridem.GitHub.Extension.View 34 | { 35 | /// 36 | /// Interaction logic for AddComment.xaml 37 | /// 38 | public partial class AddComment : IAddComment 39 | { 40 | public AddComment() 41 | { 42 | InitializeComponent(); 43 | DataContext = Factory.Get(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /GitHubExtension/View/Avatar.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /GitHubExtension/View/Avatar.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.ComponentModel; 29 | using System.Runtime.CompilerServices; 30 | using System.Windows; 31 | using System.Windows.Controls; 32 | using Alteridem.GitHub.Annotations; 33 | using Alteridem.GitHub.Extension.Interfaces; 34 | using Alteridem.GitHub.Extension.ViewModel; 35 | 36 | #endregion 37 | 38 | namespace Alteridem.GitHub.Extension.View 39 | { 40 | /// 41 | /// Interaction logic for Avatar.xaml 42 | /// 43 | public partial class Avatar 44 | { 45 | private readonly IAvatar _avatar; 46 | 47 | public Avatar() 48 | { 49 | InitializeComponent(); 50 | _avatar = Factory.Get(); 51 | Image.DataContext = _avatar; 52 | } 53 | 54 | internal IAvatar AvatarViewModel 55 | { 56 | get { return _avatar; } 57 | } 58 | 59 | public double Size 60 | { 61 | get { return _avatar != null ? _avatar.Size : Width; } 62 | set 63 | { 64 | if ( _avatar != null ) _avatar.Size = value; 65 | Width = value; 66 | Height = value; 67 | } 68 | } 69 | 70 | public string AvatarUrl 71 | { 72 | get { return GetValue(AvatarUrlProperty) as string; } 73 | set { SetValue(AvatarUrlProperty, value); } 74 | } 75 | 76 | public static readonly DependencyProperty AvatarUrlProperty = 77 | DependencyProperty.Register( 78 | "AvatarUrl", 79 | typeof (string), 80 | typeof (Avatar), 81 | new FrameworkPropertyMetadata(OnAvatarUrlChanged)); 82 | 83 | private static void OnAvatarUrlChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 84 | { 85 | var avatar = d as Avatar; 86 | if (avatar == null || avatar.AvatarViewModel == null) 87 | return; 88 | 89 | avatar.AvatarViewModel.AvatarUrl = e.NewValue as string; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /GitHubExtension/View/Controls/IssueListItem.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace Alteridem.GitHub.Extension.View.Controls 17 | { 18 | /// 19 | /// Interaction logic for IssueListItem.xaml 20 | /// 21 | public partial class IssueListItem : UserControl 22 | { 23 | public IssueListItem() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /GitHubExtension/View/Controls/LabelControl.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /GitHubExtension/View/Controls/LabelControl.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows.Controls; 28 | 29 | #endregion 30 | 31 | namespace Alteridem.GitHub.Extension.View.Controls 32 | { 33 | /// 34 | /// Interaction logic for LabelControl.xaml 35 | /// 36 | public partial class LabelControl : UserControl 37 | { 38 | public LabelControl() 39 | { 40 | InitializeComponent(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /GitHubExtension/View/Controls/UserView.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /GitHubExtension/View/Controls/UserView.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Extension.ViewModel; 28 | 29 | #endregion 30 | 31 | namespace Alteridem.GitHub.Extension.View.Controls 32 | { 33 | /// 34 | /// Interaction logic for UserView.xaml 35 | /// 36 | public partial class UserView 37 | { 38 | public UserView() 39 | { 40 | InitializeComponent(); 41 | DataContext = Factory.Get(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /GitHubExtension/View/Issue.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Extension.ViewModel; 28 | 29 | #endregion 30 | 31 | namespace Alteridem.GitHub.Extension.View 32 | { 33 | /// 34 | /// Interaction logic for Issue.xaml 35 | /// 36 | public partial class Issue 37 | { 38 | public Issue() 39 | { 40 | InitializeComponent(); 41 | DataContext = Factory.Get(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /GitHubExtension/View/IssueEditor.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.ViewModel; 30 | using Octokit; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Extension.View 35 | { 36 | /// 37 | /// Interaction logic for EditIssue.xaml 38 | /// 39 | public partial class IssueEditor : IIssueEditor 40 | { 41 | private readonly IssueEditorViewModel _gitHubViewModel; 42 | 43 | public IssueEditor() 44 | { 45 | InitializeComponent(); 46 | _gitHubViewModel = Factory.Get(); 47 | DataContext = _gitHubViewModel; 48 | } 49 | 50 | public Window Window { get { return this; } } 51 | 52 | /// 53 | /// Sets the issue to add/edit. If null, we are adding, if set, we edit 54 | /// 55 | /// The issue. 56 | public void SetIssue(Octokit.Issue issue) 57 | { 58 | _gitHubViewModel.SetIssue(issue); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /GitHubExtension/View/IssueList.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows.Input; 28 | using Alteridem.GitHub.Extension.ViewModel; 29 | 30 | #endregion 31 | 32 | namespace Alteridem.GitHub.Extension.View 33 | { 34 | /// 35 | /// Interaction logic for IssueList.xaml 36 | /// 37 | public partial class IssueList 38 | { 39 | private IssueListViewModel _viewModel; 40 | 41 | public IssueList() 42 | { 43 | InitializeComponent(); 44 | _viewModel = Factory.Get(); 45 | DataContext = _viewModel; 46 | } 47 | 48 | private void OnRowDoubleClick(object sender, MouseButtonEventArgs e) 49 | { 50 | // I am too lazy to create a dependency property for the datagrid 51 | // so that I can bind to the mouse double click :) 52 | _viewModel.OpenIssueViewer(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /GitHubExtension/View/LabelPicker.xaml: -------------------------------------------------------------------------------- 1 |  16 | 17 | 18 | 19 | 20 | 21 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /GitHubExtension/View/LabelPicker.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Extension.Interfaces; 28 | using Alteridem.GitHub.Extension.ViewModel; 29 | 30 | #endregion 31 | 32 | namespace Alteridem.GitHub.Extension.View 33 | { 34 | /// 35 | /// Interaction logic for LabelPicker.xaml 36 | /// 37 | public partial class LabelPicker : ILabelPicker 38 | { 39 | public LabelPicker() 40 | { 41 | InitializeComponent(); 42 | } 43 | 44 | public void SetViewModel(IssueEditorViewModel viewModel) 45 | { 46 | DataContext = viewModel; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /GitHubExtension/View/LightTheme.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 27 | 28 | 34 | 35 | 42 | 43 | 52 | 53 | 56 | 57 | 62 | 63 | 69 | 70 | -------------------------------------------------------------------------------- /GitHubExtension/View/Login.xaml.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.ViewModel; 30 | using Microsoft.VisualStudio.PlatformUI; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Extension.View 35 | { 36 | /// 37 | /// Interaction logic for Login.xaml 38 | /// 39 | public partial class Login : DialogWindow, ILoginView 40 | { 41 | public Login() 42 | { 43 | InitializeComponent(); 44 | DataContext = new LoginViewModel(this); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /GitHubExtension/View/OutputWriter.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System.ComponentModel.Composition; 26 | using Alteridem.GitHub.Logging; 27 | using Microsoft.VisualStudio.Utilities; 28 | using Tvl.VisualStudio.OutputWindow.Interfaces; 29 | 30 | namespace Alteridem.GitHub.Extension.View 31 | { 32 | public class OutputWriter : BaseOutputWriter 33 | { 34 | public const string GitHubOutputWindowPaneName = "GitHub"; 35 | 36 | #pragma warning disable 169 // The field 'fieldName' is never used 37 | [Export] 38 | [Name(GitHubOutputWindowPaneName)] 39 | private static OutputWindowDefinition GitHubOutputWindowDefinition; 40 | #pragma warning restore 169 41 | 42 | /// 43 | /// Logs the specified message. 44 | /// 45 | /// The message. 46 | protected override void WriteMessage(string message) 47 | { 48 | var pane = Factory.Get(); 49 | if (pane != null) 50 | pane.WriteLine(message); 51 | } 52 | 53 | /// 54 | /// Shows the specified message. 55 | /// 56 | /// The message. 57 | protected override void ShowMessage(string message) 58 | { 59 | VisualStudioMessageBox.Show(message); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /GitHubExtension/View/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System; 26 | using System.Diagnostics; 27 | using System.Windows.Input; 28 | 29 | namespace Alteridem.GitHub.Extension.View 30 | { 31 | // 32 | /// A command whose sole purpose is to 33 | /// relay its functionality to other 34 | /// objects by invoking delegates. The 35 | /// default return value for the CanExecute 36 | /// method is 'true'. 37 | /// 38 | public class RelayCommand : ICommand 39 | { 40 | #region Fields 41 | 42 | readonly Action _execute; 43 | readonly Predicate _canExecute; 44 | 45 | #endregion // Fields 46 | 47 | #region Constructors 48 | 49 | /// 50 | /// Creates a new command that can always execute. 51 | /// 52 | /// The execution logic. 53 | public RelayCommand(Action execute) 54 | : this(execute, null) 55 | { 56 | } 57 | 58 | /// 59 | /// Creates a new command. 60 | /// 61 | /// The execution logic. 62 | /// The execution status logic. 63 | public RelayCommand(Action execute, Predicate canExecute) 64 | { 65 | if(execute == null) 66 | throw new ArgumentNullException("execute"); 67 | 68 | _execute = execute; 69 | _canExecute = canExecute; 70 | } 71 | 72 | #endregion // Constructors 73 | 74 | #region ICommand Members 75 | 76 | [DebuggerStepThrough] 77 | public bool CanExecute(object parameters) 78 | { 79 | return _canExecute == null || _canExecute(parameters); 80 | } 81 | 82 | public event EventHandler CanExecuteChanged 83 | { 84 | add { CommandManager.RequerySuggested += value; } 85 | remove { CommandManager.RequerySuggested -= value; } 86 | } 87 | 88 | public void Execute(object parameters) 89 | { 90 | _execute(parameters); 91 | } 92 | 93 | #endregion // ICommand Members 94 | } 95 | } -------------------------------------------------------------------------------- /GitHubExtension/View/VisualStudioMessageBox.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using Alteridem.GitHub.Extensions; 26 | using System; 27 | using Microsoft.VisualStudio.Shell; 28 | using Microsoft.VisualStudio.Shell.Interop; 29 | 30 | namespace Alteridem.GitHub.Extension.View 31 | { 32 | public static class VisualStudioMessageBox 33 | { 34 | public static int Show(string message) 35 | { 36 | var uiShell = ServiceProvider.GlobalProvider.GetService(); 37 | if (uiShell == null) 38 | return -1; 39 | 40 | Guid clsid = Guid.Empty; 41 | int result; 42 | Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox( 43 | 0, 44 | ref clsid, 45 | "GitHub Extension", 46 | message, 47 | string.Empty, 48 | 0, 49 | OLEMSGBUTTON.OLEMSGBUTTON_OK, 50 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST, 51 | OLEMSGICON.OLEMSGICON_INFO, 52 | 0, // false 53 | out result)); 54 | return result; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /GitHubExtension/View/WebBrowserBehavior.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System.Windows; 26 | using System.Windows.Controls; 27 | 28 | namespace Alteridem.GitHub.Extension.View 29 | { 30 | public class WebBrowserBehavior 31 | { 32 | public static readonly DependencyProperty HtmlProperty = DependencyProperty.RegisterAttached( 33 | "Html", 34 | typeof(string), 35 | typeof(WebBrowserBehavior), 36 | new FrameworkPropertyMetadata(OnHtmlChanged)); 37 | 38 | [AttachedPropertyBrowsableForType(typeof(WebBrowser))] 39 | public static string GetHtml(WebBrowser d) 40 | { 41 | return (string)d.GetValue(HtmlProperty); 42 | } 43 | 44 | public static void SetHtml(WebBrowser d, string value) 45 | { 46 | d.SetValue(HtmlProperty, value); 47 | } 48 | 49 | static void OnHtmlChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) 50 | { 51 | WebBrowser webBrowser = dependencyObject as WebBrowser; 52 | var str = e.NewValue as string; 53 | if (webBrowser != null && !string.IsNullOrWhiteSpace(str) ) 54 | webBrowser.NavigateToString(str); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /GitHubExtension/ViewModel/AddCommentViewModel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows.Input; 28 | using Alteridem.GitHub.Extension.Interfaces; 29 | using Alteridem.GitHub.Extension.View; 30 | using Octokit; 31 | using Issue = Octokit.Issue; 32 | 33 | #endregion 34 | 35 | namespace Alteridem.GitHub.Extension.ViewModel 36 | { 37 | public class AddCommentViewModel : BaseGitHubViewModel 38 | { 39 | private readonly Issue _issue; 40 | private string _comment; 41 | 42 | public AddCommentViewModel() 43 | { 44 | _issue = GitHubApi.Issue; 45 | 46 | CloseIssueCommand = new RelayCommand(OnCloseIssue, p => CanCloseIssue()); 47 | CommentCommand = new RelayCommand(OnCommentOnIssue, p => CanCommentOnIssue()); 48 | } 49 | 50 | public Issue Issue 51 | { 52 | get { return _issue; } 53 | } 54 | 55 | public string Comment 56 | { 57 | get { return _comment; } 58 | set 59 | { 60 | if (value == _comment) return; 61 | _comment = value; 62 | OnPropertyChanged(); 63 | } 64 | } 65 | 66 | public ICommand CloseIssueCommand { get; private set; } 67 | public ICommand CommentCommand { get; private set; } 68 | 69 | public void OnCloseIssue(object o) 70 | { 71 | GitHubApi.CloseIssue(GitHubApi.Issue, Comment); 72 | var closable = o as IClosable; 73 | if ( closable != null ) 74 | closable.Close(); 75 | } 76 | 77 | public bool CanCloseIssue() 78 | { 79 | return _issue != null; 80 | } 81 | 82 | public void OnCommentOnIssue(object o) 83 | { 84 | GitHubApi.AddComment(GitHubApi.Issue, Comment); 85 | var closable = o as IClosable; 86 | if (closable != null) 87 | closable.Close(); 88 | } 89 | 90 | public bool CanCommentOnIssue() 91 | { 92 | return _issue != null && !string.IsNullOrWhiteSpace(Comment); 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /GitHubExtension/ViewModel/AvatarViewModel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using Alteridem.GitHub.Extension.Interfaces; 26 | 27 | namespace Alteridem.GitHub.Extension.ViewModel 28 | { 29 | public class AvatarViewModel : BaseGitHubViewModel, IAvatar 30 | { 31 | private string _avatarUrl; 32 | private double _size; 33 | 34 | public double Size 35 | { 36 | get { return _size; } 37 | set 38 | { 39 | _size = value; 40 | OnPropertyChanged(); 41 | OnPropertyChanged("AvatarUrl"); 42 | } 43 | } 44 | 45 | public string AvatarUrl 46 | { 47 | get { return string.IsNullOrEmpty(_avatarUrl) ? "https://github.com/identicons/unknown.png" : string.Format("{0}&size={1}", _avatarUrl, _size); } 48 | set 49 | { 50 | _avatarUrl = value; 51 | OnPropertyChanged(); 52 | } 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /GitHubExtension/ViewModel/BaseGitHubViewModel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.ComponentModel; 28 | using Alteridem.GitHub.Annotations; 29 | using Alteridem.GitHub.Model; 30 | 31 | #endregion 32 | 33 | namespace Alteridem.GitHub.Extension.ViewModel 34 | { 35 | public class BaseGitHubViewModel : BaseViewModel 36 | { 37 | public BaseGitHubViewModel() 38 | { 39 | if(GitHubApi != null) 40 | GitHubApi.PropertyChanged += GitHubApiPropertyChanged; 41 | } 42 | 43 | [NotNull] 44 | internal GitHubApiBase GitHubApi 45 | { 46 | get { return Factory.Get(); } 47 | } 48 | 49 | private void GitHubApiPropertyChanged(object sender, PropertyChangedEventArgs e) 50 | { 51 | // Our properties are named the same, so just chain them 52 | OnPropertyChanged(e.PropertyName); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /GitHubExtension/ViewModel/BaseUserViewModel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows.Input; 28 | using Alteridem.GitHub.Annotations; 29 | using Alteridem.GitHub.Extension.Interfaces; 30 | using Alteridem.GitHub.Extension.View; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Extension.ViewModel 35 | { 36 | public class BaseUserViewModel : BaseGitHubViewModel 37 | { 38 | private ICommand _loginCommand; 39 | 40 | public BaseUserViewModel() 41 | { 42 | LoginCommand = new RelayCommand(p => Login(), p => true); 43 | } 44 | 45 | [NotNull] 46 | public ICommand LoginCommand 47 | { 48 | get { return _loginCommand; } 49 | set 50 | { 51 | if (Equals(value, _loginCommand)) return; 52 | _loginCommand = value; 53 | OnPropertyChanged(); 54 | } 55 | } 56 | 57 | public bool LoggedIn 58 | { 59 | get { return GitHubApi.LoggedIn; } 60 | } 61 | 62 | public void Login() 63 | { 64 | if (GitHubApi.LoggedIn) 65 | { 66 | GitHubApi.Logout(); 67 | return; 68 | } 69 | 70 | var dlg = Factory.Get(); 71 | dlg.ShowModal(); 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /GitHubExtension/ViewModel/BaseViewModel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.ComponentModel; 28 | using System.Runtime.CompilerServices; 29 | using Alteridem.GitHub.Annotations; 30 | 31 | #endregion 32 | 33 | namespace Alteridem.GitHub.Extension.ViewModel 34 | { 35 | public class BaseViewModel : INotifyPropertyChanged 36 | { 37 | public event PropertyChangedEventHandler PropertyChanged; 38 | 39 | [NotifyPropertyChangedInvocator] 40 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) 41 | { 42 | var handler = PropertyChanged; 43 | if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /GitHubExtension/ViewModel/LabelModel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System; 26 | using Alteridem.GitHub.Extension.Interfaces; 27 | using Octokit; 28 | 29 | namespace Alteridem.GitHub.Extension.ViewModel 30 | { 31 | public class LabelModel : BaseViewModel, ILabel 32 | { 33 | private readonly Label _label; 34 | private bool _checked; 35 | 36 | public LabelModel(Label label) 37 | { 38 | _checked = false; 39 | _label = label; 40 | } 41 | 42 | public string Name 43 | { 44 | get { return _label.Name; } 45 | } 46 | 47 | public string Color 48 | { 49 | get { return _label.Color; } 50 | } 51 | 52 | public Uri Url 53 | { 54 | get { return _label.Url; } 55 | } 56 | 57 | public bool Checked 58 | { 59 | get { return _checked; } 60 | set 61 | { 62 | if (Equals(value, _checked)) return; 63 | _checked = value; 64 | OnPropertyChanged(); 65 | } 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /GitHubExtension/ViewModel/UserViewModel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Windows.Input; 28 | using Alteridem.GitHub.Annotations; 29 | using Alteridem.GitHub.Extension.Interfaces; 30 | using Alteridem.GitHub.Extension.View; 31 | using Octokit; 32 | 33 | #endregion 34 | 35 | namespace Alteridem.GitHub.Extension.ViewModel 36 | { 37 | public class UserViewModel : BaseUserViewModel 38 | { 39 | public User User 40 | { 41 | get { return GitHubApi.User; } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /GitHubExtension/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /GitHubExtension/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /GitHubExtension/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | GitHub Issues Extension 6 | Manage GitHub issues for repositories that you have commit access to. You can filter and view issues for a repository, edit issues, add comments and close issues. 7 | https://github.com/rprouse/GitHubExtension 8 | License.rtf 9 | Resources\Package.ico 10 | Resources\Preview.png 11 | bug tracking, integration, github, issue tracking 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /GitHubIssues/Converters/StringToColorConverter.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System; 26 | using System.Globalization; 27 | using System.Windows.Data; 28 | using System.Windows.Media; 29 | 30 | namespace Alteridem.GitHub.Converters 31 | { 32 | public class StringToColorConverter : IValueConverter 33 | { 34 | /// 35 | /// Converts a value. 36 | /// 37 | /// 38 | /// A converted value. If the method returns null, the valid null value is used. 39 | /// 40 | /// The value produced by the binding source.The type of the binding target property.The converter parameter to use.The culture to use in the converter. 41 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 42 | { 43 | var colorString = value as string; 44 | var color = colorString.ParseColor(); 45 | return new SolidColorBrush(color); 46 | } 47 | 48 | /// 49 | /// Converts a value. 50 | /// 51 | /// 52 | /// A converted value. If the method returns null, the valid null value is used. 53 | /// 54 | /// The value that is produced by the binding target.The type to convert to.The converter parameter to use.The culture to use in the converter. 55 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 56 | { 57 | return null; 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /GitHubIssues/Converters/StringToInverseColorConverter.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.Globalization; 29 | using System.Windows.Data; 30 | using System.Windows.Media; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Converters 35 | { 36 | public class StringToInverseColorConverter : IValueConverter 37 | { 38 | /// 39 | /// Converts a value. 40 | /// 41 | /// 42 | /// A converted value. If the method returns null, the valid null value is used. 43 | /// 44 | /// The value produced by the binding source.The type of the binding target property.The converter parameter to use.The culture to use in the converter. 45 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 46 | { 47 | var colorString = value as string; 48 | var background = colorString.ParseColor(); 49 | var hsb = background.ToHsb(); 50 | var foreground = Colors.White; 51 | 52 | if ( (hsb.B > 0.6 && hsb.S < 0.4) || (hsb.B > 0.7 && hsb.H > 40 && hsb.H < 200)) 53 | { 54 | hsb.B = 0.4F; 55 | foreground = hsb.ToRgb(); 56 | } 57 | return new SolidColorBrush(foreground); 58 | } 59 | 60 | /// 61 | /// Converts a value. 62 | /// 63 | /// 64 | /// A converted value. If the method returns null, the valid null value is used. 65 | /// 66 | /// The value that is produced by the binding target.The type to convert to.The converter parameter to use.The culture to use in the converter. 67 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 68 | { 69 | return null; 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /GitHubIssues/Extensions/ControlExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Media; 3 | using Alteridem.GitHub.Annotations; 4 | 5 | namespace Alteridem.GitHub.Extensions 6 | { 7 | public static class ControlExtensions 8 | { 9 | [CanBeNull] 10 | public static Window GetParentWindow( [NotNull] this DependencyObject child ) 11 | { 12 | DependencyObject parent = VisualTreeHelper.GetParent( child ); 13 | if ( parent == null ) 14 | return null; 15 | 16 | var window = parent as Window; 17 | if ( window != null ) 18 | return window; 19 | 20 | return parent.GetParentWindow(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /GitHubIssues/Extensions/ObservableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Alteridem.GitHub.Logging; 4 | 5 | namespace Alteridem.GitHub.Extensions 6 | { 7 | public static class ObservableExtensions 8 | { 9 | private static IOutputWriter _log = Factory.Get(); 10 | 11 | public static IObservable LoggedCatch(this IObservable This, LogLevel level = LogLevel.Warn, IObservable next = null, string message = null) 12 | { 13 | next = next ?? Observable.Return(default(T)); 14 | return Observable.Catch(This, ex => 15 | { 16 | _log.Write(level, message ?? "", ex); 17 | return next; 18 | }); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /GitHubIssues/Extensions/ServiceProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Microsoft.VisualStudio.Shell; 28 | 29 | #endregion 30 | 31 | namespace Alteridem.GitHub.Extensions 32 | { 33 | /// 34 | /// Methods to make working with ServiceProviders a bit easier 35 | /// 36 | public static class ServiceProviderExtensions 37 | { 38 | /// 39 | /// Simplify getting services 40 | /// 41 | public static T GetService(this ServiceProvider provider) where T: class 42 | { 43 | return provider.GetService(typeof (T)) as T; 44 | } 45 | 46 | /// 47 | /// Simplify getting services 48 | /// 49 | public static TReturn GetService(this ServiceProvider provider) 50 | where TGet : class 51 | where TReturn : class 52 | { 53 | return provider.GetService(typeof(TGet)) as TReturn; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /GitHubIssues/Factory.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using Ninject; 3 | using Ninject.Parameters; 4 | using Ninject.Syntax; 5 | 6 | namespace Alteridem.GitHub 7 | { 8 | /// 9 | /// The dependency injection factory that wraps 10 | /// the framework allowing it to be easily swapped out. 11 | /// 12 | public static class Factory 13 | { 14 | private static readonly IKernel _kernel = new StandardKernel(); 15 | 16 | static Factory() 17 | { 18 | // Add modules in this assembly 19 | AddAssembly(Assembly.GetExecutingAssembly()); 20 | } 21 | 22 | public static void AddAssembly(Assembly assembly) 23 | { 24 | _kernel.Load(assembly); 25 | } 26 | 27 | public static T Get() 28 | { 29 | try 30 | { 31 | return _kernel.Get(); 32 | } 33 | catch(ActivationException) 34 | { 35 | return default(T); 36 | } 37 | } 38 | 39 | public static T Get(params IParameter[] parameters) 40 | { 41 | return _kernel.Get(parameters); 42 | } 43 | 44 | public static IBindingToSyntax Bind() 45 | { 46 | return _kernel.Bind(); 47 | } 48 | 49 | public static IBindingToSyntax Rebind() 50 | { 51 | return _kernel.Rebind(); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /GitHubIssues/Filters/RepositoryFilter.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.Collections.Generic; 28 | using System.Linq; 29 | using Alteridem.GitHub.Interfaces; 30 | using Octokit; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Filters 35 | { 36 | /// 37 | /// Filters a list of repositories based on the options 38 | /// 39 | public static class RepositoryFilter 40 | { 41 | public static IEnumerable Filter(this IEnumerable repositories) 42 | { 43 | var ret = from r in repositories where r.HasIssues select r; 44 | var options = Factory.Get(); 45 | if (options != null && options.Options != null && options.Options.HideRepositoriesWithNoIssues) 46 | { 47 | ret = ret.Where(r => r.OpenIssuesCount > 0); 48 | } 49 | return ret; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /GitHubIssues/Filters/UserFilter.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System.Collections.Generic; 26 | using System.Linq; 27 | using Octokit; 28 | 29 | namespace Alteridem.GitHub.Filters 30 | { 31 | /// 32 | /// Filters a list of issues based on the given user 33 | /// 34 | public static class UserFilter 35 | { 36 | public static IEnumerable Filter(this IEnumerable issues, User user, UserFilterType filter) 37 | { 38 | if (user == null) return issues; 39 | 40 | switch (filter) 41 | { 42 | case UserFilterType.AssignedToMe: 43 | return issues.Where(i => i.Assignee != null && i.Assignee.Id == user.Id); 44 | case UserFilterType.ReportedByMe: 45 | return issues.Where(i => i.User != null && i.User.Id == user.Id); 46 | case UserFilterType.Unassigned: 47 | return issues.Where(i => i.Assignee == null); 48 | default: 49 | return issues; 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /GitHubIssues/Filters/UserFilterType.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | namespace Alteridem.GitHub.Filters 26 | { 27 | public enum UserFilterType 28 | { 29 | All, 30 | Unassigned, 31 | AssignedToMe, 32 | ReportedByMe 33 | } 34 | } -------------------------------------------------------------------------------- /GitHubIssues/GitHub.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/GitHubIssues/GitHub.ico -------------------------------------------------------------------------------- /GitHubIssues/Interfaces/IOptionsProvider.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using Alteridem.GitHub.Model; 28 | 29 | #endregion 30 | 31 | namespace Alteridem.GitHub.Interfaces 32 | { 33 | public interface IOptionsProvider 34 | { 35 | OptionsPage Options { get; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /GitHubIssues/Logging/IOutputWriter.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | using System; 26 | 27 | namespace Alteridem.GitHub.Logging 28 | { 29 | /// 30 | /// Interface for logging and showing messages to the user 31 | /// 32 | public interface IOutputWriter 33 | { 34 | /// 35 | /// Shows the specified message to the user. 36 | /// 37 | /// The level at which to log the message 38 | /// The message. 39 | void Write(LogLevel level, string message); 40 | 41 | /// 42 | /// Shows the specified message to the user. 43 | /// 44 | /// The level at which to log the message 45 | /// The message. 46 | /// Arguments to the message 47 | void Write(LogLevel level, string message, params object[] args); 48 | 49 | /// 50 | /// Shows the specified message to the user along with the exception information. 51 | /// 52 | /// The level at which to log the message 53 | /// The message. 54 | /// The exception. 55 | void Write(LogLevel level, string message, Exception ex); 56 | } 57 | } -------------------------------------------------------------------------------- /GitHubIssues/Logging/LogLevel.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | namespace Alteridem.GitHub.Logging 26 | { 27 | /// 28 | /// The level to log messages out 29 | /// 30 | public enum LogLevel 31 | { 32 | Debug = 0, 33 | Info = 1, 34 | Warn = 2, 35 | Error = 3, 36 | Fatal = 4 37 | } 38 | } -------------------------------------------------------------------------------- /GitHubIssues/Model/AuthenticationHelpers.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.Globalization; 29 | using System.Linq; 30 | using System.Net; 31 | using System.Net.NetworkInformation; 32 | using System.Security.Cryptography; 33 | using System.Text; 34 | 35 | #endregion 36 | 37 | namespace Alteridem.GitHub.Model 38 | { 39 | public static class AuthenticationHelpers 40 | { 41 | public static string GetFingerprint() 42 | { 43 | return Sha256Hash(GetNetworkInterface()); 44 | } 45 | 46 | public static string GetMachineName() 47 | { 48 | try 49 | { 50 | return Dns.GetHostName(); 51 | } 52 | catch (Exception) 53 | { 54 | try 55 | { 56 | return Environment.MachineName; 57 | } 58 | catch (Exception) 59 | { 60 | return "--unknown--"; 61 | } 62 | } 63 | } 64 | 65 | public static string Sha256Hash(string input) 66 | { 67 | using (SHA256 shA256 = SHA256.Create()) 68 | { 69 | byte[] bytes = Encoding.UTF8.GetBytes(input); 70 | var hash = from b in shA256.ComputeHash(bytes) select b.ToString("x2", CultureInfo.InvariantCulture); 71 | return string.Join("", hash); 72 | } 73 | } 74 | 75 | public static string GetNetworkInterface() 76 | { 77 | var nics = from nic in NetworkInterface.GetAllNetworkInterfaces() 78 | where nic.OperationalStatus == OperationalStatus.Up 79 | orderby nic.Speed 80 | select nic.GetPhysicalAddress().ToString(); 81 | return nics.FirstOrDefault(addr => addr.Length > 12) ?? GetMachineName(); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /GitHubIssues/Model/Cache.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System.ComponentModel.Composition; 28 | using Microsoft.VisualStudio.Settings; 29 | using Microsoft.VisualStudio.Shell; 30 | using Microsoft.VisualStudio.Shell.Settings; 31 | 32 | #endregion 33 | 34 | namespace Alteridem.GitHub.Model 35 | { 36 | [Export] 37 | public class Cache : ICache 38 | { 39 | private readonly SVsServiceProvider _serviceProvider; 40 | 41 | [ImportingConstructor] 42 | private Cache([Import] SVsServiceProvider serviceProvider) 43 | { 44 | _serviceProvider = serviceProvider; 45 | } 46 | 47 | private WritableSettingsStore WritableSettingsStore 48 | { 49 | get 50 | { 51 | ShellSettingsManager shellSettingsManager = new ShellSettingsManager(_serviceProvider); 52 | return shellSettingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); 53 | } 54 | } 55 | 56 | public CredentialCache Credentials 57 | { 58 | get 59 | { 60 | string cached = WritableSettingsStore.GetString("Alteridem.GitHubExtension", "Credentials", ""); 61 | return CredentialCache.FromString(cached); 62 | } 63 | 64 | set 65 | { 66 | string credentials = value != null ? value.ToString() : null; 67 | WritableSettingsStore.CreateCollection("Alteridem.GitHubExtension"); 68 | WritableSettingsStore.SetString("Alteridem.GitHubExtension", "Credentials", credentials ?? string.Empty); 69 | } 70 | } 71 | 72 | public int Repository 73 | { 74 | get 75 | { 76 | return WritableSettingsStore.GetInt32("Alteridem.GitHubExtension", "Repository", 0); 77 | } 78 | 79 | set 80 | { 81 | WritableSettingsStore.CreateCollection("Alteridem.GitHubExtension"); 82 | WritableSettingsStore.SetInt32("Alteridem.GitHubExtension", "Repository", value); 83 | } 84 | } 85 | 86 | public void SaveCredentials(string logon, string password) 87 | { 88 | Credentials = new CredentialCache { Logon = logon, Password = password, AccessToken = string.Empty }; 89 | } 90 | 91 | public void SaveToken( string accessToken ) 92 | { 93 | Credentials = new CredentialCache { Logon = string.Empty, Password = string.Empty, AccessToken = accessToken }; 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /GitHubIssues/Model/ICache.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | namespace Alteridem.GitHub.Model 26 | { 27 | public interface ICache 28 | { 29 | CredentialCache Credentials { get; set; } 30 | int Repository { get; set; } 31 | void SaveCredentials(string logon, string password); 32 | void SaveToken(string accessToken); 33 | } 34 | } -------------------------------------------------------------------------------- /GitHubIssues/Model/OptionsPage.cs: -------------------------------------------------------------------------------- 1 | // ********************************************************************************** 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015 Rob Prouse 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | // ********************************************************************************** 24 | 25 | #region Using Directives 26 | 27 | using System; 28 | using System.ComponentModel; 29 | using System.Runtime.InteropServices; 30 | using Microsoft.VisualStudio.Shell; 31 | 32 | using Alteridem.GitHub.Styles; 33 | 34 | #endregion 35 | 36 | namespace Alteridem.GitHub.Model 37 | { 38 | [ClassInterface(ClassInterfaceType.AutoDual)] 39 | [ComVisible(true)] 40 | public class OptionsPage : DialogPage 41 | { 42 | [Category("Interface")] 43 | [DisplayName("Issue Theme")] 44 | [Description("A light or dark background for the Issue window")] 45 | public IssueTheme IssueTheme { get; set; } 46 | 47 | [Category("Interface")] 48 | [DisplayName("Hide Repositories Without Issues")] 49 | [Description("Hides all repositories from the selection list that do not have open or closed issues")] 50 | public bool HideRepositoriesWithNoIssues { get; set; } 51 | 52 | [Category("Repositories")] 53 | [DisplayName("Disable Auto-Select Repository")] 54 | [Description("Disables automatically selecting the repository based on the code you are working on")] 55 | public bool DisableAutoSelectRepository { get; set; } 56 | } 57 | } -------------------------------------------------------------------------------- /GitHubIssues/Model/Secrets.cs: -------------------------------------------------------------------------------- 1 | namespace Alteridem.GitHub.Model 2 | { 3 | internal static class Secrets 4 | { 5 | #warning Update the CLIENT_ID and CLIENT_SECRET on the following lines and remove this warning, as described in the README file. 6 | internal const string CLIENT_ID = ""; 7 | internal const string CLIENT_SECRET = ""; 8 | } 9 | } -------------------------------------------------------------------------------- /GitHubIssues/Modules/GitHubModule.cs: -------------------------------------------------------------------------------- 1 | using Alteridem.GitHub.Model; 2 | using Ninject.Modules; 3 | using Octokit; 4 | 5 | namespace Alteridem.GitHub.Modules 6 | { 7 | public class GitHubModule : NinjectModule 8 | { 9 | public override void Load() 10 | { 11 | Bind() 12 | .To() 13 | .WithConstructorArgument("productInformation", c => new ProductHeaderValue("GitHubExtension")); 14 | 15 | 16 | Bind() 17 | .To() 18 | .InSingletonScope(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /GitHubIssues/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System.Windows; 5 | 6 | [assembly: AssemblyTitle("GitHubExtension.Common")] 7 | [assembly: AssemblyDescription("A Visual Studio extension for working with GitHub")] 8 | 9 | [assembly: ThemeInfo( 10 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 11 | //(used if a resource is not found in the page, 12 | // or application resource dictionaries) 13 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 14 | //(used if a resource is not found in the page, 15 | // app, or any theme specific resource dictionaries) 16 | )] -------------------------------------------------------------------------------- /GitHubIssues/Properties/AssemblyInfoCommon.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Resources; 4 | using System.Runtime.CompilerServices; 5 | using System.Runtime.InteropServices; 6 | 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("Alteridem Consulting")] 9 | [assembly: AssemblyProduct("GitHub Visual Studio Issues Extension")] 10 | [assembly: AssemblyCopyright("Copyright © 2015, Rob Prouse")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(false)] 15 | [assembly: NeutralResourcesLanguage("en-US")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("0.7.0.0")] 28 | [assembly: AssemblyFileVersion("0.7.0.0")] -------------------------------------------------------------------------------- /GitHubIssues/Styles/IssueTheme.cs: -------------------------------------------------------------------------------- 1 | namespace Alteridem.GitHub.Styles 2 | { 3 | public enum IssueTheme 4 | { 5 | Light, 6 | Dark 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /GitHubIssues/Styles/StyleLoader.cs: -------------------------------------------------------------------------------- 1 | using Alteridem.GitHub.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Alteridem.GitHub.Styles 11 | { 12 | public static class StyleLoader 13 | { 14 | public static string LoadResource(string resourceName) 15 | { 16 | var assembly = Assembly.GetExecutingAssembly(); 17 | 18 | using (Stream stream = assembly.GetManifestResourceStream(resourceName)) 19 | using (StreamReader reader = new StreamReader(stream)) 20 | { 21 | return reader.ReadToEnd(); 22 | } 23 | } 24 | 25 | public static string LoadCss() 26 | { 27 | var options = Factory.Get(); 28 | if (options == null || options.Options == null) 29 | return string.Empty; 30 | 31 | string resource = options.Options.IssueTheme == IssueTheme.Light ? "light_theme.css" : "dark_theme.css"; 32 | return LoadResource(string.Format("Alteridem.GitHub.Styles.{0}", resource)); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /GitHubIssues/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /GitHubIssues/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Rob Prouse 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GitHub Issues Visual Studio Extension 2 | =============== 3 | 4 | [![Build status](https://ci.appveyor.com/api/projects/status/cq3t38xds110oxb8/branch/master?svg=true)](https://ci.appveyor.com/project/rprouse/githubextension/branch/master) [![Latest Release](https://img.shields.io/github/release/rprouse/GitHubExtension.svg)](https://visualstudiogallery.msdn.microsoft.com/e4ba5ebd-bcd5-4e20-8375-bb8cbdd71d7e) [![Join the chat at https://gitter.im/rprouse/GitHubExtension](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/rprouse/GitHubExtension?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | 6 | [![Follow Rob Prouse](https://img.shields.io/twitter/follow/rprouse.svg?style=social)](https://twitter.com/rprouse) 7 | 8 | A visual studio extension for working with issues on GitHub by [Rob Prouse](http://www.alteridem.net). 9 | 10 | Access and manage GitHub issues for repositories that you have commit access to. You can filter and view issues for a repository, edit issues, add comments and close issue. This is the first Alpha release, more features are coming. 11 | 12 | ## Download ## 13 | 14 | The easiest way to download is by going to *Tools | Extensions* in Visual Studio and searching for the GitHub Extension. It is also available in the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/e4ba5ebd-bcd5-4e20-8375-bb8cbdd71d7e) and in the [GitHub Releases](https://github.com/rprouse/GitHubExtension/releases) for the project. 15 | 16 | ## Instructions ## 17 | 18 | - To view a list of open issues, go to **View | Other Windows | GitHub Issue List** (Ctrl+W, Ctrl+G) 19 | - Log in to GitHub by clicking the logon icon at the upper right of the issue list window 20 | - Open the issue window by double clicking an issue in the list, or by going to **View | Other Windows | GitHub Issue Window** (Ctrl+W, Ctrl+H) 21 | - Add a new issue to the selected repository with the + button in the issue list, or from **Tools | New Issue on GitHub** (Ctrl+W, Ctrl+I) 22 | - Edit an issue with the edit button on the Issue window 23 | - Add comments to, or close and issue with the comment button on the issue window 24 | 25 | ## Two Factor Authentication ## 26 | 27 | We do not currently support GitHub's Two-Factor Authentication system. However, you can generate a Personal Access Token to log in to your GitHub account instead. 28 | 29 | 1. Visit the following URL: https://github.com/settings/tokens/new 30 | 2. Enter a description in the Token description field, like "Visual Studio token". 31 | 3. Click Create Token. 32 | 4. Your new Personal Access token will be displayed. 33 | 5. Copy this token, and enter it in the Token text box in the logon dialog. You can now log in as usual. 34 | 35 | If you ever want to revoke the token, visit the GitHub Applications settings page and click Delete next to the key you wish to remove. 36 | 37 | ## Credits ## 38 | 39 | - Button and application images by [Font Awesome](http://fortawesome.github.io/Font-Awesome/) ([SIL OFL 1.1](http://scripts.sil.org/OFL)) 40 | 41 | ## Screenshots ## 42 | 43 | ### Login Window ### 44 | 45 | ![Login](/images/logon.png) 46 | 47 | ### Issue List ### 48 | 49 | ![Issue List](/images/issue_list.png) 50 | 51 | ### Issue Window ### 52 | 53 | ![Issue Window](/images/issue.png) 54 | 55 | ## Building ## 56 | 57 | This project supports Visual Studio 2012 and newer. You will need the Visual Studio SDK installed for the particular version of Visual Studio you are testing. 58 | 59 | Optionally, set the GitHub `CLIENT_ID` and `CLIENT_SECRET` in `Secrets.cs` which is in the 60 | `Model` folder of the `GitHubIssues` project. Note that if these values are not set, the 61 | only supported authentication method will be specifying an access token generated according 62 | to the steps described in **Two Factor Authentication**, above. 63 | 64 | To debug, 65 | 66 | 1. Set `GitHubExtension` as the startup project 67 | 2. Select **Debug** → **Start Debugging** 68 | -------------------------------------------------------------------------------- /images/issue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/images/issue.png -------------------------------------------------------------------------------- /images/issue_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/images/issue_list.png -------------------------------------------------------------------------------- /images/logon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rprouse/GitHubExtension/25abdac2f9585ba5d3bb546b5dc200f07b9fc246/images/logon.png -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | --------------------------------------------------------------------------------