Add project files.

This commit is contained in:
Joshua Askharoun
2022-03-03 08:14:05 -06:00
parent cfa6f93211
commit 1198cc8a66
967 changed files with 118389 additions and 0 deletions
@@ -0,0 +1,10 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.ChildFaultedInDelegate
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal delegate void ChildFaultedInDelegate(ViewItem senderItem, ViewItem childItem);
}
+158
View File
@@ -0,0 +1,158 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.Class
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using Microsoft.Iris.Session;
using System.Collections.Generic;
using System.Diagnostics;
namespace Microsoft.Iris.UI
{
internal class Class :
DisposableObject,
INotifyObject,
IMarkupTypeBase,
IDisposableOwner,
ISchemaInfo
{
public const string ClassStateReservedSymbolName = "Class";
public const string ThisReservedSymbolName = "this";
private MarkupTypeSchema _typeSchema;
protected Dictionary<object, object> _storage;
private Vector<IDisposableObject> _disposables;
private MarkupListeners _listeners;
protected NotifyService _notifier = new NotifyService();
private ScriptRunScheduler _scriptRunScheduler = new ScriptRunScheduler();
private bool _scriptEnabled;
private static DeferredHandler s_executePendingScriptsHandler = new DeferredHandler(ExecutePendingScripts);
public Class(MarkupTypeSchema type)
{
_typeSchema = type;
_storage = new Dictionary<object, object>(type.TotalPropertiesAndLocalsCount);
_scriptEnabled = true;
}
protected override void OnDispose()
{
_typeSchema.RunFinalEvaluates(this);
base.OnDispose();
_scriptEnabled = false;
if (_listeners != null)
{
_listeners.Dispose(this);
_listeners = null;
}
_notifier.ClearListeners();
_storage.Clear();
if (_disposables == null)
return;
for (int index = 0; index < _disposables.Count; ++index)
_disposables[index].Dispose(this);
}
public void RegisterDisposable(IDisposableObject disposable)
{
if (_disposables == null)
_disposables = new Vector<IDisposableObject>();
_disposables.Add(disposable);
}
public bool UnregisterDisposable(ref IDisposableObject disposable)
{
if (_disposables != null)
{
int index = _disposables.IndexOf(disposable);
if (index != -1)
{
disposable = _disposables[index];
_disposables.RemoveAt(index);
return true;
}
}
return false;
}
public TypeSchema TypeSchema => _typeSchema;
public virtual void NotifyInitialized()
{
}
void INotifyObject.AddListener(Listener listener) => _notifier.AddListener(listener);
public virtual object ReadSymbol(SymbolReference symbolRef)
{
object obj = null;
switch (symbolRef.Origin)
{
case SymbolOrigin.Properties:
case SymbolOrigin.Locals:
obj = _storage[symbolRef.Symbol];
break;
case SymbolOrigin.Reserved:
if (symbolRef.Symbol == nameof(Class) || symbolRef.Symbol == "this")
{
obj = this;
break;
}
break;
}
return obj;
}
public virtual void WriteSymbol(SymbolReference symbolRef, object value) => SetProperty(symbolRef.Symbol, value);
public virtual object GetProperty(string name) => _storage[name];
public virtual void SetProperty(string name, object value)
{
if (_storage.ContainsKey(name) && Utility.IsEqual(_storage[name], value))
return;
_storage[name] = value;
_notifier.Fire(name);
}
public MarkupListeners Listeners
{
get => _listeners;
set => _listeners = value;
}
public Dictionary<object, object> Storage => _storage;
public void ScheduleScriptRun(uint scriptId, bool ignoreErrors)
{
if (!_scriptRunScheduler.Pending)
DeferredCall.Post(DispatchPriority.Script, s_executePendingScriptsHandler, this);
_scriptRunScheduler.ScheduleRun(scriptId, ignoreErrors);
}
private static void ExecutePendingScripts(object args)
{
Class @class = (Class)args;
@class._scriptRunScheduler.Execute(@class);
}
public object RunScript(uint scriptId, bool ignoreErrors, ParameterContext parameterContext) => _typeSchema.Run(this, scriptId, ignoreErrors, parameterContext);
public void NotifyScriptErrors()
{
_scriptEnabled = false;
ErrorManager.ReportWarning("Script runtime failure: Scripting has been disabled for '{0}' due to runtime scripting errors", _typeSchema.Name);
}
public bool ScriptEnabled => _scriptEnabled;
public override string ToString() => _typeSchema.ToString();
[Conditional("DEBUG")]
public void DEBUG_MarkInitialized()
{
}
}
}
+15
View File
@@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.ColorScheme
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal enum ColorScheme
{
Default,
HighContrast1,
HighContrast2,
}
}
+158
View File
@@ -0,0 +1,158 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.EffectClass
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Animations;
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using Microsoft.Iris.Render;
using Microsoft.Iris.Session;
using System;
namespace Microsoft.Iris.UI
{
internal class EffectClass : Class
{
private IEffectTemplate _effectTemplate;
private Map<string, EffectValue> _properties;
private Vector<EffectClass.EffectAndOwner> _effectsInUse = new Vector<EffectClass.EffectAndOwner>();
private Vector<ActiveSequence> _activeAnimations;
public EffectClass(MarkupTypeSchema type, IEffectTemplate effectTemplate)
: base(type)
=> _effectTemplate = effectTemplate;
protected override void OnDispose()
{
base.OnDispose();
if (_activeAnimations != null)
{
foreach (DisposableObject activeAnimation in _activeAnimations)
activeAnimation.Dispose(this);
_activeAnimations.Clear();
}
foreach (EffectClass.EffectAndOwner effectAndOwner in _effectsInUse)
effectAndOwner.Effect.UnregisterUsage(this);
_effectsInUse.Clear();
}
public string DefaultImageElement => ((EffectClassTypeSchema)TypeSchema).DefaultElementSymbol;
public IEffect CreateRenderEffect(object owner)
{
IEffect effect = null;
if (_effectTemplate != null && _effectTemplate.IsBuilt)
{
effect = _effectTemplate.CreateInstance(this);
_effectsInUse.Add(new EffectClass.EffectAndOwner(effect, owner));
effect.RegisterUsage(owner);
}
if (effect != null && _properties != null)
{
foreach (KeyValueEntry<string, EffectValue> property in _properties)
property.Value.SetValueOnEffect(effect, property.Key);
}
return effect;
}
public static IEffect CreateImageRenderEffectWithFallback(
EffectClass effect,
object owner,
IImage initialImage)
{
IEffect effect1 = null;
if (effect != null)
{
effect1 = effect.CreateRenderEffect(owner);
if (effect1 != null && effect.DefaultImageElement != null)
{
string stPropertyName = EffectElementWrapper.MakeEffectPropertyName(effect.DefaultImageElement, "Image");
effect1.SetProperty(stPropertyName, initialImage);
}
}
if (effect1 == null)
effect1 = EffectManager.CreateBasicImageEffect(owner, initialImage);
return effect1;
}
public void DoneWithRenderEffects(object owner)
{
if (IsDisposed)
return;
for (int index = _effectsInUse.Count - 1; index >= 0; --index)
{
if (_effectsInUse[index].Owner == owner)
{
_effectsInUse[index].Effect.UnregisterUsage(this);
_effectsInUse.RemoveAt(index);
}
}
}
public static void SetDefaultEffectProperty(
EffectClass effect,
IEffect effectInstance,
IImage image)
{
string stPropertyName = null;
if (effect != null && effect._effectTemplate == effectInstance.Template)
{
if (effect.DefaultImageElement != null)
stPropertyName = EffectElementWrapper.MakeEffectPropertyName(effect.DefaultImageElement, "Image");
}
else
stPropertyName = "ImageElem.Image";
if (stPropertyName == null)
return;
effectInstance.SetProperty(stPropertyName, image);
}
public void SetRenderEffectProperty(string property, EffectValue value)
{
if (_properties == null)
_properties = new Map<string, EffectValue>();
_properties[property] = value;
foreach (EffectClass.EffectAndOwner effectAndOwner in _effectsInUse)
value.SetValueOnEffect(effectAndOwner.Effect, property);
}
public void PlayAnimation(string property, EffectAnimation animation)
{
if (_activeAnimations == null)
_activeAnimations = new Vector<ActiveSequence>();
foreach (EffectClass.EffectAndOwner effectAndOwner in _effectsInUse)
{
AnimationArgs args = new AnimationArgs();
ActiveSequence instance = animation.CreateInstance(effectAndOwner.Effect, property, ref args);
instance?.Play();
instance.DeclareOwner(this);
instance.AnimationCompleted += new EventHandler(OnAnimationComplete);
_activeAnimations.Add(instance);
}
}
private void OnAnimationComplete(object sender, EventArgs args)
{
ActiveSequence activeSequence = (ActiveSequence)sender;
activeSequence.AnimationCompleted -= new EventHandler(OnAnimationComplete);
_activeAnimations.Remove(activeSequence);
activeSequence.Dispose(this);
}
public override object ReadSymbol(SymbolReference symbolRef) => symbolRef.Origin == SymbolOrigin.Techniques ? new EffectElementWrapper(this, symbolRef.Symbol) : base.ReadSymbol(symbolRef);
private struct EffectAndOwner
{
public IEffect Effect;
public object Owner;
public EffectAndOwner(IEffect effect, object owner)
{
Effect = effect;
Owner = owner;
}
}
}
}
@@ -0,0 +1,86 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.EffectElementWrapper
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Animations;
using Microsoft.Iris.Drawing;
using Microsoft.Iris.Render;
using Microsoft.Iris.RenderAPI.VideoPlayback;
namespace Microsoft.Iris.UI
{
internal class EffectElementWrapper
{
private EffectClass _class;
private string _elementName;
private static Map<int, string> s_propertyMap;
public EffectElementWrapper(EffectClass cls, string elementName)
{
_class = cls;
_elementName = elementName;
}
public void SetProperty(string propertyName, int value) => _class.SetRenderEffectProperty(MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Int));
public void SetProperty(string propertyName, float value) => _class.SetRenderEffectProperty(MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Float));
public void SetProperty(string propertyName, UIImage value) => _class.SetRenderEffectProperty(MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.UIImage));
public void SetProperty(string propertyName, IUIVideoStream value) => _class.SetRenderEffectProperty(MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.IUIVideoStream));
public void SetProperty(string propertyName, Color value) => _class.SetRenderEffectProperty(MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Color));
public void SetProperty(string propertyName, Vector2 value) => _class.SetRenderEffectProperty(MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Vector2));
public void SetProperty(string propertyName, Vector3 value) => _class.SetRenderEffectProperty(MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Vector3));
public void PlayAnimation(EffectProperty property, EffectAnimation animation) => _class.PlayAnimation(MakeEffectPropertyName(property), animation);
private string MakeEffectPropertyName(string propertyName) => MakeEffectPropertyName(_elementName, propertyName);
private string MakeEffectPropertyName(EffectProperty property) => MakeEffectPropertyName(_elementName, property);
public static string MakeEffectPropertyName(string elementName, EffectProperty property)
{
EnsurePropertyMap();
return MakeEffectPropertyName(elementName, s_propertyMap[(int)property]);
}
public static string MakeEffectPropertyName(string elementName, string propertyName) => elementName + "." + propertyName;
private static void EnsurePropertyMap()
{
if (s_propertyMap != null)
return;
s_propertyMap = new Map<int, string>();
s_propertyMap[2] = "Attenuation";
s_propertyMap[3] = "Brightness";
s_propertyMap[4] = "Color";
s_propertyMap[14] = "InnerConeAngle";
s_propertyMap[18] = "OuterConeAngle";
s_propertyMap[5] = "Contrast";
s_propertyMap[6] = "DarkColor";
s_propertyMap[7] = "Decay";
s_propertyMap[8] = "Density";
s_propertyMap[9] = "Desaturate";
s_propertyMap[10] = "DirectionAngle";
s_propertyMap[11] = "EdgeLimit";
s_propertyMap[12] = "FallOff";
s_propertyMap[13] = "Hue";
s_propertyMap[15] = "Intensity";
s_propertyMap[16] = "LightColor";
s_propertyMap[1] = "AmbientColor";
s_propertyMap[17] = "Lightness";
s_propertyMap[19] = "Position";
s_propertyMap[20] = "Radius";
s_propertyMap[21] = "Saturation";
s_propertyMap[22] = "Tone";
s_propertyMap[23] = "Weight";
s_propertyMap[24] = "Value";
s_propertyMap[25] = "Downsample";
}
}
}
+39
View File
@@ -0,0 +1,39 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.EffectProperty
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal enum EffectProperty
{
None,
AmbientColor,
Attenuation,
Brightness,
Color,
Contrast,
DarkColor,
Decay,
Density,
Desaturate,
DirectionAngle,
EdgeLimit,
FallOff,
Hue,
InnerConeAngle,
Intensity,
LightColor,
Lightness,
OuterConeAngle,
Position,
Radius,
Saturation,
Tone,
Weight,
Value,
Downsample,
UVOffset,
}
}
+57
View File
@@ -0,0 +1,57 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.EffectValue
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Drawing;
using Microsoft.Iris.Render;
namespace Microsoft.Iris.UI
{
internal struct EffectValue
{
private object _value;
private EffectValueType _type;
public EffectValue(object value, EffectValueType type)
{
_value = value;
_type = type;
}
public void SetValueOnEffect(IEffect effect, string property) => SetValueOnEffect(effect, property, _value, _type);
public static void SetValueOnEffect(
IEffect effect,
string property,
object value,
EffectValueType type)
{
switch (type)
{
case EffectValueType.Int:
effect.SetProperty(property, (int)value);
break;
case EffectValueType.Float:
effect.SetProperty(property, (float)value);
break;
case EffectValueType.UIImage:
IImage renderImage = ((UIImage)value)?.RenderImage;
effect.SetProperty(property, renderImage);
break;
case EffectValueType.IUIVideoStream:
if (!(value is Microsoft.Iris.VideoStream videoStream))
break;
effect.SetProperty(property, videoStream.RenderStream);
break;
case EffectValueType.Color:
effect.SetProperty(property, ((Color)value).RenderConvert());
break;
case EffectValueType.Vector3:
effect.SetProperty(property, (Vector3)value);
break;
}
}
}
}
+19
View File
@@ -0,0 +1,19 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.EffectValueType
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal enum EffectValueType
{
Int,
Float,
UIImage,
IUIVideoStream,
Color,
Vector3,
Vector2,
}
}
+84
View File
@@ -0,0 +1,84 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.Environment
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using Microsoft.Iris.OS;
using Microsoft.Iris.Render;
using Microsoft.Iris.Session;
using System;
namespace Microsoft.Iris.UI
{
internal sealed class Environment : NotifyObjectBase
{
private bool _mouseActiveFlag;
private bool _soundEffectsEnabledFlag;
private ColorScheme _currentColorScheme;
private static Environment s_instance;
private static float s_dpiScale = Math.Max(1f, NativeApi.SpGetDpi() / 96f);
private Environment() => _soundEffectsEnabledFlag = true;
public static Environment Instance
{
get
{
if (s_instance == null)
s_instance = new Environment();
return s_instance;
}
}
public bool IsMouseActive => _mouseActiveFlag;
public void SetIsMouseActive(bool value)
{
if (_mouseActiveFlag == value)
return;
_mouseActiveFlag = value;
}
public bool IsRightToLeft => UISession.Default.IsRtl;
public ColorScheme ColorScheme => _currentColorScheme;
public void SetColorScheme(ColorScheme value)
{
if (_currentColorScheme == value)
return;
_currentColorScheme = value;
FireNotification(NotificationID.ColorScheme);
}
public bool SoundEffectsEnabled => _soundEffectsEnabledFlag;
public void SetSoundEffectsEnabled(bool value)
{
if (_soundEffectsEnabledFlag == value)
return;
_soundEffectsEnabledFlag = value;
}
public static float DpiScale => s_dpiScale;
public float AnimationSpeed
{
get => AnimationSystem.SpeedAdjustment;
set => AnimationSystem.SpeedAdjustment = value;
}
public int AnimationUpdatesPerSecond
{
get => AnimationSystem.UpdatesPerSecond;
set => AnimationSystem.UpdatesPerSecond = value;
}
private IAnimationSystem AnimationSystem => UISession.Default.RenderSession.AnimationSystem;
public void AnimationAdvance(int milliseconds) => AnimationSystem.PulseTimeAdvance(milliseconds);
}
}
+15
View File
@@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.FindChildResult
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal enum FindChildResult
{
Success,
Failure,
PotentiallyFaultIn,
}
}
@@ -0,0 +1,13 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.FocusStateHandler
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal delegate void FocusStateHandler(
UIClass updateUI,
bool deepFocusFlag,
bool directFocusFlag);
}
@@ -0,0 +1,12 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.FormCloseRequestedHandler
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Render;
namespace Microsoft.Iris.UI
{
internal delegate void FormCloseRequestedHandler(FormCloseReason nReason, ref bool block);
}
@@ -0,0 +1,10 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.FormPropertyChangedHandler
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal delegate void FormPropertyChangedHandler(string notificationID);
}
@@ -0,0 +1,12 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.InputEventHandler
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Input;
namespace Microsoft.Iris.UI
{
internal delegate void InputEventHandler(UIClass sender, InputInfo info);
}
+336
View File
@@ -0,0 +1,336 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.InputHandler
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Input;
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using Microsoft.Iris.Session;
using System;
namespace Microsoft.Iris.UI
{
internal abstract class InputHandler : DisposableNotifyObjectBase
{
private InputHandlerStage _handlerStage;
private UIClass _ui;
private bool _disabled;
private string _name;
public InputHandler() => _handlerStage = InputHandlerStage.Direct;
public InputHandlerStage HandlerStage
{
get => _handlerStage;
set
{
if (_handlerStage == value)
return;
_handlerStage = value;
FireNotification(NotificationID.HandlerStage);
}
}
protected bool HandleDirect => (HandlerStage & InputHandlerStage.Direct) == InputHandlerStage.Direct;
protected bool HandleRouted => (HandlerStage & InputHandlerStage.Routed) == InputHandlerStage.Routed;
protected bool HandleBubbled => (HandlerStage & InputHandlerStage.Bubbled) == InputHandlerStage.Bubbled;
private bool ShouldHandleStage(EventRouteStages stage)
{
switch (stage)
{
case EventRouteStages.Direct:
return HandleDirect;
case EventRouteStages.Bubbled:
return HandleBubbled;
case EventRouteStages.Routed:
return HandleRouted;
default:
return false;
}
}
protected override void OnDispose()
{
base.OnDispose();
_ui = null;
}
protected override void OnOwnerDeclared(object owner)
{
base.OnOwnerDeclared(owner);
_ui = (UIClass)owner;
}
public void NotifyUIInitialized() => ConfigureInteractivity();
protected virtual void ConfigureInteractivity()
{
}
public virtual void OnZoneAttached()
{
}
public virtual void OnZoneDetached()
{
}
public bool Enabled
{
get => !_disabled;
set
{
if (Enabled == value)
return;
_disabled = !value;
FireNotification(NotificationID.Enabled);
_ui.UpdateCursor();
}
}
public string Name
{
get => _name;
set => _name = NotifyService.CanonicalizeString(value);
}
public void DeliverInput(UIClass ui, InputInfo info, EventRouteStages stage)
{
if (!Enabled || !ShouldHandleStage(stage))
return;
switch (info.EventType)
{
case InputEventType.CommandDown:
OnCommandDown(ui, (KeyCommandInfo)info);
break;
case InputEventType.CommandUp:
OnCommandUp(ui, (KeyCommandInfo)info);
break;
case InputEventType.GainKeyFocus:
OnGainKeyFocus(ui, (KeyFocusInfo)info);
break;
case InputEventType.LoseKeyFocus:
OnLoseKeyFocus(ui, (KeyFocusInfo)info);
break;
case InputEventType.KeyDown:
OnKeyDown(ui, (KeyStateInfo)info);
break;
case InputEventType.KeyUp:
OnKeyUp(ui, (KeyStateInfo)info);
break;
case InputEventType.KeyCharacter:
OnKeyCharacter(ui, (KeyCharacterInfo)info);
break;
case InputEventType.MouseMove:
OnMouseMove(ui, (MouseMoveInfo)info);
break;
case InputEventType.GainMouseFocus:
OnGainMouseFocus(ui, (MouseFocusInfo)info);
break;
case InputEventType.LoseMouseFocus:
OnLoseMouseFocus(ui, (MouseFocusInfo)info);
break;
case InputEventType.MousePrimaryDown:
OnMousePrimaryDown(ui, (MouseButtonInfo)info);
break;
case InputEventType.MouseSecondaryDown:
OnMouseSecondaryDown(ui, (MouseButtonInfo)info);
break;
case InputEventType.MousePrimaryUp:
OnMousePrimaryUp(ui, (MouseButtonInfo)info);
break;
case InputEventType.MouseSecondaryUp:
OnMouseSecondaryUp(ui, (MouseButtonInfo)info);
break;
case InputEventType.MouseDoubleClick:
OnMouseDoubleClick(ui, (MouseButtonInfo)info);
break;
case InputEventType.MouseWheel:
OnMouseWheel(ui, (MouseWheelInfo)info);
break;
case InputEventType.DragEnter:
OnDragEnter(ui, (DragDropInfo)info);
break;
case InputEventType.DragOver:
OnDragOver(ui, (DragDropInfo)info);
break;
case InputEventType.DragLeave:
OnDragLeave(ui, (DragDropInfo)info);
break;
case InputEventType.DragDropped:
OnDropped(ui, (DragDropInfo)info);
break;
case InputEventType.DragComplete:
OnDragComplete(ui, (DragDropInfo)info);
break;
}
}
protected virtual void OnMousePrimaryDown(UIClass ui, MouseButtonInfo info)
{
}
protected virtual void OnMouseSecondaryDown(UIClass ui, MouseButtonInfo info)
{
}
protected virtual void OnMousePrimaryUp(UIClass ui, MouseButtonInfo info)
{
}
protected virtual void OnMouseSecondaryUp(UIClass ui, MouseButtonInfo info)
{
}
protected virtual void OnMouseDoubleClick(UIClass ui, MouseButtonInfo info)
{
}
protected virtual void OnMouseMove(UIClass ui, MouseMoveInfo info)
{
}
protected virtual void OnLoseMouseFocus(UIClass ui, MouseFocusInfo info)
{
}
protected virtual void OnGainMouseFocus(UIClass ui, MouseFocusInfo info)
{
}
protected virtual void OnMouseWheel(UIClass ui, MouseWheelInfo info)
{
}
protected virtual void OnDragEnter(UIClass ui, DragDropInfo info)
{
}
protected virtual void OnDragOver(UIClass ui, DragDropInfo info)
{
}
protected virtual void OnDragLeave(UIClass ui, DragDropInfo info)
{
}
protected virtual void OnDropped(UIClass ui, DragDropInfo info)
{
}
protected virtual void OnDragComplete(UIClass ui, DragDropInfo info)
{
}
protected virtual void OnKeyDown(UIClass ui, KeyStateInfo info)
{
}
protected virtual void OnKeyUp(UIClass ui, KeyStateInfo info)
{
}
protected virtual void OnKeyCharacter(UIClass ui, KeyCharacterInfo info)
{
}
protected virtual void OnLoseKeyFocus(UIClass ui, KeyFocusInfo info)
{
}
protected virtual void OnGainKeyFocus(UIClass ui, KeyFocusInfo info)
{
}
protected virtual void OnLoseDeepKeyFocus()
{
}
protected virtual void OnGainDeepKeyFocus()
{
}
protected virtual void OnCommandDown(UIClass ui, KeyCommandInfo info)
{
}
protected virtual void OnCommandUp(UIClass ui, KeyCommandInfo info)
{
}
internal void NotifyLoseDeepKeyFocus() => OnLoseDeepKeyFocus();
internal void NotifyGainDeepKeyFocus() => OnGainDeepKeyFocus();
internal virtual CursorID GetCursor() => CursorID.NotSpecified;
protected void UpdateCursor()
{
if (_ui == null)
return;
_ui.UpdateCursor();
}
public static InputHandlerModifiers GetModifiers(
InputModifiers rawModifiers)
{
InputHandlerModifiers handlerModifiers = InputHandlerModifiers.None;
if ((rawModifiers & InputModifiers.ControlKey) != InputModifiers.None)
handlerModifiers |= InputHandlerModifiers.Ctrl;
if ((rawModifiers & InputModifiers.ShiftKey) != InputModifiers.None)
handlerModifiers |= InputHandlerModifiers.Shift;
if ((rawModifiers & InputModifiers.AltKey) != InputModifiers.None)
handlerModifiers |= InputHandlerModifiers.Alt;
if ((rawModifiers & InputModifiers.WindowsKey) != InputModifiers.None)
handlerModifiers |= InputHandlerModifiers.Windows;
return handlerModifiers;
}
protected void SetEventContext(
ICookedInputSite source,
ref WeakReference context,
string contextName)
{
object obj = context != null ? context.Target : null;
object eventContext = GetEventContext(source);
if (eventContext == obj)
return;
context = new WeakReference(eventContext);
FireNotification(contextName);
}
protected object CheckEventContext(ref WeakReference context)
{
object obj = null;
if (context != null)
{
obj = context.Target;
if (obj is IDisposableObject disposableObject && disposableObject.IsDisposed)
{
context = null;
obj = null;
}
}
return obj;
}
protected object GetEventContext(ICookedInputSite clickTarget)
{
if (!(clickTarget is UIClass uiClass) || !uiClass.IsValid)
return null;
object eventContext;
for (eventContext = uiClass.GetEventContext(); eventContext == null && uiClass != UI; eventContext = uiClass.GetEventContext())
uiClass = uiClass.Parent;
return eventContext;
}
public override string ToString() => GetType().Name;
protected UIClass UI => _ui;
}
}
+17
View File
@@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.InputHandlerList
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using System.Collections;
using System.Collections.Generic;
namespace Microsoft.Iris.UI
{
internal class InputHandlerList : List<InputHandler>
{
public StackIListReverseEnumerator GetEnumerator() => new StackIListReverseEnumerator(this);
}
}
@@ -0,0 +1,21 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.InputHandlerModifiers
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System;
namespace Microsoft.Iris.UI
{
[Flags]
internal enum InputHandlerModifiers
{
None = 0,
Ctrl = 1,
Shift = 2,
Alt = 4,
Windows = 8,
All = Windows | Alt | Shift | Ctrl, // 0x0000000F
}
}
@@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.InputHandlerStage
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System;
namespace Microsoft.Iris.UI
{
[Flags]
internal enum InputHandlerStage
{
Routed = 1,
Direct = 2,
Bubbled = 4,
}
}
@@ -0,0 +1,14 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.InputHandlerTransition
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.UI
{
internal enum InputHandlerTransition
{
Down,
Up,
}
}
+36
View File
@@ -0,0 +1,36 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.UI.RootLoadResult
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Markup;
namespace Microsoft.Iris.UI
{
internal class RootLoadResult : MarkupLoadResult
{
public UIClassTypeSchema RootType;
public RootLoadResult(string name)
: base(name)
=> RootType = new UIClassTypeSchema(this, name);
protected override void OnDispose()
{
base.OnDispose();
RootType.Dispose(this);
RootType = null;
}
public override TypeSchema FindType(string name) => (TypeSchema)null;
public override LoadResultStatus Status => LoadResultStatus.Success;
public override bool IsSource => true;
public override MarkupConstantsTable ConstantsTable => (MarkupConstantsTable)null;
public override MarkupImportTables ImportTables => (MarkupImportTables)null;
}
}

Some files were not shown because too many files have changed in this diff Show More