Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added changes that will enable multiple package selection and selecte… #702

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="ChocolateyGui.Common.Windows.Views.LocalSourceView"
 <UserControl x:Class="ChocolateyGui.Common.Windows.Views.LocalSourceView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand Down Expand Up @@ -191,8 +191,9 @@
<Setter.Value>
<DataTemplate>
<DataGrid ItemsSource="{Binding Mode=OneWay}"
SelectionChanged="DgPackages_SelectionChanged"
Background="{StaticResource ControlBackgroundBrush}"
AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single"
AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Extended"
Style="{DynamicResource PackagesGridStyle}">
<i:Interaction.Behaviors>
<utilities:DataGridCustomSortBehavior />
Expand Down
16 changes: 16 additions & 0 deletions Source/ChocolateyGui.Common.Windows/Views/LocalSourceView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections;
using System.Runtime.Remoting.Channels;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using ChocolateyGui.Common.ViewModels.Items;

Expand All @@ -25,6 +28,19 @@ public LocalSourceView()
this.Loaded += LocalSourceViewOnLoaded;
}

public IList SelectedItems { get; private set; }

/// <summary>
/// This is an event handler for on selection change made on the list of the local packages, it will have the list of selected packages items which can be used
/// later on to pass to the command.
/// </summary>
/// <param name="sender">sender</param>
/// <param name="e">eventParameter</param>
private void DgPackages_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.SelectedItems = ((System.Windows.Controls.Primitives.MultiSelector) e.OriginalSource).SelectedItems;
}

private void LocalSourceViewOnLoaded(object sender, RoutedEventArgs e)
{
this.SearchTextBox.Focus();
Expand Down
30 changes: 16 additions & 14 deletions Source/ChocolateyGui.sln
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2002
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChocolateyGui", "ChocolateyGui\ChocolateyGui.csproj", "{851FC2F6-AFB0-4153-8520-BF68E1BEA3CB}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "ChocolateyGui.Install", "ChocolateyGui.Install\ChocolateyGui.Install.wixproj", "{411C7212-286F-4F26-994A-568E943D0E60}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{C6760D8F-E01B-4F26-9B0C-4E2D825509D2}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
Expand All @@ -23,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChocolateyGui.Common", "Cho
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChocolateyGui.Common.Windows", "ChocolateyGui.Common.Windows\ChocolateyGui.Common.Windows.csproj", "{4C2E05FE-3F4D-40BE-873C-5D07C8729741}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "justConsole", "justConsole\justConsole.csproj", "{2213023A-2A00-4DF5-8772-31F1D45F387F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -41,16 +41,6 @@ Global
{851FC2F6-AFB0-4153-8520-BF68E1BEA3CB}.Release|x86.ActiveCfg = Release|x86
{851FC2F6-AFB0-4153-8520-BF68E1BEA3CB}.WIX|Any CPU.ActiveCfg = Release|Any CPU
{851FC2F6-AFB0-4153-8520-BF68E1BEA3CB}.WIX|x86.ActiveCfg = Release|Any CPU
{411C7212-286F-4F26-994A-568E943D0E60}.Debug|Any CPU.ActiveCfg = Debug|x86
{411C7212-286F-4F26-994A-568E943D0E60}.Debug|x86.ActiveCfg = Debug|x86
{411C7212-286F-4F26-994A-568E943D0E60}.Debug|x86.Build.0 = Debug|x86
{411C7212-286F-4F26-994A-568E943D0E60}.Release|Any CPU.ActiveCfg = Release|x86
{411C7212-286F-4F26-994A-568E943D0E60}.Release|x86.ActiveCfg = Release|x86
{411C7212-286F-4F26-994A-568E943D0E60}.Release|x86.Build.0 = Release|x86
{411C7212-286F-4F26-994A-568E943D0E60}.WIX|Any CPU.ActiveCfg = Release|x86
{411C7212-286F-4F26-994A-568E943D0E60}.WIX|Any CPU.Build.0 = Release|x86
{411C7212-286F-4F26-994A-568E943D0E60}.WIX|x86.ActiveCfg = Release|x86
{411C7212-286F-4F26-994A-568E943D0E60}.WIX|x86.Build.0 = Release|x86
{C69DCF4D-F412-4344-83CD-26A46D515DF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C69DCF4D-F412-4344-83CD-26A46D515DF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C69DCF4D-F412-4344-83CD-26A46D515DF2}.Debug|x86.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -87,6 +77,18 @@ Global
{4C2E05FE-3F4D-40BE-873C-5D07C8729741}.WIX|Any CPU.Build.0 = Release|Any CPU
{4C2E05FE-3F4D-40BE-873C-5D07C8729741}.WIX|x86.ActiveCfg = Release|Any CPU
{4C2E05FE-3F4D-40BE-873C-5D07C8729741}.WIX|x86.Build.0 = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Debug|x86.ActiveCfg = Debug|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Debug|x86.Build.0 = Debug|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Release|Any CPU.Build.0 = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Release|x86.ActiveCfg = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.Release|x86.Build.0 = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.WIX|Any CPU.ActiveCfg = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.WIX|Any CPU.Build.0 = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.WIX|x86.ActiveCfg = Release|Any CPU
{2213023A-2A00-4DF5-8772-31F1D45F387F}.WIX|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 6 additions & 0 deletions Source/justConsole/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
15 changes: 15 additions & 0 deletions Source/justConsole/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace justConsole
{
class Program
{
static void Main(string[] args)
{
}
}
}
36 changes: 36 additions & 0 deletions Source/justConsole/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("justConsole")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("justConsole")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2213023a-2a00-4df5-8772-31f1d45f387f")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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")]
53 changes: 53 additions & 0 deletions Source/justConsole/justConsole.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2213023A-2A00-4DF5-8772-31F1D45F387F}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>justConsole</RootNamespace>
<AssemblyName>justConsole</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>