2014-07-26 07:12:56 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2014-07-29 16:42:52 +00:00
|
|
|
|
using System.ComponentModel;
|
2014-07-26 07:12:56 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace RainmeterStudio.Model
|
|
|
|
|
{
|
2014-07-29 16:42:52 +00:00
|
|
|
|
public class Property : INotifyPropertyChanged
|
2014-07-26 07:12:56 +00:00
|
|
|
|
{
|
2014-07-29 16:42:52 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the name of the property
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Name { get; private set; }
|
2014-07-26 07:12:56 +00:00
|
|
|
|
|
|
|
|
|
private object _value;
|
2014-07-29 16:42:52 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the value of the property
|
|
|
|
|
/// </summary>
|
2014-07-26 07:12:56 +00:00
|
|
|
|
public object Value
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _value;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_value = value;
|
|
|
|
|
|
2014-07-29 16:42:52 +00:00
|
|
|
|
if (PropertyChanged != null)
|
|
|
|
|
PropertyChanged(this, new PropertyChangedEventArgs("Value"));
|
2014-07-26 07:12:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-29 16:42:52 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Triggered when the value changes
|
|
|
|
|
/// </summary>
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
2014-07-26 07:12:56 +00:00
|
|
|
|
|
2014-07-29 16:42:52 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes this property
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">Name of the property</param>
|
|
|
|
|
/// <param name="value">Value of the property</param>
|
|
|
|
|
public Property(string name, object value = null)
|
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Value = value;
|
|
|
|
|
}
|
2014-07-26 07:12:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|