Skip to content

Commit

Permalink
複数選択できるように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yt3trees committed Aug 12, 2022
1 parent c858a7f commit 40fa5fe
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
6 changes: 3 additions & 3 deletions msbuild-gui-installer/msbuild-gui-installer.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:MsBuild-Gui"
"ProductCode" = "8:{7990D27C-5549-435F-A418-4BF971E40604}"
"PackageCode" = "8:{6BEAF04A-54F2-443D-911F-85775EEAB763}"
"ProductCode" = "8:{3D1157FB-35CF-485D-A542-150C3B87B638}"
"PackageCode" = "8:{51F28A31-8F2A-46FC-918A-9EE9E234321E}"
"UpgradeCode" = "8:{7D70ECDB-383F-40E2-B1A8-D750CFA02BE0}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.1"
"ProductVersion" = "8:1.0.2"
"Manufacturer" = "8:yt3trees"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
6 changes: 4 additions & 2 deletions msbuild-gui/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
MouseDoubleClick="SourceList_MouseDoubleClick"
KeyDown="SourceList_KeyDown"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
TabIndex="7" />
TabIndex="7"
SelectionMode="Extended" />
<ListBox x:Name="TargetList"
d:ItemsSource="{d:SampleData ItemCount=5}"
Margin="10,40,10,0"
Expand All @@ -107,7 +108,8 @@
MouseDoubleClick="TargetList_MouseDoubleClick"
KeyDown="TargetList_KeyDown"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
TabIndex="10" />
TabIndex="10"
SelectionMode="Extended" />
<Grid Grid.Column="2"
Grid.Row="3">
<Grid.ColumnDefinitions>
Expand Down
29 changes: 24 additions & 5 deletions msbuild-gui/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,38 @@ private void MenuItem_Click(object sender, RoutedEventArgs e)
/// </summary>
private void AddButton_Click(object sender, RoutedEventArgs e)
{
string? sourceFolder = SourceList.SelectedItem as string;
if (sourceFolder != null)
string[]? sourceFolder = new string[0];
int i = 0;

foreach(var item in SourceList.SelectedItems)
{
Array.Resize(ref sourceFolder, i + 1);
sourceFolder[i] = item.ToString();
i++;
}
foreach(var item in sourceFolder)
{
TargetList.Items.Add(sourceFolder);
TargetList.Items.Add(item);
}
}
/// <summary>
/// ターゲットリスト削除ボタン
/// </summary>
private void RemoveButton_Click(object sender, RoutedEventArgs e)
{
string? targetFolder = TargetList.SelectedItem as string;
TargetList.Items.Remove(targetFolder);
string[]? targetFolder = new string[0];
int i = 0;

foreach(var item in TargetList.SelectedItems)
{
Array.Resize(ref targetFolder, i + 1);
targetFolder[i] = item.ToString();
i++;
}
foreach (var item in targetFolder)
{
TargetList.Items.Remove(item);
}
}

private void ProjCombo_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions msbuild-gui/msbuild-gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<RootNamespace>msbuild_gui</RootNamespace>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<Company>yt3trees</Company>
<FileVersion>1.0.1.0</FileVersion>
<FileVersion>1.0.2.0</FileVersion>
<PackageIcon>MsBuild-Gui.png</PackageIcon>
<ApplicationIcon>image\MsBuild-Gui.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand Down

0 comments on commit 40fa5fe

Please sign in to comment.