-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Archive folder to Old Version Module List for deletion, Added Potential fix for Old Version Module List still show old files which were deleted when navigated back and forth
- Loading branch information
1 parent
4ce6eec
commit 916d6d7
Showing
45 changed files
with
315 additions
and
17,018 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
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 was deleted.
Oops, something went wrong.
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,70 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace VS2017OfflineSetupUtility.Mvvm | ||
{ | ||
|
||
public abstract class BindableBase : INotifyPropertyChanged | ||
{ | ||
/// <summary> | ||
/// Event when property is changed | ||
/// </summary> | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="storage">Storage reference property with getter setter</param> | ||
/// <param name="value">Property Value</param> | ||
/// <param name="propertyName">Name of the listener property</param> | ||
/// <returns>Return true if value was changed or else false</returns> | ||
protected virtual bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string propertyName = null) | ||
{ | ||
if (EqualityComparer<T>.Default.Equals(storage, value)) return false; | ||
|
||
storage = value; | ||
RaisePropertyChanged(propertyName); | ||
|
||
return true; | ||
} | ||
|
||
/// <summary> | ||
/// SetProperty if not same as previous set value | ||
/// </summary> | ||
/// <typeparam name="T">Property Type</typeparam> | ||
/// <param name="storage">Storage reference property with getter setter</param> | ||
/// <param name="value">Property Value</param> | ||
/// <param name="onChanged">Action onChanged</param> | ||
/// <param name="propertyName">Name of the listener property</param> | ||
/// <returns>Return true if value changed else false</returns> | ||
protected virtual bool SetProperty<T>(ref T storage, T value, Action onChanged, [CallerMemberName] string propertyName = null) | ||
{ | ||
if (EqualityComparer<T>.Default.Equals(storage, value)) return false; | ||
|
||
storage = value; | ||
onChanged?.Invoke(); | ||
RaisePropertyChanged(propertyName); | ||
|
||
return true; | ||
} | ||
|
||
/// <summary> | ||
/// Raise Property Changed event | ||
/// </summary> | ||
/// <param name="propertyName">Name of the listener property<param> | ||
protected void RaisePropertyChanged([CallerMemberName]string propertyName = null) | ||
{ | ||
OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
/// <summary> | ||
/// Raise property changed | ||
/// </summary> | ||
/// <param name="args">Property Changed Arguments</param> | ||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args) | ||
{ | ||
PropertyChanged?.Invoke(this, args); | ||
} | ||
} | ||
} |
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,83 @@ | ||
using System; | ||
using System.Diagnostics; | ||
|
||
namespace VS2017OfflineSetupUtility.Mvvm | ||
{ | ||
|
||
public class DelegateCommand : IChangedCommand | ||
{ | ||
private readonly Action _execute; | ||
private readonly Func<bool> _canExecute; | ||
public event EventHandler CanExecuteChanged; | ||
|
||
public DelegateCommand(Action execute, Func<bool> canexecute = null) | ||
{ | ||
if (execute == null) | ||
throw new ArgumentNullException(nameof(execute)); | ||
_execute = execute; | ||
_canExecute = canexecute ?? (() => true); | ||
} | ||
|
||
[DebuggerStepThrough] | ||
public bool CanExecute(object p = null) | ||
{ | ||
try { return _canExecute(); } | ||
catch { return false; } | ||
} | ||
|
||
public void Execute(object p = null) | ||
{ | ||
if (!CanExecute(p)) | ||
return; | ||
try { _execute(); } | ||
catch { Debugger.Break(); } | ||
} | ||
|
||
public void RaiseCanExecuteChanged() | ||
{ | ||
CanExecuteChanged?.Invoke(this, EventArgs.Empty); | ||
} | ||
} | ||
|
||
public class DelegateCommand<T> : IChangedCommand | ||
{ | ||
private readonly Action<T> _execute; | ||
private readonly Func<T, bool> _canExecute; | ||
public event EventHandler CanExecuteChanged; | ||
|
||
public DelegateCommand(Action<T> execute, Func<T, bool> canexecute = null) | ||
{ | ||
if (execute == null) | ||
throw new ArgumentNullException(nameof(execute)); | ||
_execute = execute; | ||
_canExecute = canexecute ?? (e => true); | ||
} | ||
|
||
[DebuggerStepThrough] | ||
public bool CanExecute(object p) | ||
{ | ||
if (p == null) | ||
return true; | ||
try { return _canExecute(ConvertParameterValue(p)); } | ||
catch { return false; } | ||
} | ||
|
||
public void Execute(object p) | ||
{ | ||
if (!this.CanExecute(p)) | ||
return; | ||
_execute(ConvertParameterValue(p)); | ||
} | ||
|
||
private static T ConvertParameterValue(object parameter) | ||
{ | ||
parameter = parameter is T ? parameter : Convert.ChangeType(parameter, typeof(T)); | ||
return (T)parameter; | ||
} | ||
|
||
public void RaiseCanExecuteChanged() | ||
{ | ||
CanExecuteChanged?.Invoke(this, EventArgs.Empty); | ||
} | ||
} | ||
} |
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,9 @@ | ||
using System.Windows.Input; | ||
|
||
namespace VS2017OfflineSetupUtility.Mvvm | ||
{ | ||
public interface IChangedCommand : ICommand | ||
{ | ||
void RaiseCanExecuteChanged(); | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.