mirror of
https://github.com/EpicMorg/UniversalValveToolbox.git
synced 2025-03-06 10:30:32 +03:00
fix addons
This commit is contained in:
parent
badbb43b3b
commit
6a0544df5f
@ -26,5 +26,7 @@ namespace UniversalValveToolbox.Model.Dto {
|
|||||||
get => args;
|
get => args;
|
||||||
set => UpdateField(value, ref args);
|
set => UpdateField(value, ref args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString() => name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UniversalValveToolbox.Base;
|
||||||
|
using UniversalValveToolbox.Model.Dto;
|
||||||
|
|
||||||
|
namespace UniversalValveToolbox.Model.ViewModel {
|
||||||
|
class FormProjectViewModel: DtoModel {
|
||||||
|
private ProjectDtoModel selectProject;
|
||||||
|
|
||||||
|
public ProjectDtoModel SelectProject {
|
||||||
|
get => selectProject;
|
||||||
|
set => UpdateField(value, ref selectProject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -161,7 +161,8 @@ namespace UniversalValveToolbox {
|
|||||||
removeItem.ForEach(item => listView.Items.Remove(item));
|
removeItem.ForEach(item => listView.Items.Remove(item));
|
||||||
|
|
||||||
if (pathSelectedEngine != null) {
|
if (pathSelectedEngine != null) {
|
||||||
var pairPathIconTools = SelectedEngine.Tools.Select(tool => {
|
var pairPathIconTools = SelectedEngine.Tools
|
||||||
|
.Select(tool => {
|
||||||
var keyByPath = Path.Combine(pathSelectedEngine, tool.Bin);
|
var keyByPath = Path.Combine(pathSelectedEngine, tool.Bin);
|
||||||
var icon = Icon.ExtractAssociatedIcon(Path.Combine(pathSelectedEngine, tool.Bin));
|
var icon = Icon.ExtractAssociatedIcon(Path.Combine(pathSelectedEngine, tool.Bin));
|
||||||
|
|
||||||
@ -204,10 +205,16 @@ namespace UniversalValveToolbox {
|
|||||||
removeItem.ForEach(item => listView.Items.Remove(item));
|
removeItem.ForEach(item => listView.Items.Remove(item));
|
||||||
|
|
||||||
|
|
||||||
if (pathSelectedEngine != null) {
|
var pairPathIconTools = addonsSelectedEngine
|
||||||
var pairPathIconTools = addonsSelectedEngine.Select(addons => {
|
.Where(addon => {
|
||||||
var keyByPath = Path.Combine(pathSelectedEngine, addons.Bin);
|
var path = addon.Bin;
|
||||||
var icon = Icon.ExtractAssociatedIcon(Path.Combine(pathSelectedEngine, addons.Bin));
|
|
||||||
|
return File.Exists(path);
|
||||||
|
|
||||||
|
})
|
||||||
|
.Select(addons => {
|
||||||
|
var keyByPath = addons.Bin;
|
||||||
|
var icon = Icon.ExtractAssociatedIcon(keyByPath);
|
||||||
|
|
||||||
return new Pair(keyByPath, icon);
|
return new Pair(keyByPath, icon);
|
||||||
});
|
});
|
||||||
@ -216,7 +223,6 @@ namespace UniversalValveToolbox {
|
|||||||
listView.SmallImageList.Images.Add((string)pair.First, (Icon)pair.Second);
|
listView.SmallImageList.Images.Add((string)pair.First, (Icon)pair.Second);
|
||||||
listView.LargeImageList.Images.Add((string)pair.First, (Icon)pair.Second);
|
listView.LargeImageList.Images.Add((string)pair.First, (Icon)pair.Second);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var itemsAddons = addonsSelectedEngine.Select(addons => {
|
var itemsAddons = addonsSelectedEngine.Select(addons => {
|
||||||
string keyByPath = null;
|
string keyByPath = null;
|
||||||
|
@ -1,10 +1,23 @@
|
|||||||
using System;
|
using kasthack.binding.wf;
|
||||||
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using UniversalValveToolbox.Model.Provider;
|
||||||
|
using UniversalValveToolbox.Model.ViewModel;
|
||||||
|
|
||||||
namespace UniversalValveToolbox {
|
namespace UniversalValveToolbox {
|
||||||
public partial class FormProfiles : Form {
|
public partial class FormProfiles : Form {
|
||||||
|
private DataProvider dataProvider = new DataProvider();
|
||||||
|
|
||||||
|
private FormProjectViewModel model = new FormProjectViewModel();
|
||||||
|
|
||||||
public FormProfiles() {
|
public FormProfiles() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
comboBox_Mod.Items.Clear();
|
||||||
|
comboBox_Mod.Items.AddRange(dataProvider.Projects);
|
||||||
|
//textBox1.Text = "1";
|
||||||
|
|
||||||
|
//textBox1.Bind(a => a.Name, model, a => a.SelectProject.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FormEditProfile_Load(object sender, EventArgs e) {
|
private void FormEditProfile_Load(object sender, EventArgs e) {
|
||||||
|
@ -61,7 +61,8 @@
|
|||||||
<Reference Include="WindowsFormsIntegration" />
|
<Reference Include="WindowsFormsIntegration" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Model\VIewModel\SteamDataViewModel.cs" />
|
<Compile Include="Model\ViewModel\FormProjectViewModel.cs" />
|
||||||
|
<Compile Include="Model\ViewModel\SteamDataViewModel.cs" />
|
||||||
<Compile Include="Properties\translations\LangDict.Designer.cs">
|
<Compile Include="Properties\translations\LangDict.Designer.cs">
|
||||||
<DependentUpon>LangDict.resx</DependentUpon>
|
<DependentUpon>LangDict.resx</DependentUpon>
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
@ -145,7 +146,7 @@
|
|||||||
<Compile Include="Utils\JsonFileUtil.cs" />
|
<Compile Include="Utils\JsonFileUtil.cs" />
|
||||||
<Compile Include="Utils\LanguageManager.cs" />
|
<Compile Include="Utils\LanguageManager.cs" />
|
||||||
<Compile Include="Model\Dto\ToolDtoModel.cs" />
|
<Compile Include="Model\Dto\ToolDtoModel.cs" />
|
||||||
<Compile Include="Model\VIewModel\SettingsViewModel.cs" />
|
<Compile Include="Model\ViewModel\SettingsViewModel.cs" />
|
||||||
<Compile Include="Model\Dto\SettingsDtoModel.cs" />
|
<Compile Include="Model\Dto\SettingsDtoModel.cs" />
|
||||||
<Compile Include="Model\Provider\LanguageProvider.cs" />
|
<Compile Include="Model\Provider\LanguageProvider.cs" />
|
||||||
<Compile Include="Utils\SteamManager.cs" />
|
<Compile Include="Utils\SteamManager.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user