├── .gitattributes
├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CodeHub.sln
├── CodeHub
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── Images
│ │ ├── appLogoPurple.png
│ │ ├── git
│ │ │ ├── git-issue-closed.png
│ │ │ ├── git-issue-opened.png
│ │ │ ├── git-issue-reopened.png
│ │ │ ├── git-merge.png
│ │ │ └── git-pull-request.png
│ │ ├── green.jpeg
│ │ └── placeholder.jpg
│ ├── NewStoreLogo.scale-100.png
│ ├── NewStoreLogo.scale-125.png
│ ├── NewStoreLogo.scale-150.png
│ ├── NewStoreLogo.scale-200.png
│ ├── NewStoreLogo.scale-400.png
│ ├── Noise.png
│ ├── SplashScreen.scale-100.png
│ ├── SplashScreen.scale-125.png
│ ├── SplashScreen.scale-150.png
│ ├── SplashScreen.scale-200.png
│ ├── SplashScreen.scale-400.png
│ ├── Square150x150Logo.scale-100.png
│ ├── Square150x150Logo.scale-125.png
│ ├── Square150x150Logo.scale-150.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square150x150Logo.scale-400.png
│ ├── Square310x310Logo.scale-100.png
│ ├── Square310x310Logo.scale-125.png
│ ├── Square310x310Logo.scale-150.png
│ ├── Square310x310Logo.scale-200.png
│ ├── Square310x310Logo.scale-400.png
│ ├── Square44x44Logo.scale-100.png
│ ├── Square44x44Logo.scale-125.png
│ ├── Square44x44Logo.scale-150.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.scale-400.png
│ ├── Square44x44Logo.targetsize-16.png
│ ├── Square44x44Logo.targetsize-16_altform-unplated.png
│ ├── Square44x44Logo.targetsize-24.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Square44x44Logo.targetsize-256.png
│ ├── Square44x44Logo.targetsize-256_altform-unplated.png
│ ├── Square44x44Logo.targetsize-32.png
│ ├── Square44x44Logo.targetsize-32_altform-unplated.png
│ ├── Square44x44Logo.targetsize-48.png
│ ├── Square44x44Logo.targetsize-48_altform-unplated.png
│ ├── Square71x71Logo.scale-100.png
│ ├── Square71x71Logo.scale-125.png
│ ├── Square71x71Logo.scale-150.png
│ ├── Square71x71Logo.scale-200.png
│ ├── Square71x71Logo.scale-400.png
│ ├── StoreLogo.scale-100.png
│ ├── StoreLogo.scale-125.png
│ ├── StoreLogo.scale-150.png
│ ├── StoreLogo.scale-200.png
│ ├── StoreLogo.scale-400.png
│ ├── Target.scale-100.png
│ ├── Target.scale-150.png
│ ├── Target.scale-1600.png
│ ├── Target.scale-300.png
│ ├── Wide310x150Logo.scale-100.png
│ ├── Wide310x150Logo.scale-125.png
│ ├── Wide310x150Logo.scale-150.png
│ ├── Wide310x150Logo.scale-200.png
│ ├── Wide310x150Logo.scale-400.png
│ ├── css
│ │ └── github-markdown.css
│ ├── flame.png
│ ├── profile-placeholder.png
│ └── transparent.png
├── CodeHub.csproj
├── Controls
│ ├── ActivityListItem.xaml
│ ├── ActivityListItem.xaml.cs
│ ├── AnimatedComboBox.cs
│ ├── BusyScreen.xaml
│ ├── BusyScreen.xaml.cs
│ ├── CodeListItem.xaml
│ ├── CodeListItem.xaml.cs
│ ├── CommentListItem.xaml
│ ├── CommentListItem.xaml.cs
│ ├── CommitFileListItem.xaml
│ ├── CommitFileListItem.xaml.cs
│ ├── CommitListItem.xaml
│ ├── CommitListItem.xaml.cs
│ ├── CustomFrame.cs
│ ├── FirstTrendingRepoControl.xaml
│ ├── FirstTrendingRepoControl.xaml.cs
│ ├── HamMenuListItem.xaml
│ ├── HamMenuListItem.xaml.cs
│ ├── HtmlToRtfConverter.cs
│ ├── IssueListItem.xaml
│ ├── IssueListItem.xaml.cs
│ ├── LabelListItem.xaml
│ ├── LabelListItem.xaml.cs
│ ├── MarkdownEditorControl.xaml
│ ├── MarkdownEditorControl.xaml.cs
│ ├── OrganizationListItem.xaml
│ ├── OrganizationListItem.xaml.cs
│ ├── PullRequestListItem.xaml
│ ├── PullRequestListItem.xaml.cs
│ ├── ReleaseListItem.xaml
│ ├── ReleaseListItem.xaml.cs
│ ├── RepoListItem.xaml
│ ├── RepoListItem.xaml.cs
│ ├── SignInPage.xaml
│ ├── SignInPage.xaml.cs
│ ├── SyntaxHighlightPreviewControl.xaml
│ ├── SyntaxHighlightPreviewControl.xaml.cs
│ ├── TopScrollerControl.xaml
│ ├── TopScrollerControl.xaml.cs
│ ├── UserListItem.xaml
│ ├── UserListItem.xaml.cs
│ ├── WhatsNewPopupControl.xaml
│ └── WhatsNewPopupControl.xaml.cs
├── Converters
│ ├── BooleanToVisibilityConverter.cs
│ ├── ColorStringToColorBrushConverter.cs
│ ├── EventTypeToActionStringConverter.cs
│ ├── EventTypeToCommentStringConverter.cs
│ ├── EventTypeToSymbolConverter.cs
│ ├── ForegroundFromBackgroundConverter.cs
│ ├── InverseBooleanConverter.cs
│ ├── IssueDetailStringConverter.cs
│ ├── IssueStateToColorConverter.cs
│ ├── IssueToSymbolConverter.cs
│ ├── NotifTypeToSymbolConverter.cs
│ ├── ObjectToStringConverter.cs
│ ├── PullRequestDetailStringConverter.cs
│ ├── PullRequestStateToColorConverter.cs
│ ├── RepositoryContentToFileIconConverter.cs
│ ├── RepositoryCreationTimeConverter.cs
│ ├── ReverseBooleanToVisibilityConverter.cs
│ └── TimeAgoConverter.cs
├── Helpers
│ ├── AnimatedGradientBrush.cs
│ ├── BackgroundTaskStatus.cs
│ ├── BackgroundTaskStorage.cs
│ ├── BadgeHelper.cs
│ ├── CollectionHelper.cs
│ ├── Extensions.cs
│ ├── GlobalHelper.cs
│ ├── HTTPHelper.cs
│ ├── OctokitNotificationHelper.cs
│ ├── StringHelper.cs
│ ├── TilesHelper.cs
│ ├── ToastHelper.cs
│ └── XAMLHelper.cs
├── Models
│ ├── Account.cs
│ ├── BackgroundTaskBuilderModel.cs
│ ├── HamItem.cs
│ ├── IStartupNotification.cs
│ ├── RepositoryContentWithCommitInfo.cs
│ ├── SettingsItem.cs
│ ├── StartupNotification.cs
│ ├── StartupNotificationGroup.cs
│ ├── StartupNotificationTypes.cs
│ ├── SyntaxHighlightStyle.cs
│ └── WrappedWebResult.cs
├── Package.appxmanifest
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
├── Resources
│ ├── SVGIconsDictionary.xaml
│ ├── SharedCompiledDataTemplates.xaml
│ └── SharedCompiledDataTemplates.xaml.cs
├── Services
│ ├── Auth
│ │ ├── AccountsService.cs
│ │ ├── AppCredentials.cs
│ │ └── AuthService.cs
│ ├── BackgroundTaskService.cs
│ ├── ExecutionService.cs
│ ├── Hilite-me
│ │ ├── HiliteAPI.cs
│ │ ├── Samples
│ │ │ ├── Borland.html
│ │ │ ├── Colorful.html
│ │ │ ├── Emacs.html
│ │ │ ├── Fruity.html
│ │ │ ├── LineNumbers
│ │ │ │ ├── Borland.html
│ │ │ │ ├── Colorful.html
│ │ │ │ ├── Emacs.html
│ │ │ │ ├── Fruity.html
│ │ │ │ ├── Perldoc.html
│ │ │ │ ├── VS.html
│ │ │ │ ├── monokai.html
│ │ │ │ ├── native.html
│ │ │ │ └── vim.html
│ │ │ ├── Perldoc.html
│ │ │ ├── VS.html
│ │ │ ├── monokai.html
│ │ │ ├── native.html
│ │ │ └── vim.html
│ │ └── SyntaxHighlightStyle.cs
│ ├── HtmlParseService.cs
│ ├── IAsyncNavigationService.cs
│ ├── NavigationService.cs
│ ├── Octokit
│ │ ├── ActivityService.cs
│ │ ├── CommitService.cs
│ │ ├── GistUtility.cs
│ │ ├── IssueUtility.cs
│ │ ├── NotificationsService.cs
│ │ ├── OrganizationsUtility.cs
│ │ ├── PullRequestUtility.cs
│ │ ├── RepositoryUtility.cs
│ │ ├── SearchUtility.cs
│ │ └── UserService.cs
│ └── SettingsService.cs
├── Strings
│ ├── bn-BD
│ │ └── Resources.resw
│ ├── de
│ │ └── Resources.resw
│ ├── el
│ │ └── Resources.resw
│ ├── en-US
│ │ └── Resources.resw
│ ├── es
│ │ └── Resources.resw
│ ├── fr
│ │ └── Resources.resw
│ ├── hu-HU
│ │ └── Resources.resw
│ ├── it
│ │ └── Resources.resw
│ ├── pt
│ │ └── Resources.resw
│ ├── tr-TR
│ │ └── Resources.resw
│ ├── vi
│ │ └── Resources.resw
│ └── zh-Hans
│ │ └── Resources.resw
├── Styles
│ ├── MiscStyles.xaml
│ └── TextStyles.xaml
├── ViewModels
│ ├── AppViewmodel.cs
│ ├── CommentViewmodel.cs
│ ├── CommitDetailViewmodel.cs
│ ├── CommitsViewmodel.cs
│ ├── ContentViewmodel.cs
│ ├── DeveloperProfileViewmodel.cs
│ ├── EditProfileViewmodel.cs
│ ├── FeedViewmodel.cs
│ ├── FileContentViewModel.cs
│ ├── IssueDetailViewmodel.cs
│ ├── IssuesViewmodel.cs
│ ├── MainViewmodel.cs
│ ├── MyOrganizationsViewmodel.cs
│ ├── MyReposViewmodel.cs
│ ├── NotificationsViewmodel.cs
│ ├── PullRequestDetailViewmodel.cs
│ ├── PullRequestsViewmodel.cs
│ ├── RepoDetailViewmodel.cs
│ ├── SearchViewmodel.cs
│ ├── Settings
│ │ ├── AboutSettingsViewModel.cs
│ │ ├── AppearenceSettingsViewModel.cs
│ │ ├── GeneralSettingsViewModel.cs
│ │ └── NofiticationSettingsViewModel.cs
│ ├── SettingsViewmodel.cs
│ ├── SourceCodeViewmodel.cs
│ └── TrendingViewmodel.cs
├── Views
│ ├── CommentView.xaml
│ ├── CommentView.xaml.cs
│ ├── CommitDetailView.xaml
│ ├── CommitDetailView.xaml.cs
│ ├── CommitsView.xaml
│ ├── CommitsView.xaml.cs
│ ├── ContentView.xaml
│ ├── ContentView.xaml.cs
│ ├── DeveloperProfileView.xaml
│ ├── DeveloperProfileView.xaml.cs
│ ├── EditProfileView.xaml
│ ├── EditProfileView.xaml.cs
│ ├── FeedView.xaml
│ ├── FeedView.xaml.cs
│ ├── FileContentView.xaml
│ ├── FileContentView.xaml.cs
│ ├── IssueDetailView.xaml
│ ├── IssueDetailView.xaml.cs
│ ├── IssuesView.xaml
│ ├── IssuesView.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MyOrganizationsView.xaml
│ ├── MyOrganizationsView.xaml.cs
│ ├── MyReposView.xaml
│ ├── MyReposView.xaml.cs
│ ├── NotificationsView.xaml
│ ├── NotificationsView.xaml.cs
│ ├── PullRequestDetailView.xaml
│ ├── PullRequestDetailView.xaml.cs
│ ├── PullRequestsView.xaml
│ ├── PullRequestsView.xaml.cs
│ ├── RepoDetailView.xaml
│ ├── RepoDetailView.xaml.cs
│ ├── SearchView.xaml
│ ├── SearchView.xaml.cs
│ ├── Settings
│ │ ├── AboutSettingsView.xaml
│ │ ├── AboutSettingsView.xaml.cs
│ │ ├── AppearanceView.xaml
│ │ ├── AppearanceView.xaml.cs
│ │ ├── CreditSettingsView.xaml
│ │ ├── CreditSettingsView.xaml.cs
│ │ ├── DonateView.xaml
│ │ ├── DonateView.xaml.cs
│ │ ├── GeneralSettingsView.xaml
│ │ ├── GeneralSettingsView.xaml.cs
│ │ ├── NotificationSettings.xaml
│ │ ├── NotificationSettings.xaml.cs
│ │ └── SettingsDetailPageBase.cs
│ ├── SettingsView.xaml
│ ├── SettingsView.xaml.cs
│ ├── SourceCodeView.xaml
│ ├── SourceCodeView.xaml.cs
│ ├── TrendingView.xaml
│ └── TrendingView.xaml.cs
├── _scale-100.appx
├── _scale-125.appx
├── _scale-150.appx
├── _scale-400.appx
└── app.config
├── EdgeAuth
├── EdgeAuth.csproj
├── Properties
│ ├── AssemblyInfo.cs
│ └── EdgeAuth.rd.xml
├── WebAuthenticationBroker.cs
├── WebAuthenticationOptions.cs
├── WebAuthenticationResult.cs
└── WebAuthenticationStatus.cs
├── LICENSE.txt
├── README.md
├── Screenshots
├── repoView.PNG
└── trending.PNG
└── _config.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
19 | #Linguist manual override
20 | CodeHub/Services/Hilite-me/Samples/* linguist-vendored
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## I'm submitting a...
2 |
3 | ```
4 | [ ] Regression (a behavior that used to work and stopped working in a new release)
5 | [ ] Bug report
6 | [ ] Feature request
7 | [ ] Question
8 | ```
9 |
10 | ## Current behavior
11 |
12 |
13 | ## Expected behavior
14 |
15 |
16 | ## Steps to reproduce the behavior
17 |
18 |
19 | ## Environment
20 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## PR Type
2 | What kind of change does this PR introduce?
3 |
4 |
5 | ```
6 | [ ] Bugfix
7 | [ ] Feature
8 | [ ] Code style update (formatting)
9 | [ ] Refactoring (no functional changes, no api changes)
10 | [ ] Documentation content changes
11 | [ ] Other... Please describe:
12 | ```
13 |
14 | ## What is the current behavior?
15 |
16 |
17 | ## What is the new behavior?
18 |
19 |
20 | ## Does this PR introduce a breaking change?
21 | ```
22 | [ ] Yes
23 | [ ] No
24 | ```
25 |
26 | ## Other information
27 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at aalok_2@live.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | When contributing to this repository, please first discuss the change you wish to make via issue,
4 | email, or any other method with the owners of this repository before making a change.
5 |
6 | Please note we have a code of conduct, please follow it in all your interactions with the project.
7 |
8 | ## Pull Requests
9 |
10 | 1. Always keep `dev` as the base branch of your PR.
11 | 2. Name the head branch of your PR in the following convention :
12 | If the PR adds a new feature: `feature-Feature_Name`. If the PR adds a fix: `fix-Fix_Description` and so on.
13 | 3. Keep the code simple and add comments wherever necessary.
14 |
--------------------------------------------------------------------------------
/CodeHub.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28010.2026
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeHub", "CodeHub\CodeHub.csproj", "{360629C8-E107-4DAC-942F-1730A9C289C8}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EdgeAuth", "EdgeAuth\EdgeAuth.csproj", "{43D93B09-439B-45BE-B838-474AC63ADE7E}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|ARM = Debug|ARM
14 | Debug|x64 = Debug|x64
15 | Debug|x86 = Debug|x86
16 | Release|Any CPU = Release|Any CPU
17 | Release|ARM = Release|ARM
18 | Release|x64 = Release|x64
19 | Release|x86 = Release|x86
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|Any CPU.ActiveCfg = Debug|x86
23 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|ARM.ActiveCfg = Debug|ARM
24 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|ARM.Build.0 = Debug|ARM
25 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|ARM.Deploy.0 = Debug|ARM
26 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|x64.ActiveCfg = Debug|x64
27 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|x64.Build.0 = Debug|x64
28 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|x64.Deploy.0 = Debug|x64
29 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|x86.ActiveCfg = Debug|x86
30 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|x86.Build.0 = Debug|x86
31 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Debug|x86.Deploy.0 = Debug|x86
32 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|Any CPU.ActiveCfg = Release|x86
33 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|ARM.ActiveCfg = Release|ARM
34 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|ARM.Build.0 = Release|ARM
35 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|ARM.Deploy.0 = Release|ARM
36 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|x64.ActiveCfg = Release|x64
37 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|x64.Build.0 = Release|x64
38 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|x64.Deploy.0 = Release|x64
39 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|x86.ActiveCfg = Release|x86
40 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|x86.Build.0 = Release|x86
41 | {360629C8-E107-4DAC-942F-1730A9C289C8}.Release|x86.Deploy.0 = Release|x86
42 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
44 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|ARM.ActiveCfg = Debug|ARM
45 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|ARM.Build.0 = Debug|ARM
46 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|x64.ActiveCfg = Debug|x64
47 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|x64.Build.0 = Debug|x64
48 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|x86.ActiveCfg = Debug|x86
49 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Debug|x86.Build.0 = Debug|x86
50 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|Any CPU.Build.0 = Release|Any CPU
52 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|ARM.ActiveCfg = Release|ARM
53 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|ARM.Build.0 = Release|ARM
54 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|x64.ActiveCfg = Release|x64
55 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|x64.Build.0 = Release|x64
56 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|x86.ActiveCfg = Release|x86
57 | {43D93B09-439B-45BE-B838-474AC63ADE7E}.Release|x86.Build.0 = Release|x86
58 | EndGlobalSection
59 | GlobalSection(SolutionProperties) = preSolution
60 | HideSolutionNode = FALSE
61 | EndGlobalSection
62 | GlobalSection(ExtensibilityGlobals) = postSolution
63 | SolutionGuid = {4463461D-4C16-4C73-A42D-FF75E419A466}
64 | EndGlobalSection
65 | EndGlobal
66 |
--------------------------------------------------------------------------------
/CodeHub/App.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | #60B53B
18 |
19 | #519932
20 |
21 |
24 |
25 |
26 |
31 |
32 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/appLogoPurple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/appLogoPurple.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/git/git-issue-closed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/git/git-issue-closed.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/git/git-issue-opened.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/git/git-issue-opened.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/git/git-issue-reopened.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/git/git-issue-reopened.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/git/git-merge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/git/git-merge.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/git/git-pull-request.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/git/git-pull-request.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/green.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/green.jpeg
--------------------------------------------------------------------------------
/CodeHub/Assets/Images/placeholder.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Images/placeholder.jpg
--------------------------------------------------------------------------------
/CodeHub/Assets/NewStoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/NewStoreLogo.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/NewStoreLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/NewStoreLogo.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/NewStoreLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/NewStoreLogo.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/NewStoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/NewStoreLogo.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/NewStoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/NewStoreLogo.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Noise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Noise.png
--------------------------------------------------------------------------------
/CodeHub/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square310x310Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square310x310Logo.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square310x310Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square310x310Logo.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square310x310Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square310x310Logo.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square310x310Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square310x310Logo.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square310x310Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square310x310Logo.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-16_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-16_altform-unplated.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-24.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-256.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-256_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-256_altform-unplated.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-32.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-32_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-32_altform-unplated.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square44x44Logo.targetsize-48_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square44x44Logo.targetsize-48_altform-unplated.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square71x71Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square71x71Logo.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square71x71Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square71x71Logo.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square71x71Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square71x71Logo.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square71x71Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square71x71Logo.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Square71x71Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Square71x71Logo.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/StoreLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/StoreLogo.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/StoreLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/StoreLogo.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Target.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Target.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Target.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Target.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Target.scale-1600.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Target.scale-1600.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Target.scale-300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Target.scale-300.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CodeHub/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/CodeHub/Assets/flame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/flame.png
--------------------------------------------------------------------------------
/CodeHub/Assets/profile-placeholder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/profile-placeholder.png
--------------------------------------------------------------------------------
/CodeHub/Assets/transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aalok05/CodeHub/cbdcfacbb38f0e17113f4dc12102e43218178793/CodeHub/Assets/transparent.png
--------------------------------------------------------------------------------
/CodeHub/Controls/ActivityListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class ActivityListItem : UserControl
8 | {
9 | public ActivityListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/AnimatedComboBox.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using System.Collections;
3 | using UICompositionAnimations;
4 | using UICompositionAnimations.Enums;
5 | using Windows.UI.Xaml;
6 | using Windows.UI.Xaml.Controls;
7 |
8 | namespace CodeHub.Controls
9 | {
10 | ///
11 | /// A simple ComboBox with an open/close animation for the drop down menu
12 | ///
13 | public class AnimatedComboBox : ComboBox
14 | {
15 | // The element that contains the drop down menu to animate
16 | private FrameworkElement _TranslationElement;
17 |
18 | protected override void OnApplyTemplate()
19 | {
20 | base.OnApplyTemplate();
21 | _TranslationElement = GetTemplateChild("CoreGrid") as FrameworkElement;
22 | }
23 |
24 | // Animate the drop down menu
25 | protected override async void OnDropDownOpened(object e)
26 | {
27 | if (_TranslationElement != null)
28 | {
29 | // Pick the animation direction depending on the current position
30 | int? count = ((ItemsSource as ICollection)?.Count ?? (ItemsSource as IEnumerable)?.Count())
31 | ?? Items?.Count;
32 | bool down = count == null || ((SelectedIndex < 1 || SelectedIndex <= count / 2) &&
33 | !(count == 2 && SelectedIndex == 1));
34 | float start = down ? -16 : 16;
35 |
36 | _TranslationElement.Animation().Offset(Axis.Y, start);
37 |
38 | // Animate using Windows.UI.Composition animations to avoid frame drops
39 | await _TranslationElement.Animation()
40 | .Translation(Axis.Y, start, 0, Easing.CircleEaseOut)
41 | .Duration(250)
42 | .StartAsync();
43 |
44 | }
45 | base.OnDropDownOpened(e);
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/CodeHub/Controls/BusyScreen.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/CodeHub/Controls/BusyScreen.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml;
2 | using Windows.UI.Xaml.Controls;
3 |
4 | namespace CodeHub.Controls
5 | {
6 | public sealed partial class BusyScreen : UserControl
7 | {
8 | public BusyScreen()
9 | {
10 | InitializeComponent();
11 | }
12 | public string BusyText
13 | {
14 | get => (string)GetValue(BusyTextProperty);
15 | set => SetValue(BusyTextProperty, value);
16 | }
17 |
18 | public static readonly DependencyProperty BusyTextProperty =
19 | DependencyProperty.Register(nameof(BusyText), typeof(string), typeof(BusyScreen), new PropertyMetadata(false));
20 |
21 | public bool IsBusy
22 | {
23 | get => (bool)GetValue(IsBusyProperty);
24 | set => SetValue(IsBusyProperty, value);
25 | }
26 |
27 | public static readonly DependencyProperty IsBusyProperty =
28 | DependencyProperty.Register(nameof(IsBusy), typeof(bool), typeof(BusyScreen), new PropertyMetadata(false));
29 |
30 | }
31 | }
--------------------------------------------------------------------------------
/CodeHub/Controls/CodeListItem.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
41 |
42 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/CodeHub/Controls/CodeListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class CodeListItem : UserControl
8 | {
9 | public CodeListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/CommentListItem.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
33 |
41 |
52 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/CodeHub/Controls/CommentListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Views;
2 | using GalaSoft.MvvmLight.Ioc;
3 | using Octokit;
4 | using Windows.UI.Xaml.Controls;
5 | using Windows.UI.Xaml.Input;
6 |
7 |
8 | namespace CodeHub.Controls
9 | {
10 | public sealed partial class CommentListItem : UserControl
11 | {
12 | public CommentListItem()
13 | => InitializeComponent();
14 |
15 | public void User_Tapped(object sender, TappedRoutedEventArgs e)
16 | => SimpleIoc
17 | .Default
18 | .GetInstance()
19 | .NavigateAsync(typeof(DeveloperProfileView), (DataContext as IssueComment).User);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CodeHub/Controls/CommitFileListItem.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
16 |
20 |
23 |
24 |
25 |
29 |
32 |
36 |
39 |
43 |
44 |
51 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/CodeHub/Controls/CommitFileListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using UICompositionAnimations;
2 | using UICompositionAnimations.Enums;
3 | using Windows.UI.Xaml;
4 | using Windows.UI.Xaml.Controls;
5 |
6 |
7 | namespace CodeHub.Controls
8 | {
9 | public sealed partial class CommitFileListItem : UserControl
10 | {
11 | public CommitFileListItem()
12 | => InitializeComponent();
13 |
14 | private async void Expander_Click(object sender, RoutedEventArgs e)
15 | {
16 | if (PatchText.Visibility == Visibility.Visible)
17 | {
18 | ExpanderIcon.Glyph = "\uE0E5";
19 |
20 | await PatchText.Animation()
21 | .Opacity(1, 0)
22 | .Scale(1, 0.98f, Easing.SineEaseInOut)
23 | .Duration(100)
24 | .StartAsync();
25 | PatchText.Visibility = Visibility.Collapsed;
26 | }
27 | else
28 | {
29 | ExpanderIcon.Glyph = "\uE0E4";
30 |
31 | PatchText.Visibility = Visibility.Visible;
32 | await PatchText.Animation()
33 | .Opacity(0, 1)
34 | .Scale(0.98f, 1, Easing.SineEaseInOut)
35 | .Duration(100)
36 | .StartAsync();
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/CodeHub/Controls/CommitListItem.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
19 |
22 |
25 |
26 |
29 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CodeHub/Controls/CommitListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class CommitListItem : UserControl
8 | {
9 | public CommitListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/FirstTrendingRepoControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Octokit;
2 | using Windows.UI.Xaml;
3 | using Windows.UI.Xaml.Controls;
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class FirstTrendingRepoControl : UserControl
8 | {
9 | public FirstTrendingRepoControl()
10 | => InitializeComponent();
11 |
12 | public Repository Repository
13 | {
14 | get => (Repository)GetValue(RepositoryProperty);
15 | set => SetValue(RepositoryProperty, value);
16 | }
17 |
18 | public static readonly DependencyProperty RepositoryProperty =
19 | DependencyProperty.Register(nameof(Repository), typeof(Repository), typeof(FirstTrendingRepoControl), new PropertyMetadata(false));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CodeHub/Controls/HamMenuListItem.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
24 |
25 |
28 |
32 |
33 |
34 |
35 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/CodeHub/Controls/HamMenuListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class HamMenuListItem : UserControl
8 | {
9 | public HamMenuListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/HtmlToRtfConverter.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml;
2 | using Windows.UI.Xaml.Controls;
3 |
4 | namespace CodeHub.Controls
5 | {
6 | public class HtmlToRtfConverter
7 | {
8 | // Getter and Setter
9 | public static string GetHtmlString(DependencyObject obj)
10 | => (string)obj.GetValue(HtmlStringProperty);
11 |
12 | public static void SetHtmlString(DependencyObject obj, string value)
13 | => obj.SetValue(HtmlStringProperty, value);
14 |
15 | public static readonly DependencyProperty HtmlStringProperty =
16 | DependencyProperty.RegisterAttached("HtmlString", typeof(string), typeof(HtmlToRtfConverter), new PropertyMetadata("", OnHtmlChanged));
17 |
18 | private static void OnHtmlChanged(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
19 | {
20 | if (sender is WebView wv && eventArgs.NewValue != null)
21 | {
22 | wv.NavigateToString((string)eventArgs.NewValue);
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CodeHub/Controls/IssueListItem.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
26 |
31 |
34 |
35 |
36 |
40 |
41 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/CodeHub/Controls/IssueListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class IssueListItem : UserControl
8 | {
9 | public IssueListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/LabelListItem.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CodeHub/Controls/LabelListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class LabelListItem : UserControl
8 | {
9 | public LabelListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/MarkdownEditorControl.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/CodeHub/Controls/MarkdownEditorControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Toolkit.Uwp.UI.Controls;
2 | using System;
3 | using Windows.UI.Text;
4 | using Windows.UI.Xaml;
5 | using Windows.UI.Xaml.Controls;
6 |
7 | namespace CodeHub.Controls
8 | {
9 | public sealed partial class MarkdownEditorControl : UserControl
10 | {
11 | public MarkdownEditorControl()
12 | => InitializeComponent();
13 |
14 | public string MarkdownText
15 | {
16 | get => (string)GetValue(MarkdownTextProperty);
17 | set => SetValue(MarkdownTextProperty, value);
18 | }
19 |
20 | public static readonly DependencyProperty MarkdownTextProperty =
21 | DependencyProperty.Register(nameof(MarkdownText), typeof(string), typeof(MarkdownEditorControl), new PropertyMetadata(false));
22 |
23 | private void EditZone_TextChanged(object sender, RoutedEventArgs e)
24 | {
25 | MarkdownText = Toolbar.Formatter?.Text;
26 | Previewer.Text = string.IsNullOrWhiteSpace(Toolbar.Formatter?.Text) ? new Windows.ApplicationModel.Resources.ResourceLoader().GetString("markdownComment_NoContent") : Toolbar.Formatter?.Text;
27 | }
28 |
29 | public async void MarkdownTextBlock_LinkClicked(object sender, LinkClickedEventArgs e)
30 | => await Windows.System.Launcher.LaunchUriAsync(new Uri(e.Link));
31 |
32 | public void SetMarkdowntext(string text)
33 | => EditZone.Document.SetText(TextSetOptions.ApplyRtfDocumentDefaults, text);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CodeHub/Controls/OrganizationListItem.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
24 |
25 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CodeHub/Controls/OrganizationListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class OrganizationListItem : UserControl
8 | {
9 | public OrganizationListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/PullRequestListItem.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
24 |
25 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/CodeHub/Controls/PullRequestListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class PullRequestListItem : UserControl
8 | {
9 | public PullRequestListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/ReleaseListItem.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
17 |
20 |
22 |
23 |
26 |
29 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/CodeHub/Controls/ReleaseListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class ReleaseListItem : UserControl
8 | {
9 | public ReleaseListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/RepoListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 |
4 | namespace CodeHub.Controls
5 | {
6 | public sealed partial class RepoListItem : UserControl
7 | {
8 | public RepoListItem()
9 | => InitializeComponent();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/CodeHub/Controls/SignInPage.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
18 |
19 |
20 |
21 |
25 |
26 |
33 |
39 |
40 |
41 |
46 |
47 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/CodeHub/Controls/SignInPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Input;
2 | using Windows.UI.Xaml;
3 | using Windows.UI.Xaml.Controls;
4 |
5 |
6 | namespace CodeHub.Controls
7 | {
8 | public sealed partial class SignInPage : UserControl
9 | {
10 | public SignInPage()
11 | => InitializeComponent();
12 |
13 | public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("SignInCommand", typeof(ICommand), typeof(SignInPage), null);
14 |
15 | public ICommand SignInCommand
16 | {
17 | get => (ICommand)GetValue(CommandProperty);
18 | set => SetValue(CommandProperty, value);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CodeHub/Controls/SyntaxHighlightPreviewControl.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
24 |
25 |
26 |
27 |
29 |
31 |
33 |
34 | {
38 |
42 |
46 |
50 |
52 |
54 |
56 |
57 | {
61 |
62 |
63 |
--------------------------------------------------------------------------------
/CodeHub/Controls/SyntaxHighlightPreviewControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class SyntaxHighlightPreviewControl : UserControl
8 | {
9 | public SyntaxHighlightPreviewControl()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/TopScrollerControl.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
24 |
25 |
26 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CodeHub/Controls/UserListItem.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
23 |
24 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/CodeHub/Controls/UserListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
4 |
5 | namespace CodeHub.Controls
6 | {
7 | public sealed partial class UserListItem : UserControl
8 | {
9 | public UserListItem()
10 | => InitializeComponent();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CodeHub/Controls/WhatsNewPopupControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using UICompositionAnimations;
2 | using UICompositionAnimations.Enums;
3 | using Windows.UI.Xaml;
4 | using Windows.UI.Xaml.Controls;
5 |
6 |
7 | namespace CodeHub.Controls
8 | {
9 | public sealed partial class WhatsNewPopupControl : UserControl
10 | {
11 | public WhatsNewPopupControl()
12 | => InitializeComponent();
13 |
14 | public string WhatsNewText
15 | {
16 | get => (string)GetValue(WhatsNewTextroperty);
17 | set => SetValue(WhatsNewTextroperty, value);
18 | }
19 |
20 | public static readonly DependencyProperty WhatsNewTextroperty =
21 | DependencyProperty.Register(nameof(WhatsNewText), typeof(string), typeof(WhatsNewPopupControl), new PropertyMetadata(false));
22 |
23 | private async void CloseWhatsNew_Tapped(object sender, RoutedEventArgs e)
24 | {
25 | await this.Animation()
26 | .Opacity(1, 0)
27 | .Scale(1, 1.1f, Easing.SineEaseInOut)
28 | .Duration(150)
29 | .StartAsync();
30 |
31 | Visibility = Visibility.Collapsed;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CodeHub/Converters/BooleanToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml;
3 | using Windows.UI.Xaml.Data;
4 |
5 | namespace CodeHub.Converters
6 | {
7 | class BooleanToVisibilityConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, string language)
10 | => (bool)value ? Visibility.Visible : Visibility.Collapsed;
11 |
12 | public object ConvertBack(object value, Type targetType, object parameter, string language)
13 | => throw new NotImplementedException();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CodeHub/Converters/ColorStringToColorBrushConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using System;
3 | using Windows.UI.Xaml.Data;
4 |
5 | namespace CodeHub.Converters
6 | {
7 | class ColorStringToColorBrushConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, string language)
10 | => GlobalHelper.GetSolidColorBrush((value as string) + "FF");
11 |
12 | public object ConvertBack(object value, Type targetType, object parameter, string language)
13 | => throw new NotImplementedException();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CodeHub/Converters/EventTypeToActionStringConverter.cs:
--------------------------------------------------------------------------------
1 | using Octokit;
2 | using System;
3 | using Windows.UI.Xaml.Data;
4 |
5 | namespace CodeHub.Converters
6 | {
7 | class EventTypeToActionStringConverter : IValueConverter
8 | {
9 | ///
10 | /// Converts Event type to Action string.
11 | /// Action string indicates in a verbose manner, what action was done by the actor in an event
12 | ///
13 | ///
14 | ///
15 | ///
16 | ///
17 | ///
18 | public object Convert(object value, Type targetType, object parameter, string language)
19 | {
20 | var activity = value as Activity;
21 |
22 | var languageLoader = new Windows.ApplicationModel.Resources.ResourceLoader();
23 |
24 | try
25 | {
26 | switch (activity.Type)
27 | {
28 | case "IssueCommentEvent":
29 | return string.Format(languageLoader.GetString("activity_CommentedIssue"), ((IssueCommentPayload)activity.Payload).Issue.Number);
30 |
31 | case "PullRequestReviewCommentEvent":
32 | return string.Format(languageLoader.GetString("activity_CommentedPR"), ((PullRequestCommentPayload)activity.Payload).PullRequest.Number);
33 |
34 | case "PullRequestEvent":
35 | case "PullRequestReviewEvent":
36 | return string.Format(languageLoader.GetString("activity_ActivityWithPR"), ActionConverter(((PullRequestEventPayload)activity.Payload).Action), ((PullRequestEventPayload)activity.Payload).PullRequest.Number);
37 |
38 | case "CommitCommentEvent":
39 | return languageLoader.GetString("activity_CommentedCommit");
40 |
41 | case "PushEvent":
42 | return string.Format(languageLoader.GetString("activity_PushedCommits"), ((PushEventPayload)activity.Payload).Commits.Count);
43 |
44 | case "IssuesEvent":
45 | return string.Format(languageLoader.GetString("activity_ActivityWithIssues"), ActionConverter(((IssueEventPayload)activity.Payload).Action), ((IssueEventPayload)activity.Payload).Issue.Number);
46 |
47 | case "CreateEvent":
48 | return languageLoader.GetString("activity_CreatedBranch");
49 |
50 | case "DeleteEvent":
51 | return languageLoader.GetString("activity_DeletedBranch");
52 |
53 | case "ForkEvent":
54 | return languageLoader.GetString("activity_ForkedRepository");
55 |
56 | case "WatchEvent":
57 | return languageLoader.GetString("activity_StarredRepository");
58 |
59 | case "PublicEvent":
60 | return languageLoader.GetString("activity_PublishedRepository");
61 |
62 | case "ReleaseEvent":
63 | return languageLoader.GetString("activity_PublishedRelease");
64 |
65 | default:
66 | return languageLoader.GetString("activity_DefaultAction");
67 | }
68 | }
69 | catch
70 | {
71 | return languageLoader.GetString("activity_DefaultAction");
72 | }
73 | }
74 |
75 | public object ConvertBack(object value, Type targetType, object parameter, string language)
76 | {
77 | throw new NotImplementedException();
78 | }
79 |
80 | ///
81 | /// Convert "opened", "reopened", "closed" word to a localized phrase
82 | ///
83 | /// opened OR reopened OR closed
84 | /// Localized phrase
85 | public string ActionConverter(string action)
86 | {
87 | var languageLoader = new Windows.ApplicationModel.Resources.ResourceLoader();
88 |
89 | switch (action)
90 | {
91 | case "opened":
92 | return languageLoader.GetString("activity_ActionOpened");
93 |
94 | case "reopened":
95 | return languageLoader.GetString("activity_ActionReOpened");
96 |
97 | case "closed":
98 | return languageLoader.GetString("activity_ActionClosed");
99 |
100 | default:
101 | return action;
102 | }
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/CodeHub/Converters/EventTypeToCommentStringConverter.cs:
--------------------------------------------------------------------------------
1 | using Octokit;
2 | using System;
3 | using Windows.UI.Xaml.Data;
4 |
5 | namespace CodeHub.Converters
6 | {
7 | class EventTypeToCommentStringConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, string language)
10 | {
11 | var activity = value as Activity;
12 |
13 | switch (activity.Type)
14 | {
15 | case "IssueCommentEvent":
16 | return ((IssueCommentPayload)activity.Payload).Comment.Body;
17 |
18 | case "PullRequestReviewCommentEvent":
19 | return ((PullRequestCommentPayload)activity.Payload).Comment.Body;
20 |
21 | case "PushEvent":
22 | return ((PushEventPayload)activity.Payload).Ref;
23 |
24 | case "CommitCommentEvent":
25 | return ((CommitCommentPayload)activity.Payload).Comment.Body;
26 |
27 | default: return string.Empty;
28 | }
29 | }
30 |
31 | public object ConvertBack(object value, Type targetType, object parameter, string language)
32 | => throw new NotImplementedException();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CodeHub/Converters/ForegroundFromBackgroundConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using System;
3 | using Windows.UI;
4 | using Windows.UI.Xaml.Data;
5 | using Windows.UI.Xaml.Media;
6 |
7 | namespace CodeHub.Converters
8 | {
9 | class ForegroundFromBackgroundConverter : IValueConverter
10 | {
11 | public object Convert(object value, Type targetType, object parameter, string language)
12 | {
13 | SolidColorBrush background = GlobalHelper.GetSolidColorBrush((value as string) + "FF");
14 | return new SolidColorBrush(PerceivedBrightness(background) > 130 ? Colors.Black : Colors.White);
15 | }
16 |
17 | public object ConvertBack(object value, Type targetType, object parameter, string language)
18 | => throw new NotImplementedException();
19 |
20 | private int PerceivedBrightness(SolidColorBrush c)
21 | => (int)Math.Sqrt(
22 | c.Color.R * c.Color.R * .299 +
23 | c.Color.G * c.Color.G * .587 +
24 | c.Color.B * c.Color.B * .114);
25 | }
26 | }
--------------------------------------------------------------------------------
/CodeHub/Converters/InverseBooleanConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml.Data;
3 |
4 | namespace CodeHub.Converters
5 | {
6 | class InverseBooleanConverter : IValueConverter
7 | {
8 | public object Convert(object value, Type targetType, object parameter, string language)
9 | => !(bool)value;
10 |
11 | public object ConvertBack(object value, Type targetType, object parameter, string language)
12 | => !(bool)value;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CodeHub/Converters/IssueDetailStringConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using Octokit;
3 | using System;
4 | using Windows.UI.Xaml.Data;
5 |
6 | namespace CodeHub.Converters
7 | {
8 | class IssueDetailStringConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, string language)
11 | {
12 | var issue = (Issue)value;
13 |
14 | if (issue.State.TryParse(out ItemState eventState))
15 | {
16 | switch (eventState)
17 | {
18 | case ItemState.Open:
19 | return $"#{issue.Number} opened by {issue.User.Login} {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(issue.CreatedAt.ToString()))}";
20 |
21 | case ItemState.Closed:
22 | return $"#{issue.Number} by {issue.User.Login} was closed {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(issue.CreatedAt.ToString()))}";
23 |
24 | }
25 | }
26 |
27 | return string.Empty;
28 | }
29 |
30 | public object ConvertBack(object value, Type targetType, object parameter, string language)
31 | => throw new NotImplementedException();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CodeHub/Converters/IssueStateToColorConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using Octokit;
3 | using System;
4 | using Windows.UI.Xaml.Data;
5 |
6 | namespace CodeHub.Converters
7 | {
8 | public class IssueStateToColorConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, string language)
11 | {
12 | var issue = (Issue)value;
13 | if (issue != null)
14 | {
15 | if (issue.State.TryParse(out ItemState state))
16 | {
17 | switch (state)
18 | {
19 | case ItemState.Open:
20 | return GlobalHelper.GetSolidColorBrush("2CBE4EFF");
21 | }
22 | }
23 | }
24 | return GlobalHelper.GetSolidColorBrush("CB2431FF");
25 | }
26 |
27 | public object ConvertBack(object value, Type targetType, object parameter, string language)
28 | => throw new NotImplementedException();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CodeHub/Converters/IssueToSymbolConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using Octokit;
3 | using System;
4 | using Windows.UI.Xaml.Data;
5 |
6 | namespace CodeHub.Converters
7 | {
8 | public class IssueToSymbolConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, string language)
11 | {
12 | var issue = (Issue)value;
13 | if (issue != null)
14 | {
15 | if (issue.State == ItemState.Open)
16 | {
17 | if (issue.PullRequest != null)
18 | {
19 | //open PR
20 | return GlobalHelper.GetGeomtery("M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z");
21 | }
22 | else
23 | {
24 | //open issue
25 | return GlobalHelper.GetGeomtery("M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z");
26 | }
27 | }
28 | else
29 | {
30 | if (issue.PullRequest != null)
31 | {
32 | //closed PR
33 | return GlobalHelper.GetGeomtery("M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z");
34 | }
35 | else
36 | {
37 | //closed issue
38 | return GlobalHelper.GetGeomtery("M7 10h2v2H7v-2zm2-6H7v5h2V4zm1.5 1.5l-1 1L12 9l4-4.5-1-1L12 7l-1.5-1.5zM8 13.7A5.71 5.71 0 0 1 2.3 8c0-3.14 2.56-5.7 5.7-5.7 1.83 0 3.45.88 4.5 2.2l.92-.92A6.947 6.947 0 0 0 8 1C4.14 1 1 4.14 1 8s3.14 7 7 7 7-3.14 7-7l-1.52 1.52c-.66 2.41-2.86 4.19-5.48 4.19v-.01z");
39 | }
40 | }
41 | }
42 |
43 | return null;
44 | }
45 |
46 | public object ConvertBack(object value, Type targetType, object parameter, string language)
47 | => throw new NotImplementedException();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/CodeHub/Converters/NotifTypeToSymbolConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml.Data;
3 | using Windows.UI.Xaml.Markup;
4 | using Windows.UI.Xaml.Media;
5 |
6 | namespace CodeHub.Converters
7 | {
8 | class NotifTypeToSymbolConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, string language)
11 | {
12 | switch ((string)value)
13 | {
14 | case "Issue":
15 | var issueSymbol = "M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z";
16 | return (Geometry)XamlReader.Load(issueSymbol);
17 |
18 | case "PullRequest":
19 | var pullReqSymbol = "M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z";
20 | return (Geometry)XamlReader.Load(pullReqSymbol);
21 |
22 | default:
23 | var notifSymbol = "M7 1C3.14 1 0 4.14 0 8s3.14 7 7 7c.48 0 .94-.05 1.38-.14-.17-.08-.2-.73-.02-1.09.19-.41.81-1.45.2-1.8-.61-.35-.44-.5-.81-.91-.37-.41-.22-.47-.25-.58-.08-.34.36-.89.39-.94.02-.06.02-.27 0-.33 0-.08-.27-.22-.34-.23-.06 0-.11.11-.2.13-.09.02-.5-.25-.59-.33-.09-.08-.14-.23-.27-.34-.13-.13-.14-.03-.33-.11s-.8-.31-1.28-.48c-.48-.19-.52-.47-.52-.66-.02-.2-.3-.47-.42-.67-.14-.2-.16-.47-.2-.41-.04.06.25.78.2.81-.05.02-.16-.2-.3-.38-.14-.19.14-.09-.3-.95s.14-1.3.17-1.75c.03-.45.38.17.19-.13-.19-.3 0-.89-.14-1.11-.13-.22-.88.25-.88.25.02-.22.69-.58 1.16-.92.47-.34.78-.06 1.16.05.39.13.41.09.28-.05-.13-.13.06-.17.36-.13.28.05.38.41.83.36.47-.03.05.09.11.22s-.06.11-.38.3c-.3.2.02.22.55.61s.38-.25.31-.55c-.07-.3.39-.06.39-.06.33.22.27.02.5.08.23.06.91.64.91.64-.83.44-.31.48-.17.59.14.11-.28.3-.28.3-.17-.17-.19.02-.3.08-.11.06-.02.22-.02.22-.56.09-.44.69-.42.83 0 .14-.38.36-.47.58-.09.2.25.64.06.66-.19.03-.34-.66-1.31-.41-.3.08-.94.41-.59 1.08.36.69.92-.19 1.11-.09.19.1-.06.53-.02.55.04.02.53.02.56.61.03.59.77.53.92.55.17 0 .7-.44.77-.45.06-.03.38-.28 1.03.09.66.36.98.31 1.2.47.22.16.08.47.28.58.2.11 1.06-.03 1.28.31.22.34-.88 2.09-1.22 2.28-.34.19-.48.64-.84.92s-.81.64-1.27.91c-.41.23-.47.66-.66.8 3.14-.7 5.48-3.5 5.48-6.84 0-3.86-3.14-7-7-7L7 1zm1.64 6.56c-.09.03-.28.22-.78-.08-.48-.3-.81-.23-.86-.28 0 0-.05-.11.17-.14.44-.05.98.41 1.11.41.13 0 .19-.13.41-.05.22.08.05.13-.05.14zM6.34 1.7c-.05-.03.03-.08.09-.14.03-.03.02-.11.05-.14.11-.11.61-.25.52.03-.11.27-.58.3-.66.25zm1.23.89c-.19-.02-.58-.05-.52-.14.3-.28-.09-.38-.34-.38-.25-.02-.34-.16-.22-.19.12-.03.61.02.7.08.08.06.52.25.55.38.02.13 0 .25-.17.25zm1.47-.05c-.14.09-.83-.41-.95-.52-.56-.48-.89-.31-1-.41-.11-.1-.08-.19.11-.34.19-.15.69.06 1 .09.3.03.66.27.66.55.02.25.33.5.19.63h-.01z";
24 | return (Geometry)XamlReader.Load(notifSymbol);
25 | }
26 | }
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, string language)
29 | => throw new NotImplementedException();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CodeHub/Converters/ObjectToStringConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml.Data;
3 |
4 | namespace CodeHub.Converters
5 | {
6 | class ObjectToStringConverter : IValueConverter
7 | {
8 | public object Convert(object value, Type targetType, object parameter, string language)
9 | => value != null ? value.ToString() : string.Empty;
10 |
11 | public object ConvertBack(object value, Type targetType, object parameter, string language)
12 | => throw new NotImplementedException();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CodeHub/Converters/PullRequestDetailStringConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using Octokit;
3 | using System;
4 | using Windows.UI.Xaml.Data;
5 |
6 | namespace CodeHub.Converters
7 | {
8 | class PullRequestDetailStringConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, string language)
11 | {
12 | var pr = (PullRequest)value;
13 |
14 | if (pr.State.TryParse(out ItemState eventState))
15 | {
16 | switch (eventState)
17 | {
18 | case ItemState.Open:
19 | return $"#{pr.Number} opened by {pr.User.Login} {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(pr.CreatedAt.ToString()))}";
20 |
21 | case ItemState.Closed:
22 | return $"#{pr.Number} by {pr.User.Login} was merged {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(pr.CreatedAt.ToString()))}";
23 |
24 | }
25 | }
26 |
27 | return string.Empty;
28 | }
29 |
30 | public object ConvertBack(object value, Type targetType, object parameter, string language)
31 | => throw new NotImplementedException();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CodeHub/Converters/PullRequestStateToColorConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using Octokit;
3 | using System;
4 | using Windows.UI.Xaml.Data;
5 |
6 | namespace CodeHub.Converters
7 | {
8 | public class PullRequestStateToColorConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, string language)
11 | {
12 | if (((PullRequest)value).State.TryParse(out ItemState state))
13 | {
14 | switch (state)
15 | {
16 | case ItemState.Open:
17 | return GlobalHelper.GetSolidColorBrush("2CBE4EFF");
18 | }
19 | }
20 |
21 | return GlobalHelper.GetSolidColorBrush("CB2431FF");
22 | }
23 |
24 | public object ConvertBack(object value, Type targetType, object parameter, string language)
25 | => throw new NotImplementedException();
26 | }
27 | }
--------------------------------------------------------------------------------
/CodeHub/Converters/RepositoryContentToFileIconConverter.cs:
--------------------------------------------------------------------------------
1 | using Octokit;
2 | using System;
3 | using System.Text.RegularExpressions;
4 | using Windows.UI.Xaml.Data;
5 |
6 | namespace CodeHub.Converters
7 | {
8 | class RepositoryContentToFileIconConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, string language)
11 | {
12 | if (!(value is RepositoryContent content))
13 | {
14 | return string.Empty;
15 | }
16 |
17 | const int unknown = 0xE160, file = 0xE7C3, link = 0xE816, folder = 0xE8D5;
18 |
19 | if (content.Type.TryParse(out ContentType fileType))
20 | {
21 | switch (fileType)
22 | {
23 | case ContentType.File:
24 | return Regex.IsMatch(content.Name, @"[^.]+([.]\w+)")
25 | ? System.Convert.ToChar(file).ToString()
26 | : System.Convert.ToChar(unknown).ToString();
27 | case ContentType.Dir:
28 | return System.Convert.ToChar(folder).ToString();
29 | default: return System.Convert.ToChar(link).ToString();
30 | }
31 | }
32 |
33 | return System.Convert.ToChar(link).ToString();
34 | }
35 |
36 | public object ConvertBack(object value, Type targetType, object parameter, string language)
37 | => throw new NotImplementedException();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/CodeHub/Converters/RepositoryCreationTimeConverter.cs:
--------------------------------------------------------------------------------
1 | using Octokit;
2 | using System;
3 | using Windows.UI.Xaml.Data;
4 |
5 |
6 | namespace CodeHub.Converters
7 | {
8 | ///
9 | /// A simple converter that returns the formatted creation time for a repository
10 | ///
11 | public class RepositoryCreationTimeConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, string language)
14 | {
15 | var repo = value as Repository;
16 | return repo?.CreatedAt.ToString("dd MMM yyyy", null) ?? string.Empty;
17 | }
18 |
19 | public object ConvertBack(object value, Type targetType, object parameter, string language)
20 | => throw new NotImplementedException();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/CodeHub/Converters/ReverseBooleanToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml;
3 | using Windows.UI.Xaml.Data;
4 |
5 | namespace CodeHub.Converters
6 | {
7 | class ReverseBooleanToVisibilityConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, string language)
10 | => (bool)value ? Visibility.Collapsed : Visibility.Visible;
11 |
12 | public object ConvertBack(object value, Type targetType, object parameter, string language)
13 | => throw new NotImplementedException();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CodeHub/Converters/TimeAgoConverter.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using System;
3 | using Windows.UI.Xaml.Data;
4 |
5 | namespace CodeHub.Converters
6 | {
7 | class TimeAgoConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, string language)
10 | {
11 | if (value == null)
12 | {
13 | return null;
14 | }
15 |
16 | var dt = DateTime.Parse(value.ToString());
17 | return GlobalHelper.ConvertDateToTimeAgoFormat(dt);
18 | }
19 |
20 | public object ConvertBack(object value, Type targetType, object parameter, string language)
21 | => throw new NotSupportedException();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CodeHub/Helpers/BackgroundTaskStatus.cs:
--------------------------------------------------------------------------------
1 | namespace CodeHub.Helpers
2 | {
3 | public enum BackgroundTaskStatus
4 | {
5 | Error,
6 | Success
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/CodeHub/Helpers/BackgroundTaskStorage.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Windows.Foundation.Collections;
3 | using Windows.Storage;
4 |
5 | namespace CodeHub.Helpers
6 | {
7 | public static class BackgroundTaskStorage
8 | {
9 | private static IPropertySet Values = ApplicationData.Current.LocalSettings.CreateContainer("BackgroundTaskStorage", ApplicationDataCreateDisposition.Always).Values;
10 |
11 | public static IPropertySet GetValues()
12 | => Values;
13 |
14 | public static void PutError(string message)
15 | => Values["error"] = message;
16 |
17 | public static string GetError()
18 | => Values.ContainsKey("error") ? Values["error"] as string : null;
19 |
20 | public static void PutAnswer(object answer)
21 | {
22 | // Clear the message since it was successful
23 | PutError(null);
24 |
25 | Values["answer"] = answer;
26 | }
27 |
28 | public static object GetAnswer()
29 | {
30 | Values.TryGetValue("answer", out object obj);
31 |
32 | return obj;
33 | }
34 |
35 | public static IDictionary ConvertValueSetToDictionary(ValueSet valueSet)
36 | {
37 | var converted = new Dictionary();
38 |
39 | foreach (var value in valueSet)
40 | {
41 | converted[value.Key] = value.Value;
42 | }
43 |
44 | return converted;
45 | }
46 |
47 | public static ApplicationDataCompositeValue ConvertValueSetToApplicationDataCompositeValue(ValueSet valueSet)
48 | {
49 | var converted = new ApplicationDataCompositeValue();
50 |
51 | foreach (var value in valueSet)
52 | {
53 | converted[value.Key] = value.Value;
54 | }
55 |
56 | return converted;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/CodeHub/Helpers/BadgeHelper.cs:
--------------------------------------------------------------------------------
1 | using Windows.Data.Xml.Dom;
2 | using Windows.UI.Notifications;
3 |
4 | namespace CodeHub.Helpers
5 | {
6 | public static class BadgeHelper
7 | {
8 | private static BadgeNotification BuildBadge(int number)
9 | {
10 | // Get the blank badge XML payload for a badge number
11 | var badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);
12 |
13 | // Set the value of the badge in the XML to our number
14 | var badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
15 | badgeElement.SetAttribute("value", number.ToString());
16 | return new BadgeNotification(badgeXml);
17 | }
18 |
19 | public static void UpdateBadge(int number)
20 | {
21 | BadgeUpdateManager
22 | .CreateBadgeUpdaterForApplication()
23 | .Update(BuildBadge(number));
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CodeHub/Helpers/StringHelper.cs:
--------------------------------------------------------------------------------
1 | namespace CodeHub.Helpers
2 | {
3 | public static class StringHelper
4 | {
5 | public static bool IsNullOrEmptyOrWhiteSpace(this string @string)
6 | {
7 | return string.IsNullOrEmpty(@string) || string.IsNullOrWhiteSpace(@string);
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/CodeHub/Helpers/TilesHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Windows.Data.Xml.Dom;
3 | using Windows.UI.Notifications;
4 |
5 | namespace CodeHub.Helpers
6 | {
7 | public enum TilesBindingHintPresentation
8 | {
9 | Contacts,
10 | People,
11 | Photos
12 | }
13 | public enum TilesTextStyles
14 | {
15 | Base,
16 | BaseSubtle,
17 | Body,
18 | BodySubtle,
19 | Caption,
20 | CaptionSubtle,
21 | Header,
22 | HeaderNumeral,
23 | HeaderSubtle,
24 | SubHeader,
25 | SubHeaderNumeral,
26 | SubHeaderSubtle,
27 | Subtitle,
28 | SubtitleSubtle,
29 | Title,
30 | TitleSubtle
31 | }
32 | public enum TilesVisualBrandings
33 | {
34 | Default,
35 | None,
36 | Logo,
37 | Name,
38 | NameAndLogo,
39 | }
40 |
41 | public static class TilesHelper
42 | {
43 | public static void UpdateTile(TileNotification tile)
44 | {
45 | UpdateTile(tile, null);
46 | }
47 |
48 | public static void UpdateTile(TileNotification tile, string tag)
49 | {
50 | if (!string.IsNullOrEmpty(tag))
51 | {
52 | tile.Tag = tag;
53 | }
54 |
55 | TileUpdateManager.CreateTileUpdaterForApplication().Update(tile);
56 | }
57 |
58 | public static void UpdateTile(string tileXml)
59 | {
60 | UpdateTile(tileXml, null);
61 | }
62 |
63 | public static void UpdateTile(string tileXml, string tag)
64 | {
65 | var doc = new XmlDocument();
66 | doc.LoadXml(tileXml);
67 | UpdateTile(new TileNotification(doc), tag);
68 | }
69 |
70 | public static void UpdateTile(XmlDocument badgeXml)
71 | {
72 | UpdateTile(new TileNotification(badgeXml));
73 | }
74 |
75 | public static void UpdateTile(XmlDocument badgeXml, string tag)
76 | {
77 | UpdateTile(new TileNotification(badgeXml), tag);
78 | }
79 |
80 | public static async Task UpdateTile(Octokit.Notification notification)
81 | {
82 | var tile = await notification.BuildTiles(TilesTextStyles.Base, TilesTextStyles.SubtitleSubtle,
83 | TilesTextStyles.Body, TilesVisualBrandings.NameAndLogo);
84 | UpdateTile(tile, tile.Tag);
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/CodeHub/Helpers/XAMLHelper.cs:
--------------------------------------------------------------------------------
1 | using JetBrains.Annotations;
2 | using System;
3 | using Windows.UI.Xaml;
4 |
5 | namespace CodeHub.Helpers
6 | {
7 | ///
8 | /// A static class used to manage XAML resources
9 | ///
10 | public static class XAMLHelper
11 | {
12 | ///
13 | /// Assigns the given value to a XAML resource
14 | ///
15 | /// The Type of the resource
16 | /// The name of the resource
17 | /// The new value to use
18 | public static void AssignValueToXAMLResource([NotNull] string resourceName, T value)
19 | {
20 | // Parameter check
21 | if (resourceName.Length == 0)
22 | {
23 | throw new ArgumentException("The resource name is not valid");
24 | }
25 |
26 | // Safe cast to be sure the target resource has the Type of the new value
27 | if (Application.Current.Resources[resourceName]?.GetType() != typeof(T))
28 | {
29 | throw new InvalidOperationException("The target resource has a different type");
30 | }
31 |
32 | // Finally assign the new value to the resource
33 | Application.Current.Resources[resourceName] = value;
34 | }
35 |
36 | ///
37 | /// Retrieves the value of a given generic XAML resource
38 | ///
39 | /// The name of the resource
40 | public static object GetGenericResourceValue([NotNull] string resourceName)
41 | => Application.Current.Resources[resourceName];
42 |
43 | ///
44 | /// Retrieves the value of a given XAML resource
45 | ///
46 | /// The Type of the resource to get
47 | /// The name of the resource
48 | public static T GetResourceValue([NotNull] string resourceName)
49 | => Application.Current.Resources[resourceName].To();
50 | }
51 | }
--------------------------------------------------------------------------------
/CodeHub/Models/Account.cs:
--------------------------------------------------------------------------------
1 | namespace CodeHub.Models
2 | {
3 | public class Account
4 | {
5 | public int Id { get; set; }
6 | public string Login { get; set; }
7 | public string AvatarUrl { get; set; }
8 | public bool IsLoggedIn { get; set; }
9 | public bool IsActive { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/CodeHub/Models/BackgroundTaskBuilderModel.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using System;
3 | using System.Collections.Generic;
4 | using Windows.ApplicationModel.Background;
5 |
6 | namespace CodeHub.Models
7 | {
8 | class BackgroundTaskBuilderModel
9 | {
10 | private ICollection _Conditions;
11 |
12 | public string Name { get; private set; }
13 | public IBackgroundTrigger Trigger { get; private set; }
14 |
15 | public BackgroundTaskBuilderModel(string name)
16 | {
17 | SetName(name);
18 | }
19 |
20 | public BackgroundTaskBuilderModel(string name, IBackgroundTrigger trigger)
21 | : this(name)
22 | {
23 | SetTrigger(trigger);
24 | }
25 |
26 | public BackgroundTaskBuilderModel(string name, params IBackgroundCondition[] conditions)
27 | : this(name)
28 | {
29 | SetConditions(conditions);
30 | }
31 |
32 | public BackgroundTaskBuilderModel(string name, IBackgroundTrigger trigger, params IBackgroundCondition[] conditions)
33 | : this(name, trigger)
34 | {
35 | SetConditions(conditions);
36 | }
37 |
38 | public void SetName(string name)
39 | {
40 | Name = StringHelper.IsNullOrEmptyOrWhiteSpace(name) ? throw new ArgumentNullException(nameof(name)) : name;
41 | }
42 |
43 | public void SetTrigger(IBackgroundTrigger trigger)
44 | {
45 | Trigger = trigger ?? throw new ArgumentNullException(nameof(trigger));
46 | }
47 |
48 | public void AddCondition(IBackgroundCondition condition)
49 | {
50 | if (condition == null)
51 | {
52 | throw new ArgumentNullException(nameof(condition));
53 | }
54 |
55 | _Conditions = _Conditions ?? new UniqueCollection();
56 |
57 | if (!_Conditions.Contains(condition))
58 | {
59 | _Conditions.Add(condition);
60 | }
61 | }
62 |
63 | public void AddConditions(params IBackgroundCondition[] conditions)
64 | {
65 | if (conditions == null)
66 | {
67 | throw new ArgumentNullException(nameof(conditions));
68 | }
69 |
70 | _Conditions = _Conditions ?? new UniqueCollection();
71 |
72 | foreach (var condition in conditions)
73 | {
74 | if (!_Conditions.Contains(condition))
75 | {
76 | _Conditions.Add(condition);
77 | }
78 | }
79 | }
80 |
81 | public ref readonly ICollection GetConditions()
82 | {
83 | return ref _Conditions;
84 | }
85 |
86 | public void CombineConditions(params IBackgroundCondition[] conditions)
87 | {
88 | _Conditions = _Conditions.Combine(conditions);
89 | }
90 |
91 | public void RemoveConditions(params IBackgroundCondition[] conditions)
92 | {
93 | if (conditions == null)
94 | {
95 | throw new ArgumentNullException(nameof(conditions));
96 | }
97 |
98 | _Conditions = _Conditions ?? new UniqueCollection();
99 |
100 | foreach (var condition in conditions)
101 | {
102 | if (_Conditions.Contains(condition))
103 | {
104 | _Conditions.Remove(condition);
105 | }
106 | }
107 | }
108 |
109 | public void SetConditions(params IBackgroundCondition[] conditions)
110 | {
111 | _Conditions = conditions ?? throw new ArgumentNullException(nameof(conditions));
112 | }
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/CodeHub/Models/HamItem.cs:
--------------------------------------------------------------------------------
1 | using GalaSoft.MvvmLight;
2 | using System;
3 | using Windows.UI.Xaml;
4 | using Windows.UI.Xaml.Media;
5 |
6 | namespace CodeHub.Models
7 | {
8 | public class HamItem : ObservableObject
9 | {
10 | private bool _isSelected;
11 | public bool IsSelected
12 | {
13 | get => _isSelected;
14 | set
15 | {
16 | _isSelected = value;
17 | SelectedVisual = value ? Visibility.Visible : Visibility.Collapsed;
18 | RaisePropertyChanged("IsSelected");
19 | }
20 | }
21 |
22 | private Visibility _selectedVisual = Visibility.Collapsed;
23 | public Visibility SelectedVisual
24 | {
25 | get => _selectedVisual;
26 | set
27 | {
28 | _selectedVisual = value;
29 | RaisePropertyChanged("SelectedVisual");
30 | }
31 | }
32 |
33 | public string Label { get; set; }
34 | public Geometry Symbol { get; set; }
35 | public Type DestPage { get; set; }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/CodeHub/Models/IStartupNotification.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace CodeHub.Models
4 | {
5 | public interface IStartupNotification
6 | {
7 | string Name { get; }
8 |
9 | bool Contains(Type scenarioType);
10 |
11 | StartupNotification FindScenario(Type scenarioType);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CodeHub/Models/RepositoryContentWithCommitInfo.cs:
--------------------------------------------------------------------------------
1 | using JetBrains.Annotations;
2 | using Octokit;
3 | using System;
4 | using System.Text.RegularExpressions;
5 |
6 | namespace CodeHub.Models
7 | {
8 | ///
9 | /// A class that wraps a repository content and its linked commit
10 | ///
11 | public sealed class RepositoryContentWithCommitInfo
12 | {
13 | ///
14 | /// Gets the repository content for this instance
15 | ///
16 | [NotNull]
17 | public RepositoryContent Content { get; }
18 |
19 | ///
20 | /// Gets the linked commit, if available
21 | ///
22 | [CanBeNull]
23 | public GitHubCommit Commit { get; }
24 |
25 | // Private message field (shortcut to avoid repeated API calls)
26 | private readonly string _CommitMessage;
27 |
28 | ///
29 | /// Gets the available commit message, if present
30 | ///
31 | [CanBeNull]
32 | public string CommitMessage
33 | {
34 | get
35 | {
36 | if (Commit?.Commit.Message != null)
37 | {
38 | return Regex.Replace(Commit.Commit.Message, @":[^:]+: ?| ?:[^:]+:", string.Empty);
39 | }
40 | return _CommitMessage;
41 | }
42 | }
43 |
44 | ///
45 | /// Gets the last edit time for this instance, if available
46 | ///
47 | [CanBeNull]
48 | public DateTime? LastEditTime { get; }
49 |
50 | public RepositoryContentWithCommitInfo([NotNull] RepositoryContent content, [CanBeNull] GitHubCommit commit = null, [CanBeNull] string message = null, [CanBeNull] DateTime? editTime = null)
51 | {
52 | Content = content;
53 | Commit = commit;
54 | _CommitMessage = message;
55 | LastEditTime = editTime;
56 | }
57 |
58 | // Implicit converter for the content
59 | public static implicit operator RepositoryContent([NotNull] RepositoryContentWithCommitInfo instance) => instance.Content;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/CodeHub/Models/SettingsItem.cs:
--------------------------------------------------------------------------------
1 | using GalaSoft.MvvmLight;
2 | using System;
3 |
4 | namespace CodeHub.Models
5 | {
6 | public class SettingsItem : ObservableObject
7 | {
8 | public string MainText { get; set; }
9 | public string SubText { get; set; }
10 | public string GlyphString { get; set; }
11 | public Type DestPage { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CodeHub/Models/StartupNotification.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace CodeHub.Models
4 | {
5 | public class StartupNotification : IStartupNotification
6 | {
7 | ///
8 | /// Simply returns the PageUri, since that's guaranteed to be unique
9 | ///
10 | public string Id
11 | {
12 | get { return UIElementType.FullName; }
13 | }
14 |
15 | private readonly string _name;
16 | public string Name
17 | {
18 | get { return _name; }
19 | }
20 |
21 | public Type UIElementType { get; private set; }
22 |
23 | public StartupNotification(string name, Type uiElementType)
24 | {
25 | _name = name;
26 | UIElementType = uiElementType;
27 | }
28 |
29 | public override string ToString()
30 | {
31 | return Name + " - " + Id;
32 | }
33 |
34 | public bool Contains(Type scenarioType)
35 | {
36 | return FindScenario(scenarioType) != null;
37 | }
38 |
39 | public StartupNotification FindScenario(Type scenarioType)
40 | {
41 | if (UIElementType == scenarioType)
42 | {
43 | return this;
44 | }
45 |
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/CodeHub/Models/StartupNotificationGroup.cs:
--------------------------------------------------------------------------------
1 | using CodeHub.Helpers;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 |
6 | namespace CodeHub.Models
7 | {
8 | public class StartupNotificationGroup : IStartupNotification
9 | {
10 | private readonly string _name;
11 | public string Name => _name;
12 |
13 | public override string ToString()
14 | {
15 | return Name;
16 | }
17 |
18 | public IList Children { get; private set; }
19 |
20 | public StartupNotificationGroup(string name, IEnumerable children)
21 | {
22 | _name = name;
23 | Children = new List(children);
24 | }
25 |
26 | public bool Contains(Type scenarioType)
27 | {
28 | return FindScenario(scenarioType) != null;
29 | }
30 |
31 | public StartupNotification FindScenario(Type scenarioType)
32 | {
33 | foreach (var child in Children)
34 | {
35 | var found = child.FindScenario(scenarioType);
36 | if (found != null)
37 | {
38 | return found;
39 | }
40 | }
41 |
42 | return null;
43 | }
44 |
45 | public StartupNotificationGroup FindParent(IStartupNotification ofScenario)
46 | {
47 | foreach (var child in Children)
48 | {
49 | if (child == ofScenario)
50 | {
51 | return this;
52 | }
53 |
54 | if (child is StartupNotificationGroup)
55 | {
56 | var recursiveFound = (child as StartupNotificationGroup).FindParent(ofScenario);
57 | if (recursiveFound != null)
58 | {
59 | return recursiveFound;
60 | }
61 | }
62 | }
63 |
64 | return null;
65 | }
66 |
67 | public IList GetPathToScenario(StartupNotification scenario)
68 | {
69 | IList answer = new List() { this };
70 |
71 | GetPathToScenarioHelper(scenario, answer);
72 |
73 | return answer;
74 | }
75 |
76 | private void GetPathToScenarioHelper(StartupNotification scenario, IList listToAppendTo)
77 | {
78 | foreach (var child in Children.OfType())
79 | {
80 | if (child == scenario)
81 | {
82 | return;
83 | }
84 | }
85 |
86 | foreach (var groupChild in Children.OfType())
87 | {
88 | if (groupChild.Contains(scenario.UIElementType))
89 | {
90 | listToAppendTo.Add(groupChild);
91 | groupChild.GetPathToScenarioHelper(scenario, listToAppendTo);
92 | }
93 | }
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/CodeHub/Models/StartupNotificationTypes.cs:
--------------------------------------------------------------------------------
1 | namespace CodeHub.Models
2 | {
3 | public static class StartupNotificationTypes
4 | {
5 | public static StartupNotificationGroup MainGroup = new StartupNotificationGroup("notifications scenarios", new IStartupNotification[]
6 | {
7 | new StartupNotification("Issues", typeof(Views.IssueDetailView)),
8 | new StartupNotification("PullRequests", typeof(Views.PullRequestDetailView))
9 | });
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/CodeHub/Models/SyntaxHighlightStyle.cs:
--------------------------------------------------------------------------------
1 | using GalaSoft.MvvmLight;
2 | using Windows.UI.Xaml.Media;
3 |
4 | namespace CodeHub.Models
5 | {
6 | public class SyntaxHighlightStyle : ObservableObject
7 | {
8 | public string Name { get; set; }
9 | public bool IsLineNumbersVisible { get; set; }
10 | public SolidColorBrush ColorOne { get; set; }
11 | public SolidColorBrush ColorTwo { get; set; }
12 | public SolidColorBrush ColorThree { get; set; }
13 | public SolidColorBrush ColorFour { get; set; }
14 | public SolidColorBrush BackgroundColor { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CodeHub/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | CodeHub - A Client for Github
7 | Aalok Singh
8 | Assets\NewStoreLogo.png
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 | Codehub - A Client For GitHub
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/CodeHub/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("CodeHub")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CodeHub")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
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("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/CodeHub/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CodeHub/Resources/SVGIconsDictionary.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | F0 M10,16z M0,0z M10,5C10,3.89,9.11,3,8,3A1.993,1.993,0,0,0,7,6.72L7,7.02C6.98,7.54 6.77,8 6.37,8.4 5.97,8.8 5.51,9.01 4.99,9.03 4.16,9.05
5 | 3.51,9.19 2.99,9.48L2.99,4.72A1.993,1.993,0,0,0,1.99,1C0.88,1,0,1.89,0,3A2,2,0,0,0,1,4.72L1,11.28C0.41,11.63 0,12.27 0,13 0,14.11 0.89,15 2,15
6 | 3.11,15 4,14.11 4,13 4,12.47 3.8,12 3.47,11.64 3.56,11.58 3.95,11.23 4.06,11.17 4.31,11.06 4.62,11 5,11 6.05,10.95 6.95,10.55 7.75,9.75 8.55,8.95
7 | 8.95,7.77 9,6.73L8.98,6.73C9.59,6.37,10,5.73,10,5z M2,1.8C2.66,1.8 3.2,2.35 3.2,3 3.2,3.65 2.65,4.2 2,4.2 1.35,4.2 0.8,3.65 0.8,3 0.8,2.35 1.35,1.8
8 | 2,1.8z M2,14.21C1.34,14.21 0.8,13.66 0.8,13.01 0.8,12.36 1.35,11.81 2,11.81 2.65,11.81 3.2,12.36 3.2,13.01 3.2,13.66 2.65,14.21 2,14.21z M8,
9 | 6.21C7.34,6.21 6.8,5.66 6.8,5.01 6.8,4.36 7.35,3.81 8,3.81 8.65,3.81 9.2,4.36 9.2,5.01 9.2,5.66 8.65,6.21 8,6.21z
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/CodeHub/Resources/SharedCompiledDataTemplates.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml;
2 |
3 | namespace CodeHub.Resources
4 | {
5 | ///
6 | /// Shared resource dictionary with support for compiled bindings
7 | ///
8 | public sealed partial class SharedCompiledDataTemplates : ResourceDictionary
9 | {
10 | public SharedCompiledDataTemplates()
11 | => InitializeComponent();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CodeHub/Services/Auth/AppCredentials.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.Data.Xml.Dom;
4 | using Windows.Storage;
5 |
6 | namespace CodeHub.Services
7 | {
8 | class AppCredentials
9 | {
10 | /* These methods get App key and secret from an xml file called app.config. Create your app.config in the followinf format:
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | */
20 |
21 | public static async Task GetAppKey()
22 | {
23 | var file = await StorageFile
24 | .GetFileFromApplicationUriAsync(new Uri(string.Format("ms-appx:///app.config")));
25 |
26 | var xmlConfiguration = await XmlDocument.LoadFromFileAsync(file);
27 |
28 | var node = xmlConfiguration
29 | .DocumentElement
30 | .SelectSingleNode("./appSettings/add[@key='AppKey']/@value");
31 |
32 | if (node.NodeValue == null)
33 | {
34 | return null;
35 | }
36 |
37 | return (string)node.NodeValue;
38 | }
39 | public static async Task GetAppSecret()
40 | {
41 | var file = await StorageFile
42 | .GetFileFromApplicationUriAsync(new Uri(string.Format("ms-appx:///app.config")));
43 |
44 | var xmlConfiguration = await XmlDocument.LoadFromFileAsync(file);
45 |
46 | var node = xmlConfiguration
47 | .DocumentElement
48 | .SelectSingleNode("./appSettings/add[@key='AppSecret']/@value");
49 | if (node.NodeValue == null)
50 | {
51 | return null;
52 | }
53 |
54 | return (string)node.NodeValue;
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/CodeHub/Services/ExecutionService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Toolkit.Uwp.Helpers;
2 | using System;
3 | using System.Threading.Tasks;
4 | using Windows.ApplicationModel.Background;
5 | using Windows.ApplicationModel.Core;
6 | using Windows.ApplicationModel.ExtendedExecution;
7 | using Windows.Foundation;
8 | using Windows.UI.Core;
9 |
10 | namespace CodeHub.Services
11 | {
12 | static class ExecutionService
13 | {
14 | public static async Task RunActionAsExtentedAction(this ExtendedExecutionSession session, Action action, TypedEventHandler