Sicherung
This commit is contained in:
@@ -14,13 +14,6 @@
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Guis\TxtToClip.Mgt\**" />
|
||||
<EmbeddedResource Remove="Guis\TxtToClip.Mgt\**" />
|
||||
<None Remove="Guis\TxtToClip.Mgt\**" />
|
||||
<Page Remove="Guis\TxtToClip.Mgt\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Icons\Cross.png" />
|
||||
<None Remove="Icons\FondiumU.ico" />
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace FSI.Lib.Guis.Folder.Mgt//.Model
|
||||
namespace FSI.Lib.Guis.Folder.Mgt
|
||||
{
|
||||
public interface IInterface
|
||||
{
|
||||
@@ -33,6 +33,6 @@ namespace FSI.Lib.Guis.Folder.Mgt//.Model
|
||||
|
||||
public interface IDataProvider
|
||||
{
|
||||
IEnumerable<Model> Load(IEnumerable<IInterface> folders);
|
||||
IEnumerable<Model> Load(IEnumerable<IInterface> datas);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FSI.Lib.Guis.TxtToClip.Mgt"
|
||||
xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
|
||||
xmlns:control="clr-namespace:FSI.Lib.Wpf.Ctrls.FilterDataGrid"
|
||||
xmlns:viewmodel="clr-namespace:FSI.Lib.Guis.Folder.Mgt.ViewModel"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:ViewModel}"
|
||||
xmlns:control="clr-namespace:FSI.Lib.Wpf.Ctrls.FilterDataGrid"
|
||||
d:DataContext="{d:DesignInstance Type=local:ViewModel}"
|
||||
mc:Ignorable="d"
|
||||
SizeToContent="Width"
|
||||
Height="800"
|
||||
|
||||
@@ -1,18 +1,7 @@
|
||||
using FSI.Lib.Guis.TxtToClip.Mgt.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace FSI.Lib.Guis.TxtToClip.Mgt
|
||||
{
|
||||
@@ -21,9 +10,9 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt
|
||||
/// </summary>
|
||||
public partial class FrmMain : Window
|
||||
{
|
||||
public ViewModelTxtToClip Folder { get; set; }
|
||||
public ViewModel Folder { get; set; }
|
||||
public bool CloseAtLostFocus { get; set; }
|
||||
public IEnumerable<Model.IInterface> Data { get; set; }
|
||||
public IEnumerable<IInterface> InputData { get; set; }
|
||||
|
||||
public FrmMain()
|
||||
{
|
||||
@@ -44,9 +33,9 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt
|
||||
Title = "FSI Text in die Zwischenablage kopieren";
|
||||
Title += " v" + Assembly.GetExecutingAssembly().GetName().Version; // Version in Titel eintragen
|
||||
|
||||
Folder = new ViewModelTxtToClip(new DataProvider())
|
||||
Folder = new ViewModel(new DataProvider())
|
||||
{
|
||||
InputData = Data
|
||||
InputData = InputData
|
||||
};
|
||||
DataContext = Folder;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FSI.Lib.Guis.TxtToClip.Mgt.Model
|
||||
namespace FSI.Lib.Guis.TxtToClip.Mgt
|
||||
{
|
||||
public interface IInterface
|
||||
{
|
||||
@@ -14,7 +14,7 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt.Model
|
||||
string Txt { get; set; }
|
||||
}
|
||||
|
||||
public struct Interface : IInterface
|
||||
public struct Model : IInterface
|
||||
{
|
||||
private string _plant;
|
||||
private string _subPlant;
|
||||
@@ -29,6 +29,6 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt.Model
|
||||
|
||||
public interface IDataProvider
|
||||
{
|
||||
IEnumerable<Interface> Load(IEnumerable<IInterface> folders);
|
||||
IEnumerable<Model> Load(IEnumerable<IInterface> datas);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using FSI.Lib.Guis.TxtToClip.Mgt.Model;
|
||||
using FSI.Lib.MVVM;
|
||||
using FSI.Lib.MVVM;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
@@ -8,33 +7,33 @@ using System.Linq;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace FSI.Lib.Guis.TxtToClip.Mgt.ViewModel
|
||||
namespace FSI.Lib.Guis.TxtToClip.Mgt
|
||||
{
|
||||
public class ViewModelTxtToClip : MVVM.ViewModelBase
|
||||
public class ViewModel : MVVM.ViewModelBase
|
||||
{
|
||||
readonly IDataProvider _dataProvider;
|
||||
private string _search;
|
||||
private ICollectionView _collView;
|
||||
|
||||
public ICommand RefreshCommand => new DelegateCommand(RefreshData);
|
||||
private ICommand _cmdQuickSearch;
|
||||
private ICommand _cmdQuickSearch;
|
||||
private ICommand _cmdCopyToClip;
|
||||
|
||||
public ViewModelTxtToClip(IDataProvider dataProvider)
|
||||
public ViewModel(IDataProvider dataProvider)
|
||||
{
|
||||
Datas = new ObservableCollection<Model.Interface>();
|
||||
Datas = new ObservableCollection<Model>();
|
||||
_dataProvider = dataProvider;
|
||||
|
||||
_cmdQuickSearch = new RelayCommand<object>(ExecuteQuickSearch, CanExecuteQuickSearch);
|
||||
_cmdQuickSearch = new RelayCommand<object>(ExecuteQuickSearch, CanExecuteQuickSearch);
|
||||
_cmdCopyToClip = new RelayCommand<object>(ExecuteCopyToClip, CanExecuteCopyToClip);
|
||||
}
|
||||
|
||||
public ObservableCollection<Model.Interface> Datas { get; }
|
||||
public ObservableCollection<Model.Interface> FilteredData { get; set; }
|
||||
public ObservableCollection<Model> Datas { get; }
|
||||
public ObservableCollection<Model> FilteredData { get; set; }
|
||||
|
||||
public Model.Interface SeletctedData { get; set; }
|
||||
public Model SeletctedData { get; set; }
|
||||
|
||||
public IEnumerable<Model.IInterface> InputData { get; set; }
|
||||
public IEnumerable<IInterface> InputData { get; set; }
|
||||
|
||||
public void Load()
|
||||
{
|
||||
@@ -43,13 +42,13 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt.ViewModel
|
||||
|
||||
if (datas != null)
|
||||
{
|
||||
foreach (Model.Interface data in datas)
|
||||
foreach (Model data in datas)
|
||||
{
|
||||
Datas.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
FilteredData = new ObservableCollection<Model.Interface>(Datas);
|
||||
FilteredData = new ObservableCollection<Model>(Datas);
|
||||
_collView = CollectionViewSource.GetDefaultView(FilteredData);
|
||||
}
|
||||
|
||||
@@ -62,7 +61,7 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt.ViewModel
|
||||
|
||||
_collView.Filter = e =>
|
||||
{
|
||||
var item = (Model.Interface)e;
|
||||
var item = (Model)e;
|
||||
|
||||
return ((item.Plant?.StartsWith(_search, StringComparison.OrdinalIgnoreCase) ?? false)
|
||||
|| (item.SubPlant?.StartsWith(_search, StringComparison.OrdinalIgnoreCase) ?? false)
|
||||
@@ -77,7 +76,7 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt.ViewModel
|
||||
};
|
||||
|
||||
_collView.Refresh();
|
||||
FilteredData = new ObservableCollection<Model.Interface>(_collView.OfType<Model.Interface>().ToList());
|
||||
FilteredData = new ObservableCollection<Model>(_collView.OfType<Model>().ToList());
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
@@ -130,15 +129,15 @@ namespace FSI.Lib.Guis.TxtToClip.Mgt.ViewModel
|
||||
|
||||
public class DataProvider : IDataProvider
|
||||
{
|
||||
public IEnumerable<Model.Interface> Load(IEnumerable<IInterface> datas)
|
||||
public IEnumerable<Model> Load(IEnumerable<IInterface> datas)
|
||||
{
|
||||
var newDatas = new ObservableCollection<Model.Interface>();
|
||||
var newDatas = new ObservableCollection<Model>();
|
||||
|
||||
foreach (IInterface data in datas)
|
||||
{
|
||||
Model.Interface newData = new();
|
||||
Model newData = new();
|
||||
newData.Plant = data.Plant;
|
||||
newData.SubPlant = data.SubPlant;
|
||||
newData.SubPlant = data.SubPlant;
|
||||
newData.Description = data.Description;
|
||||
newData.Txt = data.Txt;
|
||||
|
||||
Reference in New Issue
Block a user