First commit
This commit is contained in:
43
Runtime/Models/Properties/ExposedProperty.cs
Normal file
43
Runtime/Models/Properties/ExposedProperty.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
|
||||
namespace Misaki.GraphView
|
||||
{
|
||||
[Serializable]
|
||||
public class ExposedProperty : IEquatable<ExposedProperty>
|
||||
{
|
||||
public string id = Guid.NewGuid().ToString();
|
||||
public string propertyName;
|
||||
public string propertyType;
|
||||
|
||||
public virtual object Value { get; set; }
|
||||
public virtual Type GetValueType() => Value == null ? typeof(object) : Value.GetType();
|
||||
|
||||
public bool Equals(ExposedProperty other)
|
||||
{
|
||||
if (other is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(this, other))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return id == other.id && propertyName == other.propertyName && propertyType == other.propertyType;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((ExposedProperty)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(id, propertyName, propertyType);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/Models/Properties/ExposedProperty.cs.meta
Normal file
3
Runtime/Models/Properties/ExposedProperty.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8072bd56f5fc4873b2db86cf44ed6c57
|
||||
timeCreated: 1730454701
|
||||
Reference in New Issue
Block a user