mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Darthified code
This commit is contained in:
1 parent
5b80c1e4fe
commit
ae64db8a13
198 files changed
+1339
-1305
No files matched your search
+3
-2
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -37,7 +38,7 @@ namespace Artemis.Core.Modules
|
||||
if (ProcessName == null && Location == null)
|
||||
return false;
|
||||
|
||||
var processes = ProcessName != null ? Process.GetProcessesByName(ProcessName).Where(p => !p.HasExited) : Process.GetProcesses().Where(p => !p.HasExited);
|
||||
IEnumerable<Process> processes = ProcessName != null ? Process.GetProcessesByName(ProcessName).Where(p => !p.HasExited) : Process.GetProcesses().Where(p => !p.HasExited);
|
||||
return Location != null
|
||||
? processes.Any(p => string.Equals(Path.GetDirectoryName(p.GetProcessFilename()), Location, StringComparison.CurrentCultureIgnoreCase))
|
||||
: processes.Any();
|
||||
@@ -46,7 +47,7 @@ namespace Artemis.Core.Modules
|
||||
/// <inheritdoc />
|
||||
public string GetUserFriendlyDescription()
|
||||
{
|
||||
var description = $"Requirement met when \"{ProcessName}.exe\" is running";
|
||||
string description = $"Requirement met when \"{ProcessName}.exe\" is running";
|
||||
if (Location != null)
|
||||
description += $" from \"{Location}\"";
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Artemis.Core.Modules
|
||||
/// <param name="propertyLambda">A lambda expression pointing to the property to ignore</param>
|
||||
public void HideProperty<TProperty>(Expression<Func<T, TProperty>> propertyLambda)
|
||||
{
|
||||
var propertyInfo = ReflectionUtilities.GetPropertyInfo(DataModel, propertyLambda);
|
||||
PropertyInfo propertyInfo = ReflectionUtilities.GetPropertyInfo(DataModel, propertyLambda);
|
||||
if (!HiddenPropertiesList.Any(p => p.Equals(propertyInfo)))
|
||||
HiddenPropertiesList.Add(propertyInfo);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ namespace Artemis.Core.Modules
|
||||
/// <param name="propertyLambda">A lambda expression pointing to the property to stop ignoring</param>
|
||||
public void ShowProperty<TProperty>(Expression<Func<T, TProperty>> propertyLambda)
|
||||
{
|
||||
var propertyInfo = ReflectionUtilities.GetPropertyInfo(DataModel, propertyLambda);
|
||||
PropertyInfo propertyInfo = ReflectionUtilities.GetPropertyInfo(DataModel, propertyLambda);
|
||||
HiddenPropertiesList.RemoveAll(p => p.Equals(propertyInfo));
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace Artemis.Core.Modules
|
||||
{
|
||||
base.Deactivate(isOverride);
|
||||
|
||||
var profile = ActiveProfile;
|
||||
Profile profile = ActiveProfile;
|
||||
ActiveProfile = null;
|
||||
profile?.Dispose();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user