Implemented C# 6.0 features, fixed most of resharper's code quality suggestions.

This commit is contained in:
Ben Wallis
2015-12-13 20:17:15 +00:00
parent 9a117d118f
commit 2dc56799fd
70 changed files with 409 additions and 1259 deletions

View File

@@ -26,54 +26,21 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
}
}
public override string OutputText
{
get { return Action.GetAttributeDescription(); }
}
public override string OutputText => Action.GetAttributeDescription();
public override string PrefixText
{
get { return string.Empty; }
}
public override string PrefixText => string.Empty;
public override int MaximumAllowed
{
get { return 1; }
}
public override int MaximumAllowed => 1;
public override string DisplayHeading
{
get
{
return "Action";
}
}
public override string DisplayHeading => "Action";
public override string SummaryText
{
get
{
return Action == BlockAction.Show ? "Show" : "Hide";
}
}
public override string SummaryText => Action == BlockAction.Show ? "Show" : "Hide";
public override Color SummaryBackgroundColor
{
get
{
return Action == BlockAction.Show ? Colors.LimeGreen : Colors.OrangeRed;
}
}
public override Color SummaryBackgroundColor => Action == BlockAction.Show ? Colors.LimeGreen : Colors.OrangeRed;
public override Color SummaryTextColor
{
get
{
return Action == BlockAction.Show ? Colors.Black : Colors.White;
}
}
public override Color SummaryTextColor => Action == BlockAction.Show ? Colors.Black : Colors.White;
public override int SortOrder { get { return 0; } }
public override int SortOrder => 0;
public void ToggleAction()
{

View File

@@ -22,7 +22,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -18,20 +18,11 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
Color = color;
}
public override string OutputText
{
get
{
return PrefixText + " " + +Color.R + " " + Color.G + " "
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty) +
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
}
}
public override string OutputText => PrefixText + " " + +Color.R + " " + Color.G + " "
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty) +
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText
{
get { return string.Empty; }
}
public override string SummaryText => string.Empty;
public ThemeComponent ThemeComponent
{
@@ -56,8 +47,8 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
}
}
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
public override Color SummaryTextColor { get { return Colors.Transparent; } }
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public Color Color
{

View File

@@ -17,14 +17,11 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
SecondValue = secondValue;
}
public override string OutputText
{
get { return PrefixText + " " + Value + " " + SecondValue; }
}
public override string SummaryText { get { return string.Empty; } }
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
public override Color SummaryTextColor { get { return Colors.Transparent; } }
public override string OutputText => PrefixText + " " + Value + " " + SecondValue;
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public int Value
{

View File

@@ -15,14 +15,11 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
Value = value;
}
public override string OutputText
{
get { return PrefixText + " " + Value; }
}
public override string OutputText => PrefixText + " " + Value;
public override string SummaryText { get { return string.Empty; } }
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
public override Color SummaryTextColor { get { return Colors.Transparent; } }
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public abstract int Minimum { get; }
public abstract int Maximum { get; }

View File

@@ -20,14 +20,8 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
FilterPredicate.PropertyChanged += OnFilterPredicateChanged;
}
public override string OutputText
{
get
{
return PrefixText + " " + FilterPredicate.PredicateOperator.GetAttributeDescription() +
" " + FilterPredicate.PredicateOperand;
}
}
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator.GetAttributeDescription() +
" " + FilterPredicate.PredicateOperand;
public abstract int Minimum { get; }
public abstract int Maximum { get; }

View File

@@ -21,8 +21,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
if (enumerable.Count > 0)
{
return PrefixText + " " +
string.Format("\"{0}\"",
string.Join("\" \"", enumerable.ToArray()));
$"\"{string.Join("\" \"", enumerable.ToArray())}\"";
}
return string.Empty;

View File

@@ -13,27 +13,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "SetBackgroundColor"; }
}
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading
{
get
{
return "Background Color";
}
}
public override int SortOrder
{
get { return 13; }
}
public override string PrefixText => "SetBackgroundColor";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Background Color";
public override int SortOrder => 13;
}
}

View File

