Implemented C# 6.0 features, fixed most of resharper's code quality suggestions.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user