UI - Fixed a lot of binding errors

UI - Added most missing DisposeWith calls
This commit is contained in:
Robert committed 2022-04-02 01:10:06 +02:00
1 parent 8fd18b9565
commit 372991a69b
28 files changed
+347 -230

No files matched your search

+24 -15
View File
@@ -285,34 +285,43 @@ namespace Artemis.Core.Modules
internal bool IsPropertyInUse(string path, bool includeChildren)
{
path = path.ToUpperInvariant();
return includeChildren
? _activePathsHashSet.Any(p => p.StartsWith(path, StringComparison.Ordinal))
: _activePathsHashSet.Contains(path);
lock (_activePaths)
{
return includeChildren
? _activePathsHashSet.Any(p => p.StartsWith(path, StringComparison.Ordinal))
: _activePathsHashSet.Contains(path);
}
}
internal void AddDataModelPath(DataModelPath path)
{
if (_activePaths.Contains(path))
return;
lock (_activePaths)
{
if (_activePaths.Contains(path))
return;
_activePaths.Add(path);
_activePaths.Add(path);
// Add to the hashset if this is the first path pointing
string hashPath = path.Path.ToUpperInvariant();
if (!_activePathsHashSet.Contains(hashPath))
_activePathsHashSet.Add(hashPath);
// Add to the hashset if this is the first path pointing
string hashPath = path.Path.ToUpperInvariant();
if (!_activePathsHashSet.Contains(hashPath))
_activePathsHashSet.Add(hashPath);
}
OnActivePathAdded(new DataModelPathEventArgs(path));
}
internal void RemoveDataModelPath(DataModelPath path)
{
if (!_activePaths.Remove(path))
return;
lock (_activePaths)
{
if (!_activePaths.Remove(path))
return;
// Remove from the hashset if this was the last path pointing there
if (_activePaths.All(p => p.Path != path.Path))
_activePathsHashSet.Remove(path.Path.ToUpperInvariant());
// Remove from the hashset if this was the last path pointing there
if (_activePaths.All(p => p.Path != path.Path))
_activePathsHashSet.Remove(path.Path.ToUpperInvariant());
}
OnActivePathRemoved(new DataModelPathEventArgs(path));
}
@@ -634,7 +634,7 @@ namespace Artemis.Core.Services
if (isAutoEnable)
{
// Schedule a retry based on the amount of attempts
if (pluginFeature.AutoEnableAttempts < 4)
if (pluginFeature.AutoEnableAttempts < 4 && pluginFeature.Plugin.IsEnabled)
{
TimeSpan retryDelay = TimeSpan.FromSeconds(pluginFeature.AutoEnableAttempts * 10);
_logger.Warning(
+1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Artemis.Core.Properties;
using Ninject;
using Ninject.Parameters;