@@ -6,20 +6,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
public class BaseTypeBlockItem : StringListBlockItem
{
public override string PrefixText { get { return "BaseType"; } }
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading
{
get
{
return "Base Type";
}
}
public override string PrefixText => "BaseType";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Base Type";
public override string SummaryText
{
@@ -42,19 +31,8 @@ namespace Filtration.ObjectModel.BlockItemTypes
}
}
public override Color SummaryBackgroundColor
{
get { return Colors.MediumTurquoise; }
}
public override Color SummaryTextColor
{
get { return Colors.Black; }
}
public override int SortOrder
{
get { return 11; }
}
public override Color SummaryBackgroundColor => Colors.MediumTurquoise;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 11;
}
}

View File

@@ -13,27 +13,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "SetBorderColor"; }
}
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading
{
get
{
return "Border Color";
}
}
public override int SortOrder
{
get { return 14; }
}
public override string PrefixText => "SetBorderColor";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Border Color";
public override int SortOrder => 14;
}
}

View File

@@ -6,14 +6,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
public class ClassBlockItem : StringListBlockItem
{
public override string PrefixText { get { return "Class"; } }
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading { get { return "Class"; } }
public override string PrefixText => "Class";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Class";
public override string SummaryText
{
@@ -36,19 +31,8 @@ namespace Filtration.ObjectModel.BlockItemTypes
}
}
public override Color SummaryBackgroundColor
{
get { return Colors.MediumSeaGreen; }
}
public override Color SummaryTextColor
{
get { return Colors.White; }
}
public override int SortOrder
{
get { return 10; }
}
public override Color SummaryBackgroundColor => Colors.MediumSeaGreen;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 10;
}
}

View File

@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "DropLevel"; }
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get
{
return "Drop Level";
}
}
public override string SummaryText
{
get { return "Drop Level " + FilterPredicate; }
}
public override Color SummaryBackgroundColor
{
get { return Colors.DodgerBlue; }
}
public override Color SummaryTextColor
{
get { return Colors.White; }
}
public override int SortOrder
{
get { return 2; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return 100;
}
}
public override string PrefixText => "DropLevel";
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Drop Level";
public override string SummaryText => "Drop Level " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DodgerBlue;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 2;
public override int Minimum => 0;
public override int Maximum => 100;
}
}

View File

@@ -13,43 +13,11 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "SetFontSize"; }
}
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading
{
get
{
return "Font Size";
}
}
public override int SortOrder
{
get { return 15; }
}
public override int Minimum
{
get
{
return 11;
}
}
public override int Maximum
{
get
{
return 45;
}
}
public override string PrefixText => "SetFontSize";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Font Size";
public override int SortOrder => 15;
public override int Minimum => 11;
public override int Maximum => 45;
}
}

View File

@@ -15,55 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "Height"; }
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get { return "Height"; }
}
public override string SummaryText
{
get { return "Height " + FilterPredicate; }
}
public override Color SummaryBackgroundColor
{
get { return Colors.LightBlue; }
}
public override Color SummaryTextColor
{
get { return Colors.Black; }
}
public override int SortOrder
{
get { return 8; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return 6;
}
}
public override string PrefixText => "Height";
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Height";
public override string SummaryText => "Height " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.LightBlue;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 8;
public override int Minimum => 0;
public override int Maximum => 6;
}
}

View File

@@ -14,58 +14,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "ItemLevel"; }
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get
{
return "Item Level";
}
}
public override string SummaryText
{
get { return "Item Level " + FilterPredicate; }
}
public override Color SummaryBackgroundColor
{
get { return Colors.DarkSlateGray; }
}
public override Color SummaryTextColor
{
get { return Colors.White; }
}
public override int SortOrder
{
get { return 1; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return 100;
}
}
public override string PrefixText => "ItemLevel";
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Item Level";
public override string SummaryText => "Item Level " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 1;
public override int Minimum => 0;
public override int Maximum => 100;
}
}

View File

@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "LinkedSockets"; }
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get
{
return "Linked Sockets";
}
}
public override string SummaryText
{
get { return "Linked Sockets " + FilterPredicate; }
}
public override Color SummaryBackgroundColor
{
get { return Colors.Gold; }
}
public override Color SummaryTextColor
{
get { return Colors.Black; }
}
public override int SortOrder
{
get { return 6; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return 6;
}
}
public override string PrefixText => "LinkedSockets";
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Linked Sockets";
public override string SummaryText => "Linked Sockets " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.Gold;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 6;
public override int Minimum => 0;
public override int Maximum => 6;
}
}

View File

