mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Override ToString on more UIX classes
This commit is contained in:
@@ -10,8 +10,8 @@ namespace Microsoft.Iris.Markup
|
||||
{
|
||||
public abstract class EventSchema : DisposableObject
|
||||
{
|
||||
private TypeSchema _owner;
|
||||
public static EventSchema[] EmptyList = new EventSchema[0];
|
||||
private readonly TypeSchema _owner;
|
||||
public readonly static EventSchema[] EmptyList = System.Array.Empty<EventSchema>();
|
||||
|
||||
public EventSchema(TypeSchema owner)
|
||||
{
|
||||
@@ -22,5 +22,7 @@ namespace Microsoft.Iris.Markup
|
||||
public TypeSchema Owner => _owner;
|
||||
|
||||
public abstract string Name { get; }
|
||||
|
||||
public override string ToString() => $"{_owner.Name}.{Name}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace Microsoft.Iris.Markup
|
||||
{
|
||||
public abstract class PropertySchema : DisposableObject
|
||||
{
|
||||
public static PropertySchema[] EmptyList = new PropertySchema[0];
|
||||
private TypeSchema _owner;
|
||||
public readonly static PropertySchema[] EmptyList = System.Array.Empty<PropertySchema>();
|
||||
private readonly TypeSchema _owner;
|
||||
|
||||
public PropertySchema(TypeSchema owner)
|
||||
{
|
||||
@@ -44,5 +44,7 @@ namespace Microsoft.Iris.Markup
|
||||
public abstract object GetValue(object instance);
|
||||
|
||||
public abstract void SetValue(ref object instance, object value);
|
||||
|
||||
public override string ToString() => $"{Owner.Name}.{Name}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace Microsoft.Iris.Markup
|
||||
public string Name;
|
||||
public TypeSchema Type;
|
||||
public SymbolOrigin SymbolOrigin;
|
||||
public static SymbolRecord[] EmptyList = new SymbolRecord[0];
|
||||
public readonly static SymbolRecord[] EmptyList = System.Array.Empty<SymbolRecord>();
|
||||
|
||||
public override string ToString() => $"{Type} {Name}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,5 +20,7 @@ namespace Microsoft.Iris.Markup
|
||||
public string Symbol => _symbol;
|
||||
|
||||
public SymbolOrigin Origin => _origin;
|
||||
|
||||
public override string ToString() => Symbol;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace Microsoft.Iris.Markup
|
||||
{
|
||||
public abstract class TypeSchema : DisposableObject
|
||||
{
|
||||
private LoadResult _owner;
|
||||
private ulong _id;
|
||||
private readonly LoadResult _owner;
|
||||
private readonly ulong _id;
|
||||
private Vector<TypeSchema> _equivalents;
|
||||
private static ulong s_uniqueId;
|
||||
private static Map<ulong, TypeSchema> s_idToTypeSchema = new Map<ulong, TypeSchema>();
|
||||
public static TypeSchema[] EmptyList = new TypeSchema[0];
|
||||
private readonly static Map<ulong, TypeSchema> s_idToTypeSchema = new();
|
||||
public readonly static TypeSchema[] EmptyList = Array.Empty<TypeSchema>();
|
||||
|
||||
public TypeSchema(LoadResult owner)
|
||||
{
|
||||
@@ -232,7 +232,7 @@ namespace Microsoft.Iris.Markup
|
||||
|
||||
public void ShareEquivalents(Vector<TypeSchema> equivalents) => _equivalents = equivalents;
|
||||
|
||||
public virtual string ErrorContextDescription => string.Format("{0} (Owner='{1}')", Name, Owner.Uri ?? "Unavailable");
|
||||
public virtual string ErrorContextDescription => $"{Name} (Owner='{Owner.Uri ?? "Unavailable"}')";
|
||||
|
||||
public static string NameFromInstance(object instance) => !(instance is ISchemaInfo schemaInfo) ? instance.GetType().Name : schemaInfo.TypeSchema.Name;
|
||||
|
||||
@@ -244,5 +244,7 @@ namespace Microsoft.Iris.Markup
|
||||
s_idToTypeSchema.TryGetValue(id, out typeSchema);
|
||||
return typeSchema;
|
||||
}
|
||||
|
||||
public override string ToString() => $"typeof({Name})";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace Microsoft.Iris.Markup
|
||||
{
|
||||
internal class UIXTypeSchema : TypeSchema
|
||||
{
|
||||
private short _typeID;
|
||||
private short _baseTypeID;
|
||||
private string _name;
|
||||
private string _alternateName;
|
||||
private readonly short _typeID;
|
||||
private readonly short _baseTypeID;
|
||||
private readonly string _name;
|
||||
private readonly string _alternateName;
|
||||
private TypeSchema _baseType;
|
||||
private DefaultConstructHandler _defaultConstructor;
|
||||
private ConstructorSchema[] _constructors;
|
||||
@@ -28,9 +28,9 @@ namespace Microsoft.Iris.Markup
|
||||
private PerformOperationHandler _performOperation;
|
||||
private SupportsOperationHandler _supportsOperation;
|
||||
private FindCanonicalInstanceHandler _findCanonicalInstance;
|
||||
private Type _instanceType;
|
||||
private UIXTypeFlags _flags;
|
||||
private static object[] EmptyParameterList = new object[0];
|
||||
private readonly Type _instanceType;
|
||||
private readonly UIXTypeFlags _flags;
|
||||
private static readonly object[] EmptyParameterList = Array.Empty<object>();
|
||||
|
||||
public UIXTypeSchema(
|
||||
short typeID,
|
||||
|
||||
Reference in New Issue
Block a user