mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace RainmeterStudio.Model
|
|
{
|
|
/// <summary>
|
|
/// Reference to a file or folder
|
|
/// </summary>
|
|
public class Reference
|
|
{
|
|
[XmlAttribute("name")]
|
|
public string Name { get; set; }
|
|
|
|
[XmlAttribute("path")]
|
|
public string Path { get; set; }
|
|
|
|
public Reference()
|
|
{
|
|
}
|
|
|
|
public Reference(string name, string path = null)
|
|
{
|
|
Name = name;
|
|
Path = path;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
var other = obj as Reference;
|
|
|
|
// Types are different, so not equal
|
|
if (other == null)
|
|
return false;
|
|
|
|
// Compare using string equals
|
|
return String.Equals(Name, other.Name) && String.Equals(Path, other.Path);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
int hash = (Name == null) ? 0 : Name.GetHashCode();
|
|
hash = hash * 7 + ((Path == null) ? 0 : Path.GetHashCode());
|
|
|
|
return hash;
|
|
}
|
|
}
|
|
}
|