@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "Quality"; }
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get
{
return "Quality";
}
}
public override string SummaryText
{
get { return "Quality " + FilterPredicate; }
}
public override Color SummaryBackgroundColor
{
get { return Colors.DarkOrange; }
}
public override Color SummaryTextColor
{
get { return Colors.White; }
}
public override int SortOrder
{
get { return 3; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return 20;
}
}
public override string PrefixText => "Quality";
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Quality";
public override string SummaryText => "Quality " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DarkOrange;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 3;
public override int Minimum => 0;
public override int Maximum => 20;
}
}

View File

@@ -16,74 +16,17 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "Rarity"; }
}
public override string OutputText
{
get
{
return PrefixText + " " + FilterPredicate.PredicateOperator
.GetAttributeDescription() +
" " +
((ItemRarity) FilterPredicate.PredicateOperand)
.GetAttributeDescription();
}
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get
{
return "Item Rarity";
}
}
public override string SummaryText
{
get
{
return "Rarity " + FilterPredicate.PredicateOperator.GetAttributeDescription() + " " +
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
}
}
public override Color SummaryBackgroundColor
{
get { return Colors.LightCoral; }
}
public override Color SummaryTextColor
{
get { return Colors.White; }
}
public override int SortOrder
{
get { return 4; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return (int)ItemRarity.Unique;
}
}
public override string PrefixText => "Rarity";
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator
.GetAttributeDescription() + " " + ((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Item Rarity";
public override string SummaryText => "Rarity " + FilterPredicate.PredicateOperator.GetAttributeDescription() + " " +
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
public override Color SummaryBackgroundColor => Colors.LightCoral;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 4;
public override int Minimum => 0;
public override int Maximum => (int)ItemRarity.Unique;
}
}

View File

@@ -6,24 +6,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
public class SocketGroupBlockItem : StringListBlockItem
{
public override string PrefixText
{
get { return "SocketGroup"; }
}
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading
{
get
{
return "Socket Group";
}
}
public override string PrefixText => "SocketGroup";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Socket Group";
public override string SummaryText
{
get
@@ -32,20 +17,8 @@ namespace Filtration.ObjectModel.BlockItemTypes
return "Socket Group " + summaryItemText.TrimStart(' ');
}
}
public override Color SummaryBackgroundColor
{
get { return Colors.GhostWhite; }
}
public override Color SummaryTextColor
{
get { return Colors.Black; }
}
public override int SortOrder
{
get { return 9; }
}
public override Color SummaryBackgroundColor => Colors.GhostWhite;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 9;
}
}

View File

@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "Sockets"; }
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get
{
return "Sockets";
}
}
public override string SummaryText
{
get { return "Sockets " + FilterPredicate; }
}
public override Color SummaryBackgroundColor
{
get { return Colors.LightGray; }
}
public override Color SummaryTextColor
{
get { return Colors.Black; }
}
public override int SortOrder
{
get { return 5; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return 6;
}
}
public override string PrefixText => "Sockets";
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Sockets";
public override string SummaryText => "Sockets " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.LightGray;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 5;
public override int Minimum => 0;
public override int Maximum => 6;
}
}

View File

@@ -14,27 +14,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "PlayAlertSound"; }
}
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading
{
get
{
return "Play Alert Sound";
}
}
public override int SortOrder
{
get { return 16; }
}
public override string PrefixText => "PlayAlertSound";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Play Alert Sound";
public override int SortOrder => 16;
}
}

View File

@@ -13,27 +13,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "SetTextColor"; }
}
public override int MaximumAllowed
{
get { return 1; }
}
public override string DisplayHeading
{
get
{
return "Text Color";
}
}
public override int SortOrder
{
get { return 12; }
}
public override string PrefixText => "SetTextColor";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Text Color";
public override int SortOrder => 12;
}
}

View File

@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
}
public override string PrefixText
{
get { return "Width"; }
}
public override int MaximumAllowed
{
get { return 2; }
}
public override string DisplayHeading
{
get
{
return "Width";
}
}
public override string SummaryText
{
get { return "Width " + FilterPredicate; }
}
public override Color SummaryBackgroundColor
{
get { return Colors.MediumPurple; }
}
public override Color SummaryTextColor
{
get { return Colors.White; }
}
public override int SortOrder
{
get { return 7; }
}
public override int Minimum
{
get
{
return 0;
}
}
public override int Maximum
{
get
{
return 2;
}
}
public override string PrefixText => "Width";
public override int MaximumAllowed => 2;
public override string DisplayHeading => "Width";
public override string SummaryText => "Width " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.MediumPurple;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 7;
public override int Minimum => 0;
public override int Maximum => 2;
}
}

View File

@@ -10,7 +10,7 @@ namespace Filtration.ObjectModel.Extensions
var type = enumVal.GetType();
var memInfo = type.GetMember(enumVal.ToString());
var attributes = memInfo[0].GetCustomAttributes(typeof(T), false);
return (attributes.Length > 0) ? (T)attributes[0] : null;
return attributes.Length > 0 ? (T)attributes[0] : null;
}
public static string GetAttributeDescription(this Enum enumValue)

View File

@@ -59,11 +59,11 @@ namespace Filtration.ObjectModel
}
}
public ObservableCollection<IItemFilterBlockItem> BlockItems { get; private set; }
public ObservableCollection<IItemFilterBlockItem> BlockItems { get; }
public int BlockCount(Type type)
{
return BlockItems != null ? BlockItems.Count(b => b.GetType() == type) : 0;
return BlockItems?.Count(b => b.GetType() == type) ?? 0;
}
public bool AddBlockItemAllowed(Type type)

View File

@@ -17,10 +17,10 @@ namespace Filtration.ObjectModel
public event EventHandler BlockGroupStatusChanged;
public string GroupName { get; private set; }
public ItemFilterBlockGroup ParentGroup { get; private set; }
public List<ItemFilterBlockGroup> ChildGroups { get; private set; }
public bool Advanced { get; private set; }
public string GroupName { get; }
public ItemFilterBlockGroup ParentGroup { get; }
public List<ItemFilterBlockGroup> ChildGroups { get; }
public bool Advanced { get; }
public bool IsChecked
{
@@ -32,10 +32,7 @@ namespace Filtration.ObjectModel
_isChecked = value;
// Raise an event to let blocks that have this block group assigned that
// they might need to change their Action due to the block group status changing.
if (BlockGroupStatusChanged != null)
{
BlockGroupStatusChanged.Invoke(null, null);
}
BlockGroupStatusChanged?.Invoke(null, null);
}
}
}

View File

@@ -19,8 +19,8 @@ namespace Filtration.ObjectModel
ThemeComponents = new ThemeComponentCollection { IsMasterCollection = true};
}
public ObservableCollection<ItemFilterBlock> ItemFilterBlocks { get; private set; }
public ObservableCollection<ItemFilterBlockGroup> ItemFilterBlockGroups { get; private set; }
public ObservableCollection<ItemFilterBlock> ItemFilterBlocks { get; }
public ObservableCollection<ItemFilterBlockGroup> ItemFilterBlockGroups { get; }
public ThemeComponentCollection ThemeComponents { get; set; }

View File

@@ -53,7 +53,7 @@ namespace Filtration.ObjectModel
public virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Media;
using System.Xml.Serialization;
@@ -22,10 +21,7 @@ namespace Filtration.ObjectModel.ThemeEditor
[XmlIgnore]
public string FilePath { get; set; }
public ThemeComponentCollection Components
{
get { return _components; }
}
public ThemeComponentCollection Components => _components;
public bool ComponentExists(ThemeComponentType componentType, string componentName)
{

View File

@@ -2,7 +2,6 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;
using System.Xml.Serialization;
using Filtration.ObjectModel.Annotations;
using Filtration.ObjectModel.Enums;
@@ -66,10 +65,7 @@ namespace Filtration.ObjectModel.ThemeEditor
{
_color = value;
OnPropertyChanged();
if (_themeComponentUpdatedEventHandler != null)
{
_themeComponentUpdatedEventHandler.Invoke(this, EventArgs.Empty);
}
_themeComponentUpdatedEventHandler?.Invoke(this, EventArgs.Empty);
}
}
@@ -88,10 +84,7 @@ namespace Filtration.ObjectModel.ThemeEditor
public void TerminateComponent()
{
if (ThemeComponentDeleted != null)
{
ThemeComponentDeleted.Invoke(this, EventArgs.Empty);
}
ThemeComponentDeleted?.Invoke(this, EventArgs.Empty);
}
public event PropertyChangedEventHandler PropertyChanged;
@@ -100,7 +93,7 @@ namespace Filtration.ObjectModel.ThemeEditor
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}