Merge pull request #21 from Bletch1971/ServerMonitorChanges

Server monitor changes
This commit is contained in:
Brett Hewitson 2022-05-18 23:54:00 +10:00 committed by GitHub
commit bdd36bf235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 1825 additions and 329 deletions

View file

@ -19,7 +19,6 @@ namespace ServerManagerTool.Common.Lib
public ActionQueue(TaskScheduler scheduler = null)
{
this.workQueue = new ActionBlock<Action>(a => a.Invoke(), new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 1, TaskScheduler = scheduler ?? TaskScheduler.Default });
}
public Task<T> PostAction<T>(Func<T> action)

View file

@ -31,10 +31,7 @@ namespace ServerManagerTool.Common.Lib
/// <param name="canExecute">The execution status logic.</param>
public RelayCommand(Action<T> execute, Predicate<T> canExecute)
{
if (execute == null)
throw new ArgumentNullException("execute");
_execute = execute;
_execute = execute ?? throw new ArgumentNullException("execute");
_canExecute = canExecute;
}
@ -53,7 +50,7 @@ namespace ServerManagerTool.Common.Lib
{
try
{
return _canExecute == null ? true : _canExecute((T)parameter);
return _canExecute == null || _canExecute((T)parameter);
}
catch (Exception)
{

View file

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<Configurations>Debug;Release;Debug - Beta</Configurations>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net462</TargetFramework>