Skip to content

Commit

Permalink
Removed Prism dependency,
Browse files Browse the repository at this point in the history
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
deepak-rathi committed Aug 17, 2018
1 parent 4ce6eec commit 916d6d7
Show file tree
Hide file tree
Showing 45 changed files with 315 additions and 17,018 deletions.
32 changes: 3 additions & 29 deletions Setup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<!-- The manufacturer, for setup package publisher and folder info -->
<?define Manufacturer = "Deepak Rathi" ?>
<!-- The version number of this setup package-->
<?define Version = "1.1.0" ?>
<?define Version = "1.2.0" ?>
<!-- UpgradeCode must be unique and not changed once the first version of the program is installed. -->
<?define UpgradeCode = "{a49a94d4-f09a-4e3b-9b7e-b058cddd504e}" ?>
<?define UpgradeCode = "a49a94d4-f09a-4e3b-9b7e-b058cddd504e" ?>
<!-- The name of the Cabinet -->
<?define CabName = "VS2017OfflineSetupUtil.cab" ?>

Expand Down Expand Up @@ -93,38 +93,12 @@
<Component Id="VS2017OfflineSetupUtil_Application.exe.config" Guid="*">
<File Id="VS2017OfflineSetupUtil_Application.exe.config" Name="VS2017OfflineSetupUtility.exe.config" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)VS2017OfflineSetupUtility.exe.config" />
</Component>
<Component Id="Microsoft.Practices.ServiceLocation.dll" Guid="*">
<File Id="Microsoft.Practices.ServiceLocation.dll" Name="Microsoft.Practices.ServiceLocation.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Microsoft.Practices.ServiceLocation.dll" />
</Component>
<Component Id="Microsoft.Practices.Unity.Configuration.dll" Guid="*">
<File Id="Microsoft.Practices.Unity.Configuration.dll" Name="Microsoft.Practices.Unity.Configuration.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Microsoft.Practices.Unity.Configuration.dll" />
</Component>
<Component Id="Microsoft.Practices.Unity.dll" Guid="*">
<File Id="Microsoft.Practices.Unity.dll" Name="Microsoft.Practices.Unity.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Microsoft.Practices.Unity.dll" />
</Component>
<Component Id="Microsoft.Practices.Unity.RegistrationByConvention.dll" Guid="*">
<File Id="Microsoft.Practices.Unity.RegistrationByConvention.dll" Name="Microsoft.Practices.Unity.RegistrationByConvention.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Microsoft.Practices.Unity.RegistrationByConvention.dll" />
</Component>

<Component Id="Microsoft.WindowsAPICodePack.dll" Guid="*">
<File Id="Microsoft.WindowsAPICodePack.dll" Name="Microsoft.WindowsAPICodePack.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Microsoft.WindowsAPICodePack.dll" />
</Component>
<Component Id="Microsoft.WindowsAPICodePack.Shell.dll" Guid="*">
<File Id="Microsoft.WindowsAPICodePack.Shell.dll" Name="Microsoft.WindowsAPICodePack.Shell.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Microsoft.WindowsAPICodePack.Shell.dll" />
</Component>
<Component Id="Microsoft.WindowsAPICodePack.ShellExtensions.dll" Guid="*">
<File Id="Microsoft.WindowsAPICodePack.ShellExtensions.dll" Name="Microsoft.WindowsAPICodePack.ShellExtensions.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Microsoft.WindowsAPICodePack.ShellExtensions.dll" />
</Component>
<Component Id="Prism.dll" Guid="*">
<File Id="Prism.dll" Name="Prism.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Prism.dll" />
</Component>
<Component Id="Prism.Unity.Wpf.dll" Guid="*">
<File Id="Prism.Unity.Wpf.dll" Name="Prism.Unity.Wpf.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Prism.Unity.Wpf.dll" />
</Component>
<Component Id="Prism.Wpf.dll" Guid="*">
<File Id="Prism.Wpf.dll" Name="Prism.Wpf.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Prism.Wpf.dll" />
</Component>
<Component Id="System.Windows.Interactivity.dll" Guid="*">
<File Id="System.Windows.Interactivity.dll" Name="System.Windows.Interactivity.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)System.Windows.Interactivity.dll" />
</Component>
<Component Id="Newtonsoft.Json.dll" Guid="*">
<File Id="Newtonsoft.Json.dll" Name="Newtonsoft.Json.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Newtonsoft.Json.dll" />
Expand Down
2 changes: 1 addition & 1 deletion VS2017OfflineSetupUtility/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<userSettings>
<VS2017OfflineSetupUtility.Properties.Settings>
<setting name="LastSelectedFolder" serializeAs="String">
<value>%userprofile%</value>
<value />
</setting>
</VS2017OfflineSetupUtility.Properties.Settings>
</userSettings>
Expand Down
3 changes: 2 additions & 1 deletion VS2017OfflineSetupUtility/App.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Application x:Class="VS2017OfflineSetupUtility.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
<!--Black color-->
<SolidColorBrush x:Key="BlackSolidColorBrush" Color="#2c3e50" />
Expand Down
10 changes: 1 addition & 9 deletions VS2017OfflineSetupUtility/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ namespace VS2017OfflineSetupUtility
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

var bootstrapper = new Bootstrapper();
bootstrapper.Run();
}

//TODO://Use Prism Naivgation. Due to lack of time I am using this variable, it will be removed in future.
//TODO://Use proper Naivgation Service. Due to lack of time I am using this variable, it will be removed in future.
public static Frame CurrentFrame;
}
}
26 changes: 0 additions & 26 deletions VS2017OfflineSetupUtility/Bootstrapper.cs

This file was deleted.

2 changes: 1 addition & 1 deletion VS2017OfflineSetupUtility/Models/Feature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Prism.Mvvm;
using System.Windows.Controls;
using VS2017OfflineSetupUtility.Mvvm;

namespace VS2017OfflineSetupUtility.Models
{
Expand Down
70 changes: 70 additions & 0 deletions VS2017OfflineSetupUtility/Mvvm/BindableBase.cs
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);
}
}
}
83 changes: 83 additions & 0 deletions VS2017OfflineSetupUtility/Mvvm/DelegateCommand.cs
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);
}
}
}
9 changes: 9 additions & 0 deletions VS2017OfflineSetupUtility/Mvvm/IChangedCommand.cs
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();
}
}
4 changes: 2 additions & 2 deletions VS2017OfflineSetupUtility/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
2 changes: 1 addition & 1 deletion VS2017OfflineSetupUtility/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion VS2017OfflineSetupUtility/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Profiles />
<Settings>
<Setting Name="LastSelectedFolder" Type="System.String" Scope="User">
<Value Profile="(Default)">%userprofile%</Value>
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
32 changes: 3 additions & 29 deletions VS2017OfflineSetupUtility/VS2017OfflineSetupUtility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,45 +36,17 @@
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity.RegistrationByConvention, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.ShellExtensions, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-ShellExtensions.1.1.1\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Prism, Version=6.3.0.0, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\packages\Prism.Core.6.3.0\lib\net45\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.Unity.Wpf, Version=6.3.0.0, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\packages\Prism.Unity.6.3.0\lib\net45\Prism.Unity.Wpf.dll</HintPath>
</Reference>
<Reference Include="Prism.Wpf, Version=6.3.0.0, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\packages\Prism.Wpf.6.3.0\lib\net45\Prism.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Prism.Wpf.6.3.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
Expand All @@ -97,7 +69,6 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Bootstrapper.cs" />
<Compile Include="Controls\DownloadUtilIcon.xaml.cs">
<DependentUpon>DownloadUtilIcon.xaml</DependentUpon>
</Compile>
Expand All @@ -115,6 +86,9 @@
<Compile Include="Models\VSModule.cs" />
<Compile Include="Models\Workload.cs" />
<Compile Include="Models\WorkloadProcesser.cs" />
<Compile Include="Mvvm\BindableBase.cs" />
<Compile Include="Mvvm\DelegateCommand.cs" />
<Compile Include="Mvvm\IChangedCommand.cs" />
<Compile Include="Utils\FeatureUtil.cs" />
<Compile Include="Utils\VsEditionUtil.cs" />
<Compile Include="ViewModels\CleanUtilPageViewModel.cs" />
Expand Down
Loading

0 comments on commit 916d6d7

Please sign in to comment.