first commit -push
This commit is contained in:
23
RobotNet.ScriptManager/Models/ScriptVariable.cs
Normal file
23
RobotNet.ScriptManager/Models/ScriptVariable.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using RobotNet.ScriptManager.Helpers;
|
||||
|
||||
namespace RobotNet.ScriptManager.Models;
|
||||
|
||||
public class ScriptVariableSyntax(string name, Type type, object? defaultValue, bool publicRead, bool publicWrite)
|
||||
{
|
||||
public string Name { get; } = name;
|
||||
public Type Type { get; } = type;
|
||||
public string TypeName { get; } = CSharpSyntaxHelper.ToTypeString(type);
|
||||
public object? DefaultValue { get; } = defaultValue;
|
||||
public bool PublicRead { get; } = publicRead;
|
||||
public bool PublicWrite { get; } = publicWrite;
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj == null) return false;
|
||||
if(obj is not ScriptVariableSyntax variable) return false;
|
||||
if (variable.Name != Name) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode() => Name.GetHashCode();
|
||||
}
|
||||
Reference in New Issue
Block a user