-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved repository performance and refactored changeset history grid.
- Loading branch information
1 parent
f062b2b
commit 9b80fec
Showing
13 changed files
with
307 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<local:RepositoryViewModel xmlns:local="clr-namespace:GG" | ||
xmlns:models="clr-namespace:GG.Models" | ||
xmlns:sys="clr-namespace:System;assembly=mscorlib"> | ||
<local:RepositoryViewModel.LocalBranches> | ||
<local:RepositoryViewModel.Branches> | ||
<models:Branch Name="master" Tip="0123asd" IsRemote="False" IsTracking="True" /> | ||
<models:Branch Name="foo" Tip="0123asd" IsRemote="False" IsTracking="False" /> | ||
<models:Branch Name="bar" Tip="0123asd" IsRemote="False" IsTracking="False" /> | ||
<models:Branch Name="test" Tip="0123asd" IsRemote="True" IsTracking="True" /> | ||
</local:RepositoryViewModel.LocalBranches> | ||
</local:RepositoryViewModel.Branches> | ||
</local:RepositoryViewModel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Collections.Specialized; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
|
||
namespace GG.Libraries.Extensions | ||
{ | ||
|
||
/// <summary> | ||
/// Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public class ObservableCollection<T> : System.Collections.ObjectModel.ObservableCollection<T> | ||
{ | ||
|
||
/// <summary> | ||
/// Adds the elements of the specified collection to the end of the ObservableCollection(Of T). | ||
/// </summary> | ||
public void AddRange(IEnumerable<T> collection) | ||
{ | ||
foreach (var i in collection) Items.Add(i); | ||
//OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, collection.ToList())); | ||
OnPropertyChanged(new PropertyChangedEventArgs("Count")); | ||
OnPropertyChanged(new PropertyChangedEventArgs("Item[]")); | ||
} | ||
|
||
/// <summary> | ||
/// Removes the first occurence of each item in the specified collection from ObservableCollection(Of T). | ||
/// </summary> | ||
public void RemoveRange(IEnumerable<T> collection) | ||
{ | ||
foreach (var i in collection) Items.Remove(i); | ||
//OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, collection.ToList())); | ||
OnPropertyChanged(new PropertyChangedEventArgs("Count")); | ||
OnPropertyChanged(new PropertyChangedEventArgs("Item[]")); | ||
} | ||
|
||
/// <summary> | ||
/// Clears the current collection and replaces it with the specified item. | ||
/// </summary> | ||
public void Replace(T item) | ||
{ | ||
ReplaceRange(new T[] { item }); | ||
} | ||
/// <summary> | ||
/// Clears the current collection and replaces it with the specified collection. | ||
/// </summary> | ||
public void ReplaceRange(IEnumerable<T> collection) | ||
{ | ||
List<T> old = new List<T>(Items); | ||
Items.Clear(); | ||
foreach (var i in collection) Items.Add(i); | ||
//OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, collection.ToList())); | ||
OnPropertyChanged(new PropertyChangedEventArgs("Count")); | ||
OnPropertyChanged(new PropertyChangedEventArgs("Item[]")); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection(Of T) class. | ||
/// </summary> | ||
public ObservableCollection() : base() { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection(Of T) class that contains elements copied from the specified collection. | ||
/// </summary> | ||
/// <param name="collection">collection: The collection from which the elements are copied.</param> | ||
/// <exception cref="System.ArgumentNullException">The collection parameter cannot be null.</exception> | ||
public ObservableCollection(IEnumerable<T> collection) : base(collection) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.