Files
Torch/Torch/ViewModels/ViewModel.cs
John Gross 79fe6a08ab * Torch 1.0.182.329
- Improved logging, logs now to go the Logs folder and aren't deleted on start
    - Fixed chat tab not enabling with -autostart
    - Fixed player list
    - Watchdog time-out is now configurable in TorchConfig.xml
    - Fixed infinario log spam
    - Fixed crash when sending empty message from chat tab
    - Fixed permissions on Torch commands
    - Changed plugin StoragePath to the current instance path (per-instance configs)
2017-07-01 11:16:14 -07:00

34 lines
1008 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Torch
{
/// <summary>
/// Provides a method to notify an observer of changes to an object's properties.
/// </summary>
public class ViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
}
/// <summary>
/// Fires PropertyChanged for all properties.
/// </summary>
public void RefreshModel()
{
foreach (var propName in GetType().GetProperties().Select(x => x.Name))
// ReSharper disable once ExplicitCallerInfoArgument
OnPropertyChanged(propName);
}
}
}