defend
6 years ago
13 changed files with 645 additions and 33 deletions
@ -0,0 +1,63 @@ |
|||||
|
############################################################################### |
||||
|
# Set default behavior to automatically normalize line endings. |
||||
|
############################################################################### |
||||
|
* text=auto |
||||
|
|
||||
|
############################################################################### |
||||
|
# Set default behavior for command prompt diff. |
||||
|
# |
||||
|
# This is need for earlier builds of msysgit that does not have it on by |
||||
|
# default for csharp files. |
||||
|
# Note: This is only used by command line |
||||
|
############################################################################### |
||||
|
#*.cs diff=csharp |
||||
|
|
||||
|
############################################################################### |
||||
|
# Set the merge driver for project and solution files |
||||
|
# |
||||
|
# Merging from the command prompt will add diff markers to the files if there |
||||
|
# are conflicts (Merging from VS is not affected by the settings below, in VS |
||||
|
# the diff markers are never inserted). Diff markers may cause the following |
||||
|
# file extensions to fail to load in VS. An alternative would be to treat |
||||
|
# these files as binary and thus will always conflict and require user |
||||
|
# intervention with every merge. To do so, just uncomment the entries below |
||||
|
############################################################################### |
||||
|
#*.sln merge=binary |
||||
|
#*.csproj merge=binary |
||||
|
#*.vbproj merge=binary |
||||
|
#*.vcxproj merge=binary |
||||
|
#*.vcproj merge=binary |
||||
|
#*.dbproj merge=binary |
||||
|
#*.fsproj merge=binary |
||||
|
#*.lsproj merge=binary |
||||
|
#*.wixproj merge=binary |
||||
|
#*.modelproj merge=binary |
||||
|
#*.sqlproj merge=binary |
||||
|
#*.wwaproj merge=binary |
||||
|
|
||||
|
############################################################################### |
||||
|
# behavior for image files |
||||
|
# |
||||
|
# image files are treated as binary by default. |
||||
|
############################################################################### |
||||
|
#*.jpg binary |
||||
|
#*.png binary |
||||
|
#*.gif binary |
||||
|
|
||||
|
############################################################################### |
||||
|
# diff behavior for common document formats |
||||
|
# |
||||
|
# Convert binary document formats to text before diffing them. This feature |
||||
|
# is only available from the command line. Turn it on by uncommenting the |
||||
|
# entries below. |
||||
|
############################################################################### |
||||
|
#*.doc diff=astextplain |
||||
|
#*.DOC diff=astextplain |
||||
|
#*.docx diff=astextplain |
||||
|
#*.DOCX diff=astextplain |
||||
|
#*.dot diff=astextplain |
||||
|
#*.DOT diff=astextplain |
||||
|
#*.pdf diff=astextplain |
||||
|
#*.PDF diff=astextplain |
||||
|
#*.rtf diff=astextplain |
||||
|
#*.RTF diff=astextplain |
@ -0,0 +1,261 @@ |
|||||
|
## Ignore Visual Studio temporary files, build results, and |
||||
|
## files generated by popular Visual Studio add-ons. |
||||
|
|
||||
|
# User-specific files |
||||
|
*.suo |
||||
|
*.user |
||||
|
*.userosscache |
||||
|
*.sln.docstates |
||||
|
|
||||
|
# User-specific files (MonoDevelop/Xamarin Studio) |
||||
|
*.userprefs |
||||
|
|
||||
|
# Build results |
||||
|
[Dd]ebug/ |
||||
|
[Dd]ebugPublic/ |
||||
|
[Rr]elease/ |
||||
|
[Rr]eleases/ |
||||
|
x64/ |
||||
|
x86/ |
||||
|
bld/ |
||||
|
[Bb]in/ |
||||
|
[Oo]bj/ |
||||
|
[Ll]og/ |
||||
|
|
||||
|
# Visual Studio 2015 cache/options directory |
||||
|
.vs/ |
||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot |
||||
|
#wwwroot/ |
||||
|
|
||||
|
# MSTest test Results |
||||
|
[Tt]est[Rr]esult*/ |
||||
|
[Bb]uild[Ll]og.* |
||||
|
|
||||
|
# NUNIT |
||||
|
*.VisualState.xml |
||||
|
TestResult.xml |
||||
|
|
||||
|
# Build Results of an ATL Project |
||||
|
[Dd]ebugPS/ |
||||
|
[Rr]eleasePS/ |
||||
|
dlldata.c |
||||
|
|
||||
|
# DNX |
||||
|
project.lock.json |
||||
|
project.fragment.lock.json |
||||
|
artifacts/ |
||||
|
|
||||
|
*_i.c |
||||
|
*_p.c |
||||
|
*_i.h |
||||
|
*.ilk |
||||
|
*.meta |
||||
|
*.obj |
||||
|
*.pch |
||||
|
*.pdb |
||||
|
*.pgc |
||||
|
*.pgd |
||||
|
*.rsp |
||||
|
*.sbr |
||||
|
*.tlb |
||||
|
*.tli |
||||
|
*.tlh |
||||
|
*.tmp |
||||
|
*.tmp_proj |
||||
|
*.log |
||||
|
*.vspscc |
||||
|
*.vssscc |
||||
|
.builds |
||||
|
*.pidb |
||||
|
*.svclog |
||||
|
*.scc |
||||
|
|
||||
|
# Chutzpah Test files |
||||
|
_Chutzpah* |
||||
|
|
||||
|
# Visual C++ cache files |
||||
|
ipch/ |
||||
|
*.aps |
||||
|
*.ncb |
||||
|
*.opendb |
||||
|
*.opensdf |
||||
|
*.sdf |
||||
|
*.cachefile |
||||
|
*.VC.db |
||||
|
*.VC.VC.opendb |
||||
|
|
||||
|
# Visual Studio profiler |
||||
|
*.psess |
||||
|
*.vsp |
||||
|
*.vspx |
||||
|
*.sap |
||||
|
|
||||
|
# TFS 2012 Local Workspace |
||||
|
$tf/ |
||||
|
|
||||
|
# Guidance Automation Toolkit |
||||
|
*.gpState |
||||
|
|
||||
|
# ReSharper is a .NET coding add-in |
||||
|
_ReSharper*/ |
||||
|
*.[Rr]e[Ss]harper |
||||
|
*.DotSettings.user |
||||
|
|
||||
|
# JustCode is a .NET coding add-in |
||||
|
.JustCode |
||||
|
|
||||
|
# TeamCity is a build add-in |
||||
|
_TeamCity* |
||||
|
|
||||
|
# DotCover is a Code Coverage Tool |
||||
|
*.dotCover |
||||
|
|
||||
|
# NCrunch |
||||
|
_NCrunch_* |
||||
|
.*crunch*.local.xml |
||||
|
nCrunchTemp_* |
||||
|
|
||||
|
# MightyMoose |
||||
|
*.mm.* |
||||
|
AutoTest.Net/ |
||||
|
|
||||
|
# Web workbench (sass) |
||||
|
.sass-cache/ |
||||
|
|
||||
|
# Installshield output folder |
||||
|
[Ee]xpress/ |
||||
|
|
||||
|
# DocProject is a documentation generator add-in |
||||
|
DocProject/buildhelp/ |
||||
|
DocProject/Help/*.HxT |
||||
|
DocProject/Help/*.HxC |
||||
|
DocProject/Help/*.hhc |
||||
|
DocProject/Help/*.hhk |
||||
|
DocProject/Help/*.hhp |
||||
|
DocProject/Help/Html2 |
||||
|
DocProject/Help/html |
||||
|
|
||||
|
# Click-Once directory |
||||
|
publish/ |
||||
|
|
||||
|
# Publish Web Output |
||||
|
*.[Pp]ublish.xml |
||||
|
*.azurePubxml |
||||
|
# TODO: Comment the next line if you want to checkin your web deploy settings |
||||
|
# but database connection strings (with potential passwords) will be unencrypted |
||||
|
#*.pubxml |
||||
|
*.publishproj |
||||
|
|
||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to |
||||
|
# checkin your Azure Web App publish settings, but sensitive information contained |
||||
|
# in these scripts will be unencrypted |
||||
|
PublishScripts/ |
||||
|
|
||||
|
# NuGet Packages |
||||
|
*.nupkg |
||||
|
# The packages folder can be ignored because of Package Restore |
||||
|
**/packages/* |
||||
|
# except build/, which is used as an MSBuild target. |
||||
|
!**/packages/build/ |
||||
|
# Uncomment if necessary however generally it will be regenerated when needed |
||||
|
#!**/packages/repositories.config |
||||
|
# NuGet v3's project.json files produces more ignoreable files |
||||
|
*.nuget.props |
||||
|
*.nuget.targets |
||||
|
|
||||
|
# Microsoft Azure Build Output |
||||
|
csx/ |
||||
|
*.build.csdef |
||||
|
|
||||
|
# Microsoft Azure Emulator |
||||
|
ecf/ |
||||
|
rcf/ |
||||
|
|
||||
|
# Windows Store app package directories and files |
||||
|
AppPackages/ |
||||
|
BundleArtifacts/ |
||||
|
Package.StoreAssociation.xml |
||||
|
_pkginfo.txt |
||||
|
|
||||
|
# Visual Studio cache files |
||||
|
# files ending in .cache can be ignored |
||||
|
*.[Cc]ache |
||||
|
# but keep track of directories ending in .cache |
||||
|
!*.[Cc]ache/ |
||||
|
|
||||
|
# Others |
||||
|
ClientBin/ |
||||
|
~$* |
||||
|
*~ |
||||
|
*.dbmdl |
||||
|
*.dbproj.schemaview |
||||
|
*.jfm |
||||
|
*.pfx |
||||
|
*.publishsettings |
||||
|
node_modules/ |
||||
|
orleans.codegen.cs |
||||
|
|
||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components |
||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) |
||||
|
#bower_components/ |
||||
|
|
||||
|
# RIA/Silverlight projects |
||||
|
Generated_Code/ |
||||
|
|
||||
|
# Backup & report files from converting an old project file |
||||
|
# to a newer Visual Studio version. Backup files are not needed, |
||||
|
# because we have git ;-) |
||||
|
_UpgradeReport_Files/ |
||||
|
Backup*/ |
||||
|
UpgradeLog*.XML |
||||
|
UpgradeLog*.htm |
||||
|
|
||||
|
# SQL Server files |
||||
|
*.mdf |
||||
|
*.ldf |
||||
|
|
||||
|
# Business Intelligence projects |
||||
|
*.rdl.data |
||||
|
*.bim.layout |
||||
|
*.bim_*.settings |
||||
|
|
||||
|
# Microsoft Fakes |
||||
|
FakesAssemblies/ |
||||
|
|
||||
|
# GhostDoc plugin setting file |
||||
|
*.GhostDoc.xml |
||||
|
|
||||
|
# Node.js Tools for Visual Studio |
||||
|
.ntvs_analysis.dat |
||||
|
|
||||
|
# Visual Studio 6 build log |
||||
|
*.plg |
||||
|
|
||||
|
# Visual Studio 6 workspace options file |
||||
|
*.opt |
||||
|
|
||||
|
# Visual Studio LightSwitch build output |
||||
|
**/*.HTMLClient/GeneratedArtifacts |
||||
|
**/*.DesktopClient/GeneratedArtifacts |
||||
|
**/*.DesktopClient/ModelManifest.xml |
||||
|
**/*.Server/GeneratedArtifacts |
||||
|
**/*.Server/ModelManifest.xml |
||||
|
_Pvt_Extensions |
||||
|
|
||||
|
# Paket dependency manager |
||||
|
.paket/paket.exe |
||||
|
paket-files/ |
||||
|
|
||||
|
# FAKE - F# Make |
||||
|
.fake/ |
||||
|
|
||||
|
# JetBrains Rider |
||||
|
.idea/ |
||||
|
*.sln.iml |
||||
|
|
||||
|
# CodeRush |
||||
|
.cr/ |
||||
|
|
||||
|
# Python Tools for Visual Studio (PTVS) |
||||
|
__pycache__/ |
||||
|
*.pyc |
@ -0,0 +1,5 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
||||
|
<Costura /> |
||||
|
<PropertyChanged /> |
||||
|
</Weavers> |
@ -0,0 +1,140 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
||||
|
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
||||
|
<xs:element name="Weavers"> |
||||
|
<xs:complexType> |
||||
|
<xs:all> |
||||
|
<xs:element name="Costura" minOccurs="0" maxOccurs="1"> |
||||
|
<xs:complexType> |
||||
|
<xs:all> |
||||
|
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
</xs:all> |
||||
|
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="DisableCompression" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="DisableCleanup" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="LoadAtModuleInit" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="ExcludeAssemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="IncludeAssemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="Unmanaged32Assemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="Unmanaged64Assemblies" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="PreloadOrder" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
<xs:element name="PropertyChanged" minOccurs="0" maxOccurs="1"> |
||||
|
<xs:complexType> |
||||
|
<xs:attribute name="InjectOnPropertyNameChanged" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="EventInvokerNames" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="CheckForEquality" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="CheckForEqualityUsingBaseEquals" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Used to control if equality checks should use the Equals method resolved from the base class.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="UseStaticEqualsFromBase" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:all> |
||||
|
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:schema> |
@ -0,0 +1,24 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel; |
||||
|
using System.Runtime.CompilerServices; |
||||
|
|
||||
|
namespace Pores.Helpers |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class PropertyChangedClass : INotifyPropertyChanged |
||||
|
{ |
||||
|
[field: NonSerialized] |
||||
|
public virtual event PropertyChangedEventHandler PropertyChanged; |
||||
|
|
||||
|
public virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||||
|
{ |
||||
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||||
|
} |
||||
|
|
||||
|
public virtual void OnPropertyChanged(params string[] propertyNames) |
||||
|
{ |
||||
|
foreach (var property in propertyNames) |
||||
|
OnPropertyChanged(property); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
using System; |
||||
|
using System.Windows.Input; |
||||
|
|
||||
|
namespace Pores.Helpers |
||||
|
{ |
||||
|
public class RelayCommand<T> : ICommand |
||||
|
{ |
||||
|
protected Action<T> _execute; |
||||
|
protected Func<T, bool> _canExecute; |
||||
|
|
||||
|
protected RelayCommand() { } |
||||
|
|
||||
|
public RelayCommand(Action<T> execute, Func<T, bool> canExecute) |
||||
|
{ |
||||
|
if(execute == null) |
||||
|
throw new ArgumentNullException(nameof(execute)); |
||||
|
|
||||
|
_execute = execute; |
||||
|
_canExecute = canExecute ?? (p => true); |
||||
|
} |
||||
|
|
||||
|
public RelayCommand(Action<T> execute) : this(execute, (Func<T, bool>)null) { } |
||||
|
public RelayCommand(Action<T> execute, Func<bool> canExecute) : this(execute, p => canExecute()) { } |
||||
|
|
||||
|
public event EventHandler CanExecuteChanged |
||||
|
{ |
||||
|
add { CommandManager.RequerySuggested += value; } |
||||
|
remove { CommandManager.RequerySuggested -= value; } |
||||
|
} |
||||
|
|
||||
|
public void Execute(object parameter) => _execute((T)parameter); |
||||
|
public bool CanExecute(object parameter) => _canExecute((T)parameter); |
||||
|
} |
||||
|
|
||||
|
public class RelayCommand : RelayCommand<object> |
||||
|
{ |
||||
|
public RelayCommand(Action<object> execute, Func<object, bool> canExecute) : base(execute, canExecute) { } |
||||
|
|
||||
|
public RelayCommand(Action execute) : base(p => execute()) { } |
||||
|
public RelayCommand(Action execute, Func<bool> canExecute) : base(p => execute(), p => canExecute()) { } |
||||
|
|
||||
|
public RelayCommand(Action<object> execute) : base(execute) { } |
||||
|
public RelayCommand(Action<object> execute, Func<bool> canExecute) : base(execute, canExecute) { } |
||||
|
} |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
using Pores.Controllers; |
||||
|
using Pores.Interfaces; |
||||
|
using Pores.Models; |
||||
|
using Pores.Models.Localizations; |
||||
|
using Pores.Helpers; |
||||
|
using System.Windows.Input; |
||||
|
|
||||
|
namespace Pores |
||||
|
{ |
||||
|
public class MainWindowViewModel : PropertyChangedClass |
||||
|
{ |
||||
|
public Material Material { get; set; } = new Material(); |
||||
|
public IPoreLocalization Localization { get; set; } |
||||
|
public ModelGenerationController GenController { get; set; } |
||||
|
|
||||
|
public int NumberOfPores { get; set; } |
||||
|
public ICommand GeneratePoresCommand { get; set; } |
||||
|
|
||||
|
public MainWindowViewModel() |
||||
|
{ |
||||
|
Init(); |
||||
|
GeneratePoresCommand = new RelayCommand(StartGeneration, () => true); |
||||
|
} |
||||
|
|
||||
|
public void Init() |
||||
|
{ |
||||
|
Localization = new NormalLocalization(Material); |
||||
|
GenController = new ModelGenerationController(Localization); |
||||
|
} |
||||
|
|
||||
|
public void StartGeneration() |
||||
|
{ |
||||
|
GenController.GeneratePores(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -1,10 +1,13 @@ |
|||||
namespace Pores.Models |
using Pores.Helpers; |
||||
|
|
||||
|
namespace Pores.Models |
||||
{ |
{ |
||||
public class Material |
public class Material : PropertyChangedClass |
||||
{ |
{ |
||||
public Coordinate GetCoordinate { get; set; } |
public Coordinate GetCoordinate { get; set; } |
||||
public double Height { get; set; } |
public double Height { get; set; } |
||||
public double Width { get; set; } |
public double Width { get; set; } |
||||
public double Depth { get; set; } |
public double Depth { get; set; } |
||||
|
public int NumberOfPores { get; set; } |
||||
} |
} |
||||
} |
} |
||||
|
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<packages> |
||||
|
<package id="Costura.Fody" version="3.2.1" targetFramework="net461" /> |
||||
|
<package id="Fody" version="3.3.3" targetFramework="net461" developmentDependency="true" /> |
||||
|
<package id="PropertyChanged.Fody" version="2.6.0" targetFramework="net461" /> |
||||
|
</packages> |
Loading…
Reference in new issue