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:
@@ -270,5 +270,7 @@ namespace Microsoft.Iris.Render.Graphics
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal delegate void ContentReloadedHandler(Image image);
|
internal delegate void ContentReloadedHandler(Image image);
|
||||||
|
|
||||||
|
public override string ToString() => $"{{Image {Identifier} {Format} {Size}}}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Microsoft.Iris.Render
|
|||||||
|
|
||||||
public override int GetHashCode() => this.Width ^ this.Height;
|
public override int GetHashCode() => this.Width ^ this.Height;
|
||||||
|
|
||||||
public override string ToString() => base.ToString();
|
public override string ToString() => $"({Width} x {Height})";
|
||||||
|
|
||||||
public Point ToPoint() => new Point(this.Width, this.Height);
|
public Point ToPoint() => new Point(this.Width, this.Height);
|
||||||
|
|
||||||
|
|||||||
@@ -59,5 +59,7 @@ namespace Microsoft.Iris.Audio
|
|||||||
sound.Play();
|
sound.Play();
|
||||||
sound.UnregisterUsage(this);
|
sound.UnregisterUsage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString() => $"{{Sound {SystemSoundEvent} '{Source}'}}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||||
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Microsoft.Iris.Drawing
|
namespace Microsoft.Iris.Drawing
|
||||||
{
|
{
|
||||||
internal sealed class Font
|
internal sealed class Font
|
||||||
@@ -76,17 +74,6 @@ namespace Microsoft.Iris.Drawing
|
|||||||
|
|
||||||
public override int GetHashCode() => _fontName.GetHashCode() ^ _fontHeight.GetHashCode() ^ _altFontHeight.GetHashCode() ^ _fontStyle.GetHashCode();
|
public override int GetHashCode() => _fontName.GetHashCode() ^ _fontHeight.GetHashCode() ^ _altFontHeight.GetHashCode() ^ _fontStyle.GetHashCode();
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString() => $"{{Font \"{_fontName}\" {_fontHeight}pt {_fontStyle}}}";
|
||||||
{
|
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
stringBuilder.Append("{Font \"");
|
|
||||||
stringBuilder.Append(_fontName);
|
|
||||||
stringBuilder.Append("\" ");
|
|
||||||
stringBuilder.Append(_fontHeight);
|
|
||||||
stringBuilder.Append("pt ");
|
|
||||||
stringBuilder.Append(_fontStyle);
|
|
||||||
stringBuilder.Append("}");
|
|
||||||
return stringBuilder.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,5 +190,7 @@ namespace Microsoft.Iris.Drawing
|
|||||||
}
|
}
|
||||||
|
|
||||||
public event ContentLoadCompleteHandler LoadComplete;
|
public event ContentLoadCompleteHandler LoadComplete;
|
||||||
|
|
||||||
|
public override string ToString() => $"{{UIImage {RenderImage?.ToString() ?? "null"}}}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,5 +119,7 @@ namespace Microsoft.Iris.Drawing
|
|||||||
{
|
{
|
||||||
ScavengeImageCache.Instance.RemoveData(new ImageCacheKey(source, maximumSize, flippable, antialiasEdges));
|
ScavengeImageCache.Instance.RemoveData(new ImageCacheKey(source, maximumSize, flippable, antialiasEdges));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString() => $"{{UriImage '{Source}' {RenderImage?.ToString() ?? "null"}}}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ namespace Microsoft.Iris.Markup
|
|||||||
{
|
{
|
||||||
public abstract class EventSchema : DisposableObject
|
public abstract class EventSchema : DisposableObject
|
||||||
{
|
{
|
||||||
private TypeSchema _owner;
|
private readonly TypeSchema _owner;
|
||||||
public static EventSchema[] EmptyList = new EventSchema[0];
|
public readonly static EventSchema[] EmptyList = System.Array.Empty<EventSchema>();
|
||||||
|
|
||||||
public EventSchema(TypeSchema owner)
|
public EventSchema(TypeSchema owner)
|
||||||
{
|
{
|
||||||
@@ -22,5 +22,7 @@ namespace Microsoft.Iris.Markup
|
|||||||
public TypeSchema Owner => _owner;
|
public TypeSchema Owner => _owner;
|
||||||
|
|
||||||
public abstract string Name { get; }
|
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 abstract class PropertySchema : DisposableObject
|
||||||
{
|
{
|
||||||
public static PropertySchema[] EmptyList = new PropertySchema[0];
|
public readonly static PropertySchema[] EmptyList = System.Array.Empty<PropertySchema>();
|
||||||
private TypeSchema _owner;
|
private readonly TypeSchema _owner;
|
||||||
|
|
||||||
public PropertySchema(TypeSchema owner)
|
public PropertySchema(TypeSchema owner)
|
||||||
{
|
{
|
||||||
@@ -44,5 +44,7 @@ namespace Microsoft.Iris.Markup
|
|||||||
public abstract object GetValue(object instance);
|
public abstract object GetValue(object instance);
|
||||||
|
|
||||||
public abstract void SetValue(ref object instance, object value);
|
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 string Name;
|
||||||
public TypeSchema Type;
|
public TypeSchema Type;
|
||||||
public SymbolOrigin SymbolOrigin;
|
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 string Symbol => _symbol;
|
||||||
|
|
||||||
public SymbolOrigin Origin => _origin;
|
public SymbolOrigin Origin => _origin;
|
||||||
|
|
||||||
|
public override string ToString() => Symbol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ namespace Microsoft.Iris.Markup
|
|||||||
{
|
{
|
||||||
public abstract class TypeSchema : DisposableObject
|
public abstract class TypeSchema : DisposableObject
|
||||||
{
|
{
|
||||||
private LoadResult _owner;
|
private readonly LoadResult _owner;
|
||||||
private ulong _id;
|
private readonly ulong _id;
|
||||||
private Vector<TypeSchema> _equivalents;
|
private Vector<TypeSchema> _equivalents;
|
||||||
private static ulong s_uniqueId;
|
private static ulong s_uniqueId;
|
||||||
private static Map<ulong, TypeSchema> s_idToTypeSchema = new Map<ulong, TypeSchema>();
|
private readonly static Map<ulong, TypeSchema> s_idToTypeSchema = new();
|
||||||
public static TypeSchema[] EmptyList = new TypeSchema[0];
|
public readonly static TypeSchema[] EmptyList = Array.Empty<TypeSchema>();
|
||||||
|
|
||||||
public TypeSchema(LoadResult owner)
|
public TypeSchema(LoadResult owner)
|
||||||
{
|
{
|
||||||
@@ -232,7 +232,7 @@ namespace Microsoft.Iris.Markup
|
|||||||
|
|
||||||
public void ShareEquivalents(Vector<TypeSchema> equivalents) => _equivalents = equivalents;
|
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;
|
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);
|
s_idToTypeSchema.TryGetValue(id, out typeSchema);
|
||||||
return typeSchema;
|
return typeSchema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString() => $"typeof({Name})";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ namespace Microsoft.Iris.Markup
|
|||||||
{
|
{
|
||||||
internal class UIXTypeSchema : TypeSchema
|
internal class UIXTypeSchema : TypeSchema
|
||||||
{
|
{
|
||||||
private short _typeID;
|
private readonly short _typeID;
|
||||||
private short _baseTypeID;
|
private readonly short _baseTypeID;
|
||||||
private string _name;
|
private readonly string _name;
|
||||||
private string _alternateName;
|
private readonly string _alternateName;
|
||||||
private TypeSchema _baseType;
|
private TypeSchema _baseType;
|
||||||
private DefaultConstructHandler _defaultConstructor;
|
private DefaultConstructHandler _defaultConstructor;
|
||||||
private ConstructorSchema[] _constructors;
|
private ConstructorSchema[] _constructors;
|
||||||
@@ -28,9 +28,9 @@ namespace Microsoft.Iris.Markup
|
|||||||
private PerformOperationHandler _performOperation;
|
private PerformOperationHandler _performOperation;
|
||||||
private SupportsOperationHandler _supportsOperation;
|
private SupportsOperationHandler _supportsOperation;
|
||||||
private FindCanonicalInstanceHandler _findCanonicalInstance;
|
private FindCanonicalInstanceHandler _findCanonicalInstance;
|
||||||
private Type _instanceType;
|
private readonly Type _instanceType;
|
||||||
private UIXTypeFlags _flags;
|
private readonly UIXTypeFlags _flags;
|
||||||
private static object[] EmptyParameterList = new object[0];
|
private static readonly object[] EmptyParameterList = Array.Empty<object>();
|
||||||
|
|
||||||
public UIXTypeSchema(
|
public UIXTypeSchema(
|
||||||
short typeID,
|
short typeID,
|
||||||
|
|||||||
@@ -107,5 +107,7 @@ namespace Microsoft.Iris.ModelItems
|
|||||||
return;
|
return;
|
||||||
ContentsChanged(this, new UIListContentsChangedArgs(type, oldIndex, newIndex));
|
ContentsChanged(this, new UIListContentsChangedArgs(type, oldIndex, newIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString() => $"{{NotifyList Source=[{string.Join(", ", _source)}]}}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,6 @@ namespace Microsoft.Iris.ModelItems
|
|||||||
return intList;
|
return intList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() => string.Format("{{{0} to {1}}}", _begin, _end);
|
public override string ToString() => $"{{{_begin} to {_end}}}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1378,7 +1378,7 @@ namespace Microsoft.Iris.UI
|
|||||||
|
|
||||||
internal void SetEventContext(EventContext eventContext) => _eventContext = eventContext;
|
internal void SetEventContext(EventContext eventContext) => _eventContext = eventContext;
|
||||||
|
|
||||||
public override string ToString() => _typeSchema.ToString();
|
public override string ToString() => $"UI[{_typeSchema.Name}]";
|
||||||
|
|
||||||
private class SavedFocusState
|
private class SavedFocusState
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user