├── .gitignore
├── App.xaml
├── App.xaml.cs
├── Converters
├── ExtensionToImageConverter.cs
├── GenericVisibilityConverter.cs
├── GetDataGridContentHeightConverter.cs
├── GetSelectedTreeViewItemConverter.cs
├── IsHeadToFontWeightConverter.cs
├── IsHeadToTextDecorationsConverter.cs
├── NullToVisibilityConverter.cs
├── StatusGridGroupToColorConverter.cs
├── StatusToCharacterConverter.cs
└── StatusToColorConverter.cs
├── DesignData
├── Branches.xaml
├── ChangesetHistory.xaml
├── RecentRepositories.xaml
└── SampleApplication.xaml
├── Externals
└── .gitkeep
├── Git-GUI.csproj
├── Git-GUI.csproj.DotSettings
├── Git-GUI.csproj.user
├── Git-GUI.sln
├── Libraries
├── Animation
│ ├── BindableDoubleAnimation.cs
│ └── LinearGradientAnimation.cs
├── ChangesetGraph.cs
├── Configuration.cs
├── DateUtil.cs
├── DelegateCommand.cs
├── EnhancedObservableCollection.cs
├── Extensions.cs
├── FileUtil.cs
├── GenericUtil.cs
├── IconUtil.cs
├── Observable.cs
├── RepoUtil.cs
└── UIHelper.cs
├── Models
├── Branch.cs
├── Commit.cs
├── DetachedHead.cs
├── RecentCommitMessage.cs
├── Remote.cs
├── Stash.cs
├── StatusItem.cs
├── Submodule.cs
└── Tag.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
├── Settings.settings
└── app.manifest
├── README.md
├── Resources
├── AbstractBackground.jpg
└── Icons
│ ├── Add.png
│ ├── AddNote.png
│ ├── Alert.png
│ ├── Annotate.png
│ ├── Archive.png
│ ├── Branch-24.png
│ ├── Branch.png
│ ├── Cancel.png
│ ├── Checkout.png
│ ├── Clipboard.png
│ ├── Clone.png
│ ├── CloseWindow.png
│ ├── Copy.png
│ ├── CopyPatch.png
│ ├── Cross.png
│ ├── DatabaseRefresh.png
│ ├── Delete.png
│ ├── Detect.png
│ ├── Edit.png
│ ├── Email.png
│ ├── Export.png
│ ├── Fetch.png
│ ├── Forget.png
│ ├── Git-GUI.ico
│ ├── Git-GUI.png
│ ├── GitHub.png
│ ├── Hash.png
│ ├── History.png
│ ├── Home.png
│ ├── Ignore.png
│ ├── Information.png
│ ├── MaximizeWindow.png
│ ├── Merge.png
│ ├── MessageWrite.png
│ ├── Messages.png
│ ├── MinimizeWindow.png
│ ├── Open.png
│ ├── OpenIgnoreEditor.png
│ ├── Patch.png
│ ├── Plus.gif
│ ├── Plus.png
│ ├── Pull.png
│ ├── Push.png
│ ├── Question.png
│ ├── Recent.png
│ ├── Remote.png
│ ├── Rename.png
│ ├── RepositoryWrite.png
│ ├── Reset.png
│ ├── ResetHard.png
│ ├── RestoreWindow.png
│ ├── Revert.png
│ ├── SVN.png
│ ├── Save.png
│ ├── Search.png
│ ├── Settings.png
│ ├── Stash-24.png
│ ├── Stash.png
│ ├── Statistics.png
│ ├── Submodule.png
│ ├── TabPlus.png
│ ├── Tag.png
│ ├── Tick.png
│ ├── Unstage.png
│ ├── VisualDiff.png
│ └── Warning.png
├── Styles
├── Border.xaml
├── Button.xaml
├── ChangesetHistoryDataGrid.xaml
├── Colors.xaml
├── ComboBox.xaml
├── DataGrid.xaml
├── DisplayTags.xaml
├── GridSplitter.xaml
├── LeftToolbar.xaml
├── NewTabList.xaml
├── Panel.xaml
├── Scrollbar.xaml
├── Separator.xaml
├── SplitButton.xaml
├── TabItem.xaml
├── TextBlock.xaml
├── TextBox.xaml
├── TopToolbar.xaml
├── TreeView.xaml
└── Window.xaml
├── TemplateSelectors
├── RepoTabContentTemplateSelector.cs
└── TabTemplateSelector.cs
├── Templates
├── RepoTabContentTemplate.xaml
├── RepoTabDashboardContentTemplate.xaml
├── RepoTabNewTemplate.xaml
└── RepoTabTemplate.xaml
├── UserControls
├── CenterArea.xaml
├── CenterArea.xaml.cs
├── ChangesetHistory.xaml
├── ChangesetHistory.xaml.cs
├── ChangesetHistoryContextMenu.xaml
├── ChangesetHistoryContextMenu.xaml.cs
├── CommitPanel.xaml
├── CommitPanel.xaml.cs
├── Dialogs
│ ├── ConfirmDialog.xaml
│ ├── ConfirmDialog.xaml.cs
│ ├── PromptDialog.xaml
│ └── PromptDialog.xaml.cs
├── DiffPanel.xaml
├── DiffPanel.xaml.cs
├── LeftToolbar.xaml
├── LeftToolbar.xaml.cs
├── LeftToolbarContextMenus
│ ├── TagContextMenu.xaml
│ └── TagContextMenu.xaml.cs
├── MainMenu.xaml
├── MainMenu.xaml.cs
├── MenuButton.cs
├── NewTabPage.xaml
├── NewTabPage.xaml.cs
├── Panel.xaml
├── Panel.xaml.cs
├── SplitButton.cs
├── StatusGrid.xaml
├── StatusGrid.xaml.cs
├── StatusGridContextMenu.xaml
├── StatusGridContextMenu.xaml.cs
├── TopToolbar.xaml
└── TopToolbar.xaml.cs
├── ViewModels
├── BaseViewModel.cs
├── MainWindowViewModel.cs
├── RepositoryViewModel.cs
├── RepositoryViewModel.cs.BASE.cs
├── RepositoryViewModel.cs.LOCAL.cs
└── RepositoryViewModel.cs.REMOTE.cs
├── Views
├── About.xaml
├── About.xaml.cs
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── app.config
├── license.txt
└── packages.config
/.gitignore:
--------------------------------------------------------------------------------
1 | #Custom
2 | *.dll
3 | *.pdb
4 | *.psess
5 | *.vsp
6 | *.pfx
7 |
8 | #OS junk files
9 | [Tt]humbs.db
10 | *.DS_Store
11 |
12 | #Visual Studio files
13 | *.[Oo]bj
14 | *.user
15 | *.aps
16 | *.pch
17 | *.vspscc
18 | *.vssscc
19 | *_i.c
20 | *_p.c
21 | *.ncb
22 | *.suo
23 | *.tlb
24 | *.tlh
25 | *.bak
26 | *.[Cc]ache
27 | *.ilk
28 | *.log
29 | *.lib
30 | *.sbr
31 | *.sdf
32 | *.opensdf
33 | *.unsuccessfulbuild
34 | ipch/
35 | obj/
36 | [Bb]in
37 | [Dd]ebug*/
38 | [Rr]elease*/
39 | Ankh.NoLoad
40 |
41 | #Tooling
42 | _ReSharper*/
43 | *.resharper
44 | [Tt]est[Rr]esult*
45 |
46 | #Project files
47 | [Bb]uild/
48 |
49 | #Subversion files
50 | .svn
51 |
52 | # Office Temp Files
53 | ~$*
54 |
55 | #NuGet
56 | packages/
57 |
--------------------------------------------------------------------------------
/App.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace GG
5 | {
6 | ///
7 | /// Interaction logic for App.xaml
8 | ///
9 | public partial class App : Application
10 | {
11 | public App()
12 | {
13 | #if !DEBUG
14 | AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException;
15 | Application.Current.DispatcherUnhandledException += NBug.Handler.DispatcherUnhandledException;
16 | #endif
17 | }
18 |
19 | protected override void OnStartup(StartupEventArgs e)
20 | {
21 | var mainWindow = new MainWindow
22 | {
23 | DataContext = new MainWindowViewModel()
24 | };
25 |
26 | base.MainWindow = mainWindow;
27 |
28 | mainWindow.Show();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Converters/ExtensionToImageConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Globalization;
4 | using System.Windows;
5 | using System.Windows.Data;
6 | using System.Windows.Media.Imaging;
7 | using GG.Libraries;
8 |
9 | namespace GG.Converters
10 | {
11 | ///
12 | /// Converts a file extension to an image source.
13 | ///
14 | class ExtensionToImageConverter : IValueConverter
15 | {
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | return IconUtil.GetIcon((string) value, true, false);
19 | }
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | return null;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Converters/GenericVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using System.Globalization;
4 | using System.Windows;
5 | using System.Windows.Data;
6 |
7 | namespace GG.Converters
8 | {
9 | public class GenericVisibilityConverter : IValueConverter
10 | {
11 | #region Implementation of IValueConverter
12 |
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | // Whether to invert the visibility.
16 | var invert = (string) parameter == "not" ? true : false;
17 |
18 | // int 0
19 | if (value is int && (int) value == 0)
20 | return invert ? Visibility.Visible : Visibility.Collapsed;
21 |
22 | // int > 0
23 | if (value is int && (int) value > 0)
24 | return invert ? Visibility.Collapsed : Visibility.Visible;
25 |
26 | // null || bool == false
27 | if (value == null || (value is bool && (bool) value == false))
28 | return invert ? Visibility.Visible : Visibility.Collapsed;
29 |
30 | // bool == true
31 | if (value is bool && (bool) value == true)
32 | return invert ? Visibility.Collapsed : Visibility.Visible;
33 |
34 | // Fall back to "visible".
35 | return invert ? Visibility.Collapsed : Visibility.Visible;
36 | }
37 |
38 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
39 | {
40 | throw new NotImplementedException();
41 | }
42 |
43 | #endregion
44 | }
45 | }
--------------------------------------------------------------------------------
/Converters/GetDataGridContentHeightConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Controls;
4 | using System.Windows.Data;
5 | using GG.Libraries;
6 |
7 | namespace GG.Converters
8 | {
9 | ///
10 | /// Returns the height of the body (data grid actual height - column header height).
11 | ///
12 | class GetDataGridContentHeightConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | var dataGrid = (DataGrid) value;
17 | var height = dataGrid.ActualHeight - 24;
18 |
19 | return height >= 0 ? height : 0;
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | return null;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Converters/GetSelectedTreeViewItemConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Globalization;
4 | using System.Windows.Controls;
5 | using System.Windows.Data;
6 |
7 | namespace GG.Converters
8 | {
9 | ///
10 | /// Returns the height of the body (data grid actual height - column header height).
11 | ///
12 | class GetSelectedTreeViewItemConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | return ((TreeView) value).SelectedItem;
17 | }
18 |
19 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
20 | {
21 | return null;
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/Converters/IsHeadToFontWeightConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 | using System.Windows;
5 |
6 | namespace GG.Converters
7 | {
8 | ///
9 | /// Converts IsHead status into a font weight.
10 | ///
11 | class IsHeadToFontWeightConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | return (bool) value ? FontWeights.Bold : FontWeights.Normal;
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | return false;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Converters/IsHeadToTextDecorationsConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 | using System.Windows;
5 |
6 | namespace GG.Converters
7 | {
8 | ///
9 | /// Converts IsHead status into text decorations.
10 | ///
11 | class IsHeadToTextDecorationsConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | return (bool) value ? TextDecorations.Underline : new TextDecorationCollection();
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | return false;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Converters/NullToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace GG.Converters
7 | {
8 | public class NullToVisibilityConverter : IValueConverter
9 | {
10 | #region Implementation of IValueConverter
11 |
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | return value == null ? Visibility.Visible : Visibility.Collapsed;
15 | }
16 |
17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | throw new NotImplementedException();
20 | }
21 |
22 | #endregion
23 | }
24 | }
--------------------------------------------------------------------------------
/Converters/StatusGridGroupToColorConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 | using System.Windows.Media;
5 |
6 | namespace GG.Converters
7 | {
8 | ///
9 | /// Converts LibGit2Sharp.Status into a single character string.
10 | ///
11 | class StatusGridGroupToColorConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | return ((string) value) == "Staged" ? new SolidColorBrush(Color.FromRgb(76, 120, 0)) : new SolidColorBrush(Color.FromRgb(120, 37, 0));
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | return Brushes.White;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Converters/StatusToCharacterConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 |
5 | namespace GG.Converters
6 | {
7 | ///
8 | /// Converts LibGit2Sharp.Status into a single character string.
9 | ///
10 | class StatusToCharacterConverter : IValueConverter
11 | {
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | LibGit2Sharp.FileStatus status = (LibGit2Sharp.FileStatus) value;
15 |
16 | if (status.HasFlag(LibGit2Sharp.FileStatus.Removed) || status.HasFlag(LibGit2Sharp.FileStatus.Missing))
17 | return "D";
18 |
19 | if (status.HasFlag(LibGit2Sharp.FileStatus.Added))
20 | return "A";
21 |
22 | if (status.HasFlag(LibGit2Sharp.FileStatus.Staged) || status.HasFlag(LibGit2Sharp.FileStatus.Modified))
23 | return "M";
24 |
25 | if (status.HasFlag(LibGit2Sharp.FileStatus.Untracked))
26 | return "?";
27 |
28 | throw new Exception("Could not convert status " + status.ToString() + " to a character!");
29 | }
30 |
31 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
32 | {
33 | return LibGit2Sharp.FileStatus.Removed;
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/Converters/StatusToColorConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 | using System.Windows.Media;
5 |
6 | namespace GG.Converters
7 | {
8 | ///
9 | /// Converts LibGit2Sharp.Status into a SolidColorBrush to be used in background / text.
10 | ///
11 | class StatusToColorConverter : IValueConverter
12 | {
13 | // Light colors.
14 | static SolidColorBrush COLOR_RED = new SolidColorBrush(Color.FromRgb(220, 104, 107));
15 | static SolidColorBrush COLOR_GREEN = new SolidColorBrush(Color.FromRgb(122, 183, 64));
16 | static SolidColorBrush COLOR_BLUE = new SolidColorBrush(Color.FromRgb(81, 140, 220));
17 | static SolidColorBrush COLOR_GRAY = new SolidColorBrush(Color.FromRgb(142, 142, 142));
18 |
19 | // Dark colors.
20 | static SolidColorBrush COLOR_DARK_RED = new SolidColorBrush(Color.FromRgb(167, 44, 47));
21 | static SolidColorBrush COLOR_DARK_GREEN = new SolidColorBrush(Color.FromRgb(62, 123, 04));
22 | static SolidColorBrush COLOR_DARK_BLUE = new SolidColorBrush(Color.FromRgb(21, 80, 160));
23 | static SolidColorBrush COLOR_DARK_GRAY = new SolidColorBrush(Color.FromRgb(82, 82, 82));
24 |
25 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
26 | {
27 | if (value == null)
28 | return COLOR_RED;
29 |
30 | var status = (LibGit2Sharp.FileStatus) value;
31 |
32 | // Whether to use darker colors (for text).
33 | var darkerColors = (string) parameter == "dark";
34 |
35 | // Removed & Missing = red.
36 | if (status.HasFlag(LibGit2Sharp.FileStatus.Removed) || status.HasFlag(LibGit2Sharp.FileStatus.Missing))
37 | return darkerColors ? COLOR_DARK_RED : COLOR_RED;
38 |
39 | // Added = green.
40 | if (status.HasFlag(LibGit2Sharp.FileStatus.Added))
41 | return darkerColors ? COLOR_DARK_GREEN : COLOR_GREEN;
42 |
43 | // Modified = blue.
44 | if (status.HasFlag(LibGit2Sharp.FileStatus.Modified) || status.HasFlag(LibGit2Sharp.FileStatus.Staged))
45 | return darkerColors ? COLOR_DARK_BLUE : COLOR_BLUE;
46 |
47 | // Untracked = gray.
48 | if (status.HasFlag(LibGit2Sharp.FileStatus.Untracked))
49 | return darkerColors ? COLOR_DARK_GRAY : COLOR_GRAY;
50 |
51 | throw new Exception("Could not convert status " + status + " to a SolidColorBrush!");
52 | }
53 |
54 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
55 | {
56 | return LibGit2Sharp.FileStatus.Removed;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/DesignData/Branches.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DesignData/ChangesetHistory.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | master
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DesignData/RecentRepositories.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DesignData/SampleApplication.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | master
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Externals/.gitkeep:
--------------------------------------------------------------------------------
1 | keep
--------------------------------------------------------------------------------
/Git-GUI.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | No
--------------------------------------------------------------------------------
/Git-GUI.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | C:\Setups\Software\Git-GUI\|publish\
5 | http://www.gitgui.com/publish/
6 | http://www.gitgui.com/support
7 |
8 |
9 |
10 | en-US
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/Git-GUI.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Git-GUI", "Git-GUI.csproj", "{3E181F9A-55E5-4769-BB53-AE95AC319AAF}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|x64 = Debug|x64
9 | Debug|x86 = Debug|x86
10 | Release|x64 = Release|x64
11 | Release|x86 = Release|x86
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Debug|x64.ActiveCfg = Debug|x86
15 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Debug|x64.Build.0 = Debug|x86
16 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Debug|x86.ActiveCfg = Debug|x86
17 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Debug|x86.Build.0 = Debug|x86
18 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Release|x64.ActiveCfg = Release|x64
19 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Release|x64.Build.0 = Release|x64
20 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Release|x86.ActiveCfg = Release|x86
21 | {3E181F9A-55E5-4769-BB53-AE95AC319AAF}.Release|x86.Build.0 = Release|x86
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | GlobalSection(Performance) = preSolution
27 | HasPerformanceSessions = true
28 | EndGlobalSection
29 | EndGlobal
30 |
--------------------------------------------------------------------------------
/Libraries/Animation/BindableDoubleAnimation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Media.Animation;
4 |
5 | namespace GG.Libraries.Animation
6 | {
7 | public class BindableDoubleAnimation : DoubleAnimationBase
8 | {
9 | DoubleAnimation internalAnimation;
10 |
11 | public DoubleAnimation InternalAnimation { get { return internalAnimation; } }
12 |
13 | public double To
14 | {
15 | get { return (double) GetValue(ToProperty); }
16 | set { SetValue(ToProperty, value); }
17 | }
18 |
19 | ///
20 | /// Dependency backing property for the property.
21 | ///
22 | public static readonly DependencyProperty ToProperty =
23 | DependencyProperty.Register("To", typeof(double), typeof(BindableDoubleAnimation), new UIPropertyMetadata(0d, new PropertyChangedCallback((s, e) =>
24 | {
25 | BindableDoubleAnimation sender = (BindableDoubleAnimation) s;
26 | sender.internalAnimation.To = (double) e.NewValue;
27 | })));
28 |
29 |
30 | public double From
31 | {
32 | get { return (double) GetValue(FromProperty); }
33 | set { SetValue(FromProperty, value); }
34 | }
35 |
36 | ///
37 | /// Dependency backing property for the property.
38 | ///
39 | public static readonly DependencyProperty FromProperty =
40 | DependencyProperty.Register("From", typeof(double), typeof(BindableDoubleAnimation), new UIPropertyMetadata(0d, new PropertyChangedCallback((s, e) =>
41 | {
42 | BindableDoubleAnimation sender = (BindableDoubleAnimation) s;
43 | sender.internalAnimation.From = (double) e.NewValue;
44 | })));
45 |
46 |
47 | public BindableDoubleAnimation()
48 | {
49 | internalAnimation = new DoubleAnimation();
50 | }
51 |
52 | protected override double GetCurrentValueCore(double defaultOriginValue, double defaultDestinationValue, AnimationClock animationClock)
53 | {
54 | return internalAnimation.GetCurrentValue(defaultOriginValue, defaultDestinationValue, animationClock);
55 | }
56 |
57 | protected override Freezable CreateInstanceCore()
58 | {
59 | return internalAnimation.Clone(); ;
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/Libraries/Configuration.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Xml.Serialization;
4 |
5 | namespace GG.Libraries
6 | {
7 | [XmlRoot("Configuration")]
8 | public class Configuration
9 | {
10 | [XmlArrayItem("Repository")]
11 | [XmlArray("RecentRepositories")]
12 | public List RecentRepositories { get; set; }
13 |
14 | [XmlArray("OpenedRepositories")]
15 | public List OpenedRepositories { get; set; }
16 |
17 | ///
18 | /// Loads the configuration from the Configuration.xml file.
19 | ///
20 | ///
21 | public static Configuration LoadConfiguration()
22 | {
23 | if (File.Exists("./Configuration.xml"))
24 | {
25 | using (var fileStream = new FileStream("./Configuration.xml", FileMode.Open))
26 | {
27 | return (Configuration) new XmlSerializer(typeof(Configuration)).Deserialize(fileStream);
28 | }
29 | }
30 |
31 | // If the configuration file was not found, create a new empty configuration and save it.
32 | var configuration = new Configuration();
33 | configuration.Save();
34 |
35 | return configuration;
36 | }
37 |
38 | ///
39 | /// Saves the configuration to the Configuration.xml file.
40 | ///
41 | public void Save()
42 | {
43 | using (var fileStream = new FileStream("./Configuration.xml", FileMode.Create))
44 | {
45 | new XmlSerializer(typeof(Configuration)).Serialize(fileStream, this);
46 | }
47 | }
48 |
49 | public Configuration()
50 | {
51 | RecentRepositories = new List();
52 | OpenedRepositories = new List();
53 | }
54 | }
55 |
56 | public class RepositoryConfiguration
57 | {
58 | [XmlAttribute("Name")]
59 | public string Name { get; set; }
60 |
61 | [XmlAttribute("RepositoryFullPath")]
62 | public string RepositoryFullPath { get; set; }
63 | }
64 | }
--------------------------------------------------------------------------------
/Libraries/DateUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace GG.Libraries
4 | {
5 | public class DateUtil
6 | {
7 | ///
8 | /// Converts a DateTime object into a relative time string.
9 | ///
10 | ///
11 | ///
12 | public static string GetRelativeDate(DateTime dt)
13 | {
14 | var ts = new TimeSpan(DateTime.Now.Ticks - dt.Ticks);
15 | double delta = Math.Abs(ts.TotalSeconds);
16 |
17 | const int SECOND = 1;
18 | const int MINUTE = 60 * SECOND;
19 | const int HOUR = 60 * MINUTE;
20 | const int DAY = 24 * HOUR;
21 |
22 | if (delta < 2 * MINUTE)
23 | {
24 | return "One minute ago";
25 | }
26 |
27 | if (delta < 45 * MINUTE)
28 | {
29 | return ts.Minutes + " minutes ago";
30 | }
31 |
32 | if (delta < 90 * MINUTE)
33 | {
34 | return "An hour ago";
35 | }
36 |
37 | if (delta < 48 * HOUR)
38 | {
39 | return ts.Hours + " hours ago";
40 | }
41 |
42 | if (delta < 7 * DAY)
43 | {
44 | return ts.Days + " days ago";
45 | }
46 |
47 | return dt.ToShortDateString() + ' ' + dt.ToShortTimeString();
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Libraries/DelegateCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Windows.Input;
4 |
5 | public class DelegateCommand : ICommand
6 | {
7 | private readonly Action