mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Add project files.
This commit is contained in:
@@ -0,0 +1,200 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.DeferredCall
|
||||
// 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.Queues;
|
||||
using Microsoft.Iris.Render;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace Microsoft.Iris.Session
|
||||
{
|
||||
internal sealed class DeferredCall : QueueItem
|
||||
{
|
||||
private const int c_maxCacheCount = 100;
|
||||
private DeferredCall.CallType _callType;
|
||||
private Delegate _target;
|
||||
private object _param;
|
||||
private EventArgs _args;
|
||||
private static DeferredCall s_cachedList = null;
|
||||
private static int s_cachedCount = 0;
|
||||
private static object s_cacheLock = new object();
|
||||
|
||||
private DeferredCall()
|
||||
{
|
||||
}
|
||||
|
||||
private static DeferredCall AllocateFromCache()
|
||||
{
|
||||
DeferredCall deferredCall = null;
|
||||
lock (s_cacheLock)
|
||||
{
|
||||
if (s_cachedList != null)
|
||||
{
|
||||
deferredCall = s_cachedList;
|
||||
s_cachedList = (DeferredCall)deferredCall._next;
|
||||
deferredCall._next = null;
|
||||
--s_cachedCount;
|
||||
}
|
||||
}
|
||||
if (deferredCall == null)
|
||||
deferredCall = new DeferredCall();
|
||||
return deferredCall;
|
||||
}
|
||||
|
||||
public static DeferredCall Create(SimpleCallback callback)
|
||||
{
|
||||
DeferredCall deferredCall = AllocateFromCache();
|
||||
deferredCall._callType = CallType.Simple;
|
||||
deferredCall._target = callback;
|
||||
return deferredCall;
|
||||
}
|
||||
|
||||
public static DeferredCall Create(DeferredHandler handler, object param)
|
||||
{
|
||||
DeferredCall deferredCall = AllocateFromCache();
|
||||
deferredCall._callType = CallType.OneParam;
|
||||
deferredCall._target = handler;
|
||||
deferredCall._param = param;
|
||||
return deferredCall;
|
||||
}
|
||||
|
||||
public static DeferredCall Create(
|
||||
EventHandler handler,
|
||||
object sender,
|
||||
EventArgs args)
|
||||
{
|
||||
DeferredCall deferredCall = AllocateFromCache();
|
||||
deferredCall._callType = CallType.Event;
|
||||
deferredCall._target = handler;
|
||||
deferredCall._param = sender;
|
||||
deferredCall._args = args;
|
||||
return deferredCall;
|
||||
}
|
||||
|
||||
public static DeferredCall Create(IDeferredInvokeItem item)
|
||||
{
|
||||
DeferredCall deferredCall = AllocateFromCache();
|
||||
deferredCall._callType = CallType.RenderItem;
|
||||
deferredCall._param = item;
|
||||
return deferredCall;
|
||||
}
|
||||
|
||||
public override void Dispatch()
|
||||
{
|
||||
switch (_callType)
|
||||
{
|
||||
case CallType.Simple:
|
||||
((SimpleCallback)_target)();
|
||||
break;
|
||||
case CallType.OneParam:
|
||||
((DeferredHandler)_target)(_param);
|
||||
break;
|
||||
case CallType.Event:
|
||||
((EventHandler)_target)(_param, _args);
|
||||
break;
|
||||
case CallType.RenderItem:
|
||||
((IDeferredInvokeItem)_param).Dispatch();
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
_callType = CallType.None;
|
||||
_target = null;
|
||||
_param = null;
|
||||
_args = null;
|
||||
_prev = null;
|
||||
_next = null;
|
||||
_owner = null;
|
||||
lock (s_cacheLock)
|
||||
{
|
||||
if (s_cachedCount >= 100)
|
||||
return;
|
||||
_next = s_cachedList;
|
||||
s_cachedList = this;
|
||||
++s_cachedCount;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Post(DispatchPriority priority, SimpleCallback callback)
|
||||
{
|
||||
QueueItem queueItem = Create(callback);
|
||||
UIDispatcher.Post(priority, queueItem);
|
||||
}
|
||||
|
||||
public static void Post(Thread thread, DispatchPriority priority, SimpleCallback callback)
|
||||
{
|
||||
QueueItem queueItem = Create(callback);
|
||||
UIDispatcher.Post(thread, priority, queueItem);
|
||||
}
|
||||
|
||||
public static void Post(DispatchPriority priority, DeferredHandler handler)
|
||||
{
|
||||
QueueItem queueItem = Create(handler, null);
|
||||
UIDispatcher.Post(priority, queueItem);
|
||||
}
|
||||
|
||||
public static void Post(DispatchPriority priority, DeferredHandler handler, object param)
|
||||
{
|
||||
QueueItem queueItem = Create(handler, param);
|
||||
UIDispatcher.Post(priority, queueItem);
|
||||
}
|
||||
|
||||
public static void Post(TimeSpan delay, DeferredHandler handler, object param)
|
||||
{
|
||||
QueueItem queueItem = Create(handler, param);
|
||||
UIDispatcher.Post(delay, queueItem);
|
||||
}
|
||||
|
||||
public static void Post(
|
||||
Thread thread,
|
||||
DispatchPriority priority,
|
||||
DeferredHandler handler,
|
||||
object param)
|
||||
{
|
||||
QueueItem queueItem = Create(handler, param);
|
||||
UIDispatcher.Post(thread, priority, queueItem);
|
||||
}
|
||||
|
||||
public override string ToDebugPacketString()
|
||||
{
|
||||
string packetString = string.Empty; ;
|
||||
switch (_callType)
|
||||
{
|
||||
case CallType.Simple:
|
||||
var simpleCallback = (SimpleCallback)_target;
|
||||
packetString = simpleCallback.Target.ToString() + "." + simpleCallback.Method.Name;
|
||||
break;
|
||||
case CallType.OneParam:
|
||||
var deferredHandler = (DeferredHandler)_target;
|
||||
string targetStr = deferredHandler.Target?.ToString();
|
||||
if (!string.IsNullOrEmpty(targetStr))
|
||||
packetString += targetStr + ".";
|
||||
packetString += $"{deferredHandler.Method.Name}({_param})";
|
||||
break;
|
||||
case CallType.Event:
|
||||
var eventHandler = (EventHandler)_target;
|
||||
packetString = $"{eventHandler.Target}.{eventHandler.Method.Name}({_param}, {_args})";
|
||||
break;
|
||||
case CallType.RenderItem:
|
||||
var deferredInvokeItem = (IDeferredInvokeItem)_param;
|
||||
packetString = deferredInvokeItem.ToString();
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
return packetString;
|
||||
}
|
||||
|
||||
private enum CallType
|
||||
{
|
||||
None,
|
||||
Simple,
|
||||
OneParam,
|
||||
Event,
|
||||
RenderItem,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.DeferredHandler
|
||||
// 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.Session
|
||||
{
|
||||
internal delegate void DeferredHandler(object args);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.Direction
|
||||
// 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.Session
|
||||
{
|
||||
internal enum Direction
|
||||
{
|
||||
North,
|
||||
South,
|
||||
East,
|
||||
West,
|
||||
Previous,
|
||||
Next,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.DispatchPriority
|
||||
// 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.Session
|
||||
{
|
||||
internal enum DispatchPriority
|
||||
{
|
||||
Housekeeping,
|
||||
AppEventHigh,
|
||||
High,
|
||||
AppEvent,
|
||||
Normal,
|
||||
RPC,
|
||||
Input,
|
||||
Script,
|
||||
RepeatItem,
|
||||
Layout,
|
||||
LayoutPass2,
|
||||
LayoutApply,
|
||||
LayoutSync,
|
||||
Render,
|
||||
RenderSync,
|
||||
Idle,
|
||||
Sleep,
|
||||
NumPriorities,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.DispatcherTimer
|
||||
// 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.Debug;
|
||||
using Microsoft.Iris.Markup;
|
||||
using Microsoft.Iris.Queues;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Iris.Session
|
||||
{
|
||||
internal class DispatcherTimer
|
||||
{
|
||||
private TimeSpan _interval;
|
||||
private bool _autoRepeat;
|
||||
private object _userData;
|
||||
private DispatcherTimer.TimerCallback _callback;
|
||||
private long _timeBase;
|
||||
private TimeoutManager _timeoutManager;
|
||||
private ITimerOwner _owner;
|
||||
|
||||
public DispatcherTimer(ITimerOwner owner)
|
||||
{
|
||||
_owner = owner;
|
||||
_interval = TimeSpan.FromMilliseconds(100.0);
|
||||
_autoRepeat = true;
|
||||
_timeBase = SystemTickCount.Milliseconds;
|
||||
_timeoutManager = UIDispatcher.CurrentDispatcher.TimeoutManager;
|
||||
}
|
||||
|
||||
public DispatcherTimer()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
public TimeSpan TimeSpanInterval
|
||||
{
|
||||
get => _interval;
|
||||
set
|
||||
{
|
||||
if (!(_interval != value))
|
||||
return;
|
||||
_interval = value;
|
||||
if (Enabled)
|
||||
Start();
|
||||
FireNotification(NotificationID.Interval);
|
||||
}
|
||||
}
|
||||
|
||||
public int Interval
|
||||
{
|
||||
get => (int)TimeSpanInterval.TotalMilliseconds;
|
||||
set => TimeSpanInterval = TimeSpan.FromMilliseconds(value);
|
||||
}
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get => _callback != null;
|
||||
set
|
||||
{
|
||||
if (Enabled == value)
|
||||
return;
|
||||
if (value)
|
||||
Start();
|
||||
else
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public bool AutoRepeat
|
||||
{
|
||||
get => _autoRepeat;
|
||||
set
|
||||
{
|
||||
if (_autoRepeat == value)
|
||||
return;
|
||||
_autoRepeat = value;
|
||||
FireNotification(NotificationID.AutoRepeat);
|
||||
}
|
||||
}
|
||||
|
||||
internal object UserData
|
||||
{
|
||||
get => _userData;
|
||||
set
|
||||
{
|
||||
if (_userData == value)
|
||||
return;
|
||||
_userData = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
bool enabled = Enabled;
|
||||
StopWorker();
|
||||
_timeBase = SystemTickCount.Milliseconds;
|
||||
_callback = new DispatcherTimer.TimerCallback(this);
|
||||
ScheduleCallback(_timeBase);
|
||||
FireEnabledChange(enabled);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
bool enabled = Enabled;
|
||||
StopWorker();
|
||||
FireEnabledChange(enabled);
|
||||
}
|
||||
|
||||
private void StopWorker()
|
||||
{
|
||||
if (_callback == null)
|
||||
return;
|
||||
_timeoutManager.CancelTimeout(_callback);
|
||||
_callback = null;
|
||||
}
|
||||
|
||||
private void FireEnabledChange(bool wasEnabled)
|
||||
{
|
||||
if (Enabled == wasEnabled)
|
||||
return;
|
||||
FireNotification(NotificationID.Enabled);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string str = " one-shot";
|
||||
if (_autoRepeat)
|
||||
str = " repeating";
|
||||
return "[" + Interval + str + "] -> " + DebugHelpers.DEBUG_ObjectToString(Tick);
|
||||
}
|
||||
|
||||
public event EventHandler Tick;
|
||||
|
||||
private void ScheduleCallback(long currentTimeInMilliseconds)
|
||||
{
|
||||
if (_callback == null)
|
||||
return;
|
||||
TimeSpan timeSpan1 = _interval;
|
||||
TimeSpan timeSpan2 = TimeSpan.FromMilliseconds(currentTimeInMilliseconds - _timeBase);
|
||||
if (timeSpan2 >= timeSpan1)
|
||||
{
|
||||
long ticks = timeSpan1.Ticks;
|
||||
if (ticks > 0L)
|
||||
timeSpan1 = TimeSpan.FromTicks(ticks * ((timeSpan2.Ticks + ticks / 2L) / ticks));
|
||||
}
|
||||
_timeBase += (long)timeSpan1.TotalMilliseconds;
|
||||
_timeoutManager.SetTimeoutRelative(_callback, TimeSpan.FromMilliseconds(_timeBase - currentTimeInMilliseconds));
|
||||
}
|
||||
|
||||
private void CallTickHandlers(DispatcherTimer.TimerCallback callback)
|
||||
{
|
||||
if (!CallbackValid(callback))
|
||||
return;
|
||||
if (_autoRepeat)
|
||||
{
|
||||
ScheduleCallback(SystemTickCount.Milliseconds);
|
||||
}
|
||||
else
|
||||
{
|
||||
_callback = null;
|
||||
FireEnabledChange(true);
|
||||
}
|
||||
if (Tick != null)
|
||||
Tick(_owner != null ? _owner : (object)this, EventArgs.Empty);
|
||||
FireNotification(NotificationID.Tick);
|
||||
}
|
||||
|
||||
private bool CallbackValid(DispatcherTimer.TimerCallback callback) => callback == _callback;
|
||||
|
||||
private void FireNotification(string id)
|
||||
{
|
||||
if (_owner == null)
|
||||
return;
|
||||
_owner.OnTimerPropertyChanged(id);
|
||||
}
|
||||
|
||||
private class TimerCallback : QueueItem
|
||||
{
|
||||
private DispatcherTimer _timer;
|
||||
|
||||
public TimerCallback(DispatcherTimer timer) => _timer = timer;
|
||||
|
||||
public override void Dispatch() => _timer.CallTickHandlers(this);
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string str = "";
|
||||
if (!_timer.CallbackValid(this))
|
||||
str = "CANCELED ";
|
||||
return str + GetType().Name + " -> " + _timer;
|
||||
}
|
||||
}
|
||||
|
||||
internal static class SystemTickCount
|
||||
{
|
||||
private static long s_tickCount;
|
||||
private static int s_lastTickCount;
|
||||
|
||||
public static long Milliseconds
|
||||
{
|
||||
get
|
||||
{
|
||||
Refresh();
|
||||
return s_tickCount;
|
||||
}
|
||||
}
|
||||
|
||||
private static void Refresh()
|
||||
{
|
||||
int tickCount = Environment.TickCount;
|
||||
long num = tickCount < s_lastTickCount ? int.MaxValue - s_lastTickCount + tickCount : tickCount - s_lastTickCount;
|
||||
s_tickCount += num;
|
||||
s_lastTickCount = tickCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.EffectManager
|
||||
// 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;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Iris.Session
|
||||
{
|
||||
internal class EffectManager : IDisposable
|
||||
{
|
||||
public const string ColorEffectProperty = "ColorElem.Color";
|
||||
public const string ImageEffectProperty = "ImageElem.Image";
|
||||
private const string s_colorElement = "ColorElem";
|
||||
private const string s_imageElement = "ImageElem";
|
||||
private IRenderSession _renderSession;
|
||||
private bool _fDisposed;
|
||||
private IEffectTemplate _effectTemplateColor;
|
||||
private IEffectTemplate _effectTemplateImage;
|
||||
private IEffectTemplate _effectTemplateImageWithColor;
|
||||
|
||||
public EffectManager(IRenderSession renderSession) => _renderSession = renderSession;
|
||||
|
||||
public void Dispose() => Dispose(true);
|
||||
|
||||
private void Dispose(bool fDisposing)
|
||||
{
|
||||
if (!_fDisposed && fDisposing)
|
||||
{
|
||||
if (_effectTemplateColor != null)
|
||||
{
|
||||
_effectTemplateColor.UnregisterUsage(this);
|
||||
_effectTemplateColor = null;
|
||||
}
|
||||
if (_effectTemplateImage != null)
|
||||
{
|
||||
_effectTemplateImage.UnregisterUsage(this);
|
||||
_effectTemplateImage = null;
|
||||
}
|
||||
if (_effectTemplateImageWithColor != null)
|
||||
{
|
||||
_effectTemplateImageWithColor.UnregisterUsage(this);
|
||||
_effectTemplateImageWithColor = null;
|
||||
}
|
||||
_renderSession = null;
|
||||
}
|
||||
_fDisposed = true;
|
||||
}
|
||||
|
||||
public IEffectTemplate ColorEffectTemplate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_effectTemplateColor == null)
|
||||
{
|
||||
_effectTemplateColor = _renderSession.CreateEffectTemplate(this, "ColorEffect");
|
||||
ColorElement colorElement = new ColorElement("ColorElem");
|
||||
_effectTemplateColor.AddEffectProperty("ColorElem.Color");
|
||||
_effectTemplateColor.Build(colorElement);
|
||||
}
|
||||
return _effectTemplateColor;
|
||||
}
|
||||
}
|
||||
|
||||
public IEffectTemplate ImageEffectTemplate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_effectTemplateImage == null)
|
||||
{
|
||||
_effectTemplateImage = _renderSession.CreateEffectTemplate(this, "ImageEffect");
|
||||
ImageElement imageElement = new ImageElement("ImageElem", null);
|
||||
_effectTemplateImage.AddEffectProperty("ImageElem.Image");
|
||||
_effectTemplateImage.Build(imageElement);
|
||||
}
|
||||
return _effectTemplateImage;
|
||||
}
|
||||
}
|
||||
|
||||
public static IEffect CreateColorFillEffect(object oOwner, Color color)
|
||||
{
|
||||
IEffect instance = UISession.Default.EffectManager.ColorEffectTemplate.CreateInstance(oOwner);
|
||||
instance.SetProperty("ColorElem.Color", color.RenderConvert());
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static IEffect CreateBasicImageEffect(object oOwner, IImage renderImage)
|
||||
{
|
||||
IEffect instance = UISession.Default.EffectManager.ImageEffectTemplate.CreateInstance(oOwner);
|
||||
if (renderImage != null)
|
||||
instance.SetProperty("ImageElem.Image", renderImage);
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.ErrorManager
|
||||
// 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;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.Iris.Session
|
||||
{
|
||||
internal static class ErrorManager
|
||||
{
|
||||
private static uint s_totalErrorsReported;
|
||||
private static Stack<ErrorManager.Context> s_contextStack = new Stack<ErrorManager.Context>();
|
||||
private static uint s_ignoringErrorsDepth;
|
||||
private static bool s_errorBatchPending;
|
||||
private static IList s_errors;
|
||||
private static readonly SimpleCallback s_drainErrorQueueHandler = new SimpleCallback(OnDrainErrorQueue);
|
||||
|
||||
public static ErrorWatermark Watermark => new ErrorWatermark(s_totalErrorsReported);
|
||||
|
||||
public static void EnterContext(object contextObject) => EnterContext(contextObject, false);
|
||||
|
||||
public static void EnterContext(object contextObject, bool ignoreErrors) => EnterContext(new ErrorManager.Context(contextObject, ignoreErrors));
|
||||
|
||||
public static void EnterContext(IErrorContextSource contextSource) => EnterContext(new ErrorManager.Context(contextSource));
|
||||
|
||||
private static void EnterContext(ErrorManager.Context context)
|
||||
{
|
||||
if (context.IgnoreErrors)
|
||||
++s_ignoringErrorsDepth;
|
||||
s_contextStack.Push(context);
|
||||
}
|
||||
|
||||
public static string CurrentContext
|
||||
{
|
||||
get
|
||||
{
|
||||
string str = null;
|
||||
if (s_contextStack.Count != 0)
|
||||
str = s_contextStack.Peek().ToString();
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IgnoringErrors => s_ignoringErrorsDepth > 0U;
|
||||
|
||||
public static void ExitContext()
|
||||
{
|
||||
ErrorManager.Context context = s_contextStack.Peek();
|
||||
if (context.IgnoreErrors)
|
||||
{
|
||||
s_totalErrorsReported = context.TotalErrorsOnEnter;
|
||||
--s_ignoringErrorsDepth;
|
||||
}
|
||||
s_contextStack.Pop();
|
||||
}
|
||||
|
||||
public static uint TotalErrorsReported => s_totalErrorsReported;
|
||||
|
||||
public static event NotifyErrorBatch OnErrors;
|
||||
|
||||
public static IList GetErrors()
|
||||
{
|
||||
IList errors = s_errors;
|
||||
s_errors = null;
|
||||
return errors;
|
||||
}
|
||||
|
||||
public static void ReportError(string message) => TrackReportWorker(-1, -1, false, message);
|
||||
|
||||
public static void ReportError(string format, object param) => TrackReport(-1, -1, false, format, param);
|
||||
|
||||
public static void ReportError(string format, object param1, object param2) => TrackReport(-1, -1, false, format, param1, param2);
|
||||
|
||||
public static void ReportError(string format, object param1, object param2, object param3) => TrackReport(-1, -1, false, format, param1, param2, param3);
|
||||
|
||||
public static void ReportError(
|
||||
string format,
|
||||
object param1,
|
||||
object param2,
|
||||
object param3,
|
||||
object param4)
|
||||
{
|
||||
TrackReport(-1, -1, false, format, param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
public static void ReportError(
|
||||
string format,
|
||||
object param1,
|
||||
object param2,
|
||||
object param3,
|
||||
object param4,
|
||||
object param5)
|
||||
{
|
||||
TrackReport(-1, -1, false, format, param1, param2, param3, param4, param5);
|
||||
}
|
||||
|
||||
public static void ReportError(int line, int column, string message) => TrackReportWorker(line, column, false, message);
|
||||
|
||||
public static void ReportError(int line, int column, string format, object param) => TrackReport(line, column, false, format, param);
|
||||
|
||||
public static void ReportError(
|
||||
int line,
|
||||
int column,
|
||||
string format,
|
||||
object param1,
|
||||
object param2)
|
||||
{
|
||||
TrackReport(line, column, false, format, param1, param2);
|
||||
}
|
||||
|
||||
public static void ReportWarning(string message) => TrackReportWorker(-1, -1, true, message);
|
||||
|
||||
public static void ReportWarning(string format, object param) => TrackReport(-1, -1, true, format, param);
|
||||
|
||||
public static void ReportWarning(string format, object param1, object param2) => TrackReport(-1, -1, true, format, param1, param2);
|
||||
|
||||
public static void ReportWarning(int line, int column, string message) => TrackReportWorker(line, column, true, message);
|
||||
|
||||
public static void ReportWarning(int line, int column, string format, object param) => TrackReport(line, column, true, format, param);
|
||||
|
||||
private static void TrackReportWorker(int line, int column, bool warning, string message)
|
||||
{
|
||||
if (!IgnoringErrors)
|
||||
{
|
||||
string str = null;
|
||||
if (s_contextStack.Count != 0)
|
||||
{
|
||||
ErrorManager.Context context = s_contextStack.Peek();
|
||||
str = context.Description;
|
||||
if (line == -1 && column == -1)
|
||||
context.GetErrorPosition(ref line, ref column);
|
||||
}
|
||||
ErrorRecord errorRecord = new ErrorRecord();
|
||||
errorRecord.Context = str;
|
||||
errorRecord.Line = line;
|
||||
errorRecord.Column = column;
|
||||
errorRecord.Warning = warning;
|
||||
errorRecord.Message = message;
|
||||
if (s_errors == null)
|
||||
s_errors = new ArrayList();
|
||||
s_errors.Add(errorRecord);
|
||||
QueueNotify();
|
||||
}
|
||||
if (warning)
|
||||
return;
|
||||
++s_totalErrorsReported;
|
||||
}
|
||||
|
||||
public static void TrackReport(
|
||||
int line,
|
||||
int column,
|
||||
bool warning,
|
||||
string format,
|
||||
object param)
|
||||
{
|
||||
string message = null;
|
||||
if (!IgnoringErrors)
|
||||
message = string.Format(format, param);
|
||||
TrackReportWorker(line, column, warning, message);
|
||||
}
|
||||
|
||||
public static void TrackReport(
|
||||
int line,
|
||||
int column,
|
||||
bool warning,
|
||||
string format,
|
||||
object param1,
|
||||
object param2)
|
||||
{
|
||||
string message = null;
|
||||
if (!IgnoringErrors)
|
||||
message = string.Format(format, param1, param2);
|
||||
TrackReportWorker(line, column, warning, message);
|
||||
}
|
||||
|
||||
public static void TrackReport(
|
||||
int line,
|
||||
int column,
|
||||
bool warning,
|
||||
string format,
|
||||
object param1,
|
||||
object param2,
|
||||
object param3)
|
||||
{
|
||||
string message = null;
|
||||
if (!IgnoringErrors)
|
||||
message = string.Format(format, param1, param2, param3);
|
||||
TrackReportWorker(line, column, warning, message);
|
||||
}
|
||||
|
||||
public static void TrackReport(
|
||||
int line,
|
||||
int column,
|
||||
bool warning,
|
||||
string format,
|
||||
object param1,
|
||||
object param2,
|
||||
object param3,
|
||||
object param4)
|
||||
{
|
||||
string message = null;
|
||||
if (!IgnoringErrors)
|
||||
message = string.Format(format, param1, param2, param3, param4);
|
||||
TrackReportWorker(line, column, warning, message);
|
||||
}
|
||||
|
||||
public static void TrackReport(
|
||||
int line,
|
||||
int column,
|
||||
bool warning,
|
||||
string format,
|
||||
object param1,
|
||||
object param2,
|
||||
object param3,
|
||||
object param4,
|
||||
object param5)
|
||||
{
|
||||
string message = null;
|
||||
if (!IgnoringErrors)
|
||||
message = string.Format(format, param1, param2, param3, param4, param5);
|
||||
TrackReportWorker(line, column, warning, message);
|
||||
}
|
||||
|
||||
private static void QueueNotify()
|
||||
{
|
||||
if (s_errorBatchPending)
|
||||
return;
|
||||
UIDispatcher currentDispatcher = UIDispatcher.CurrentDispatcher;
|
||||
if (currentDispatcher != null && currentDispatcher.UISession != null)
|
||||
{
|
||||
s_errorBatchPending = true;
|
||||
DeferredCall.Post(DispatchPriority.AppEventHigh, s_drainErrorQueueHandler);
|
||||
}
|
||||
else
|
||||
OnDrainErrorQueue();
|
||||
}
|
||||
|
||||
private static void OnDrainErrorQueue()
|
||||
{
|
||||
s_errorBatchPending = false;
|
||||
IList errors = GetErrors();
|
||||
if (OnErrors == null)
|
||||
return;
|
||||
OnErrors(errors);
|
||||
}
|
||||
|
||||
internal struct Context
|
||||
{
|
||||
private object _contextObject;
|
||||
private bool _ignoreErrors;
|
||||
private uint _errorCountOnEnter;
|
||||
private IErrorContextSource _callback;
|
||||
|
||||
public Context(object contextObject, bool ignoreErrors)
|
||||
{
|
||||
_contextObject = contextObject;
|
||||
_callback = null;
|
||||
_ignoreErrors = ignoreErrors;
|
||||
_errorCountOnEnter = s_totalErrorsReported;
|
||||
}
|
||||
|
||||
public Context(IErrorContextSource contextSource)
|
||||
{
|
||||
_callback = contextSource;
|
||||
_contextObject = null;
|
||||
_ignoreErrors = false;
|
||||
_errorCountOnEnter = s_totalErrorsReported;
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
string str = null;
|
||||
if (_callback != null)
|
||||
str = _callback.GetErrorContextDescription();
|
||||
else if (_contextObject != null)
|
||||
{
|
||||
if (_contextObject is string)
|
||||
str = (string)_contextObject;
|
||||
else if (_contextObject is TypeSchema)
|
||||
str = ((TypeSchema)_contextObject).ErrorContextDescription;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
public void GetErrorPosition(ref int line, ref int column)
|
||||
{
|
||||
if (_callback == null)
|
||||
return;
|
||||
_callback.GetErrorPosition(ref line, ref column);
|
||||
}
|
||||
|
||||
public bool IgnoreErrors => _ignoreErrors;
|
||||
|
||||
public uint TotalErrorsOnEnter => _errorCountOnEnter;
|
||||
|
||||
public override string ToString() => _callback != null ? _callback.ToString() : Description;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.ErrorRecord
|
||||
// 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.Session
|
||||
{
|
||||
internal class ErrorRecord
|
||||
{
|
||||
public string Context;
|
||||
public string Message;
|
||||
public bool Warning;
|
||||
public int Line;
|
||||
public int Column;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.ErrorWatermark
|
||||
// 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.Session
|
||||
{
|
||||
internal struct ErrorWatermark
|
||||
{
|
||||
private uint _currentErrorCount;
|
||||
|
||||
public ErrorWatermark(uint currentErrorCount) => _currentErrorCount = currentErrorCount;
|
||||
|
||||
public bool ErrorsDetected => (int)_currentErrorCount != (int)ErrorManager.TotalErrorsReported;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.EventRouteStages
|
||||
// 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.Session
|
||||
{
|
||||
[Flags]
|
||||
internal enum EventRouteStages
|
||||
{
|
||||
None = 0,
|
||||
Preview = 1,
|
||||
Direct = 2,
|
||||
Bubbled = 4,
|
||||
Routed = 8,
|
||||
Unhandled = 16, // 0x00000010
|
||||
All = Unhandled | Routed | Bubbled | Direct | Preview, // 0x0000001F
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.FormSessionConnectHandler
|
||||
// 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.Session
|
||||
{
|
||||
public delegate void FormSessionConnectHandler(object sender, bool fIsConnected);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.IErrorContextSource
|
||||
// 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.Session
|
||||
{
|
||||
internal interface IErrorContextSource
|
||||
{
|
||||
string GetErrorContextDescription();
|
||||
|
||||
void GetErrorPosition(ref int line, ref int column);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.IModalSession
|
||||
// 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.Session
|
||||
{
|
||||
internal interface IModalSession
|
||||
{
|
||||
bool IsModalAllowed { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.ITimerOwner
|
||||
// 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.Session
|
||||
{
|
||||
internal interface ITimerOwner
|
||||
{
|
||||
void OnTimerPropertyChanged(string id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.ITrackableUIElement
|
||||
// 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.Session
|
||||
{
|
||||
internal interface ITrackableUIElement
|
||||
{
|
||||
bool IsUIVisible { get; }
|
||||
|
||||
Rectangle EstimatePosition(IZoneDisplayChild ancestor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.ITrackableUIElementEvents
|
||||
// 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.Session
|
||||
{
|
||||
internal interface ITrackableUIElementEvents
|
||||
{
|
||||
event EventHandler UIChange;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.IZoneDisplayChild
|
||||
// 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.Session
|
||||
{
|
||||
internal interface IZoneDisplayChild
|
||||
{
|
||||
TransformSet Transforms { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.InputDeliveryStatus
|
||||
// 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.Session
|
||||
{
|
||||
internal enum InputDeliveryStatus
|
||||
{
|
||||
Normal,
|
||||
Truncated,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: Microsoft.Iris.Session.InputNotificationEventArgs
|
||||
// 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.Session
|
||||
{
|
||||
internal struct InputNotificationEventArgs
|
||||
{
|
||||
private EventRouteStages _handledStage;
|
||||
private InputInfo _info;
|
||||
private ICookedInputSite _target;
|
||||
|
||||
public InputNotificationEventArgs(
|
||||
InputInfo info,
|
||||
ICookedInputSite target,
|
||||
EventRouteStages stage)
|
||||
{
|
||||
_info = info;
|
||||
_target = target;
|
||||
_handledStage = stage;
|
||||
}
|
||||
|
||||
public ICookedInputSite Target => _target;
|
||||
|
||||
public InputInfo InputInfo => _info;
|
||||
|
||||
public EventRouteStages HandledStage => _handledStage;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user