Fixed "name can be simplified"

This commit is contained in:
Joshua Askharoun
2021-03-31 17:20:20 -05:00
parent 9b09412b45
commit 799fca8d97
384 changed files with 3966 additions and 3966 deletions
+52 -52
View File
@@ -41,7 +41,7 @@ namespace Microsoft.Iris.Accessibility
private static readonly DataCookie s_popupStateSlot = DataCookie.ReserveSlot();
private static readonly DataCookie s_multiSelectableStateSlot = DataCookie.ReserveSlot();
public Accessible() => this.SetData(Accessible.s_roleSlot, AccRole.Client);
public Accessible() => this.SetData(s_roleSlot, AccRole.Client);
public void Attach(AccessibleProxy proxy)
{
@@ -51,7 +51,7 @@ namespace Microsoft.Iris.Accessibility
public void Detach()
{
this.SetData(Accessible.s_defaultActionCommandSlot, null);
this.SetData(s_defaultActionCommandSlot, null);
this._proxy = null;
}
@@ -59,52 +59,52 @@ namespace Microsoft.Iris.Accessibility
public string Description
{
get => (string)this.GetData(Accessible.s_descriptionSlot);
get => (string)this.GetData(s_descriptionSlot);
set
{
string description = this.Description;
if (!(value != description))
return;
this.SetData(Accessible.s_descriptionSlot, value);
this.SetData(s_descriptionSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Description, AccessibleProperty.Description);
}
}
public string DefaultAction
{
get => (string)this.GetData(Accessible.s_defaultActionSlot);
get => (string)this.GetData(s_defaultActionSlot);
set
{
string defaultAction = this.DefaultAction;
if (!(value != defaultAction))
return;
this.SetData(Accessible.s_defaultActionSlot, value);
this.SetData(s_defaultActionSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.DefaultAction, AccessibleProperty.DefaultAction);
}
}
public IUICommand DefaultActionCommand
{
get => (IUICommand)this.GetData(Accessible.s_defaultActionCommandSlot);
get => (IUICommand)this.GetData(s_defaultActionCommandSlot);
set
{
IUICommand defaultActionCommand = this.DefaultActionCommand;
if (value == defaultActionCommand)
return;
this.SetData(Accessible.s_defaultActionCommandSlot, value);
this.SetData(s_defaultActionCommandSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.DefaultActionCommand, AccessibleProperty.DefaultActionCommand);
}
}
public string Help
{
get => (string)this.GetData(Accessible.s_helpSlot);
get => (string)this.GetData(s_helpSlot);
set
{
string help = this.Help;
if (!(value != help))
return;
this.SetData(Accessible.s_helpSlot, value);
this.SetData(s_helpSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Help, AccessibleProperty.Help);
}
}
@@ -113,7 +113,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_helpTopicSlot);
object data = this.GetData(s_helpTopicSlot);
return data != null ? (int)data : -1;
}
set
@@ -121,33 +121,33 @@ namespace Microsoft.Iris.Accessibility
int helpTopic = this.HelpTopic;
if (value == helpTopic)
return;
this.SetData(Accessible.s_helpTopicSlot, value);
this.SetData(s_helpTopicSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.HelpTopic, AccessibleProperty.HelpTopic);
}
}
public string KeyboardShortcut
{
get => (string)this.GetData(Accessible.s_keyboardShortcutSlot);
get => (string)this.GetData(s_keyboardShortcutSlot);
set
{
string keyboardShortcut = this.KeyboardShortcut;
if (!(value != keyboardShortcut))
return;
this.SetData(Accessible.s_keyboardShortcutSlot, value);
this.SetData(s_keyboardShortcutSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.KeyboardShortcut, AccessibleProperty.KeyboardShortcut);
}
}
public string Name
{
get => (string)this.GetData(Accessible.s_nameSlot);
get => (string)this.GetData(s_nameSlot);
set
{
string name = this.Name;
if (!(value != name))
return;
this.SetData(Accessible.s_nameSlot, value);
this.SetData(s_nameSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Name, AccessibleProperty.Name);
}
}
@@ -156,7 +156,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_roleSlot);
object data = this.GetData(s_roleSlot);
return data != null ? (AccRole)data : AccRole.None;
}
set
@@ -164,20 +164,20 @@ namespace Microsoft.Iris.Accessibility
AccRole role = this.Role;
if (value == role)
return;
this.SetData(Accessible.s_roleSlot, value);
this.SetData(s_roleSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Role, AccessibleProperty.Role);
}
}
public string Value
{
get => (string)this.GetData(Accessible.s_valueSlot);
get => (string)this.GetData(s_valueSlot);
set
{
string str = this.Value;
if (!(value != str))
return;
this.SetData(Accessible.s_valueSlot, value);
this.SetData(s_valueSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Value, AccessibleProperty.Value);
}
}
@@ -186,7 +186,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_animatedStateSlot);
object data = this.GetData(s_animatedStateSlot);
return data != null && (bool)data;
}
set
@@ -194,7 +194,7 @@ namespace Microsoft.Iris.Accessibility
bool isAnimated = this.IsAnimated;
if (value == isAnimated)
return;
this.SetData(Accessible.s_animatedStateSlot, value);
this.SetData(s_animatedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsAnimated, AccessibleProperty.IsAnimated);
}
}
@@ -203,7 +203,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_unavailableStateSlot);
object data = this.GetData(s_unavailableStateSlot);
return data != null && (bool)data;
}
set
@@ -211,7 +211,7 @@ namespace Microsoft.Iris.Accessibility
bool isUnavailable = this.IsUnavailable;
if (value == isUnavailable)
return;
this.SetData(Accessible.s_unavailableStateSlot, value);
this.SetData(s_unavailableStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsUnavailable, AccessibleProperty.IsUnavailable);
}
}
@@ -220,7 +220,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_selectedStateSlot);
object data = this.GetData(s_selectedStateSlot);
return data != null && (bool)data;
}
set
@@ -228,7 +228,7 @@ namespace Microsoft.Iris.Accessibility
bool isSelected = this.IsSelected;
if (value == isSelected)
return;
this.SetData(Accessible.s_selectedStateSlot, value);
this.SetData(s_selectedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsSelected, AccessibleProperty.IsSelected);
}
}
@@ -237,7 +237,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_busyStateSlot);
object data = this.GetData(s_busyStateSlot);
return data != null && (bool)data;
}
set
@@ -245,7 +245,7 @@ namespace Microsoft.Iris.Accessibility
bool isBusy = this.IsBusy;
if (value == isBusy)
return;
this.SetData(Accessible.s_busyStateSlot, value);
this.SetData(s_busyStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsBusy, AccessibleProperty.IsBusy);
}
}
@@ -254,7 +254,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_pressedStateSlot);
object data = this.GetData(s_pressedStateSlot);
return data != null && (bool)data;
}
set
@@ -262,7 +262,7 @@ namespace Microsoft.Iris.Accessibility
bool isPressed = this.IsPressed;
if (value == isPressed)
return;
this.SetData(Accessible.s_pressedStateSlot, value);
this.SetData(s_pressedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsPressed, AccessibleProperty.IsPressed);
}
}
@@ -271,7 +271,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_checkedStateSlot);
object data = this.GetData(s_checkedStateSlot);
return data != null && (bool)data;
}
set
@@ -279,7 +279,7 @@ namespace Microsoft.Iris.Accessibility
bool isChecked = this.IsChecked;
if (value == isChecked)
return;
this.SetData(Accessible.s_checkedStateSlot, value);
this.SetData(s_checkedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsChecked, AccessibleProperty.IsChecked);
}
}
@@ -288,7 +288,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_collapsedStateSlot);
object data = this.GetData(s_collapsedStateSlot);
return data != null && (bool)data;
}
set
@@ -296,7 +296,7 @@ namespace Microsoft.Iris.Accessibility
bool isCollapsed = this.IsCollapsed;
if (value == isCollapsed)
return;
this.SetData(Accessible.s_collapsedStateSlot, value);
this.SetData(s_collapsedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsCollapsed, AccessibleProperty.IsCollapsed);
}
}
@@ -305,7 +305,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_defaultStateSlot);
object data = this.GetData(s_defaultStateSlot);
return data != null && (bool)data;
}
set
@@ -313,7 +313,7 @@ namespace Microsoft.Iris.Accessibility
bool isDefault = this.IsDefault;
if (value == isDefault)
return;
this.SetData(Accessible.s_defaultStateSlot, value);
this.SetData(s_defaultStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsDefault, AccessibleProperty.IsDefault);
}
}
@@ -322,7 +322,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_marqueeStateSlot);
object data = this.GetData(s_marqueeStateSlot);
return data != null && (bool)data;
}
set
@@ -330,7 +330,7 @@ namespace Microsoft.Iris.Accessibility
bool isMarquee = this.IsMarquee;
if (value == isMarquee)
return;
this.SetData(Accessible.s_marqueeStateSlot, value);
this.SetData(s_marqueeStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsMarquee, AccessibleProperty.IsMarquee);
}
}
@@ -339,7 +339,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_mixedStateSlot);
object data = this.GetData(s_mixedStateSlot);
return data != null && (bool)data;
}
set
@@ -347,7 +347,7 @@ namespace Microsoft.Iris.Accessibility
bool isMixed = this.IsMixed;
if (value == isMixed)
return;
this.SetData(Accessible.s_mixedStateSlot, value);
this.SetData(s_mixedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsMixed, AccessibleProperty.IsMixed);
}
}
@@ -356,7 +356,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_expandedStateSlot);
object data = this.GetData(s_expandedStateSlot);
return data != null && (bool)data;
}
set
@@ -364,7 +364,7 @@ namespace Microsoft.Iris.Accessibility
bool isExpanded = this.IsExpanded;
if (value == isExpanded)
return;
this.SetData(Accessible.s_expandedStateSlot, value);
this.SetData(s_expandedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsExpanded, AccessibleProperty.IsExpanded);
}
}
@@ -373,7 +373,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_traversedStateSlot);
object data = this.GetData(s_traversedStateSlot);
return data != null && (bool)data;
}
set
@@ -381,7 +381,7 @@ namespace Microsoft.Iris.Accessibility
bool isTraversed = this.IsTraversed;
if (value == isTraversed)
return;
this.SetData(Accessible.s_traversedStateSlot, value);
this.SetData(s_traversedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsTraversed, AccessibleProperty.IsTraversed);
}
}
@@ -390,7 +390,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_selectableStateSlot);
object data = this.GetData(s_selectableStateSlot);
return data != null && (bool)data;
}
set
@@ -398,7 +398,7 @@ namespace Microsoft.Iris.Accessibility
bool isSelectable = this.IsSelectable;
if (value == isSelectable)
return;
this.SetData(Accessible.s_selectableStateSlot, value);
this.SetData(s_selectableStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsSelectable, AccessibleProperty.IsSelectable);
}
}
@@ -407,7 +407,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_multiSelectableStateSlot);
object data = this.GetData(s_multiSelectableStateSlot);
return data != null && (bool)data;
}
set
@@ -415,7 +415,7 @@ namespace Microsoft.Iris.Accessibility
bool isMultiSelectable = this.IsMultiSelectable;
if (value == isMultiSelectable)
return;
this.SetData(Accessible.s_multiSelectableStateSlot, value);
this.SetData(s_multiSelectableStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsMultiSelectable, AccessibleProperty.IsMultiSelectable);
}
}
@@ -424,7 +424,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_protectedStateSlot);
object data = this.GetData(s_protectedStateSlot);
return data != null && (bool)data;
}
set
@@ -432,7 +432,7 @@ namespace Microsoft.Iris.Accessibility
bool isProtected = this.IsProtected;
if (value == isProtected)
return;
this.SetData(Accessible.s_protectedStateSlot, value);
this.SetData(s_protectedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsProtected, AccessibleProperty.IsProtected);
}
}
@@ -441,7 +441,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
object data = this.GetData(Accessible.s_popupStateSlot);
object data = this.GetData(s_popupStateSlot);
return data != null && (bool)data;
}
set
@@ -449,7 +449,7 @@ namespace Microsoft.Iris.Accessibility
bool hasPopup = this.HasPopup;
if (value == hasPopup)
return;
this.SetData(Accessible.s_popupStateSlot, value);
this.SetData(s_popupStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.HasPopup, AccessibleProperty.HasPopup);
}
}
@@ -28,7 +28,7 @@ namespace Microsoft.Iris.Accessibility
private int _proxyID = -1;
private static int s_proxyIDAllocator = 0;
private static Map<int, AccessibleProxy> s_proxyFromID = new Map<int, AccessibleProxy>();
private static DeferredHandler s_notifyEventHandler = new DeferredHandler(AccessibleProxy.NotifyEvent);
private static DeferredHandler s_notifyEventHandler = new DeferredHandler(NotifyEvent);
private static bool s_accessibilityActive;
internal AccessibleProxy(UIClass ui, Accessible data)
@@ -47,13 +47,13 @@ namespace Microsoft.Iris.Accessibility
this._ui = null;
if (this._proxyID == -1)
return;
AccessibleProxy.s_proxyFromID.Remove(this._proxyID);
s_proxyFromID.Remove(this._proxyID);
}
internal static bool AccessibilityActive
{
get => AccessibleProxy.s_accessibilityActive;
set => AccessibleProxy.s_accessibilityActive = true;
get => s_accessibilityActive;
set => s_accessibilityActive = true;
}
internal virtual IAccessible Parent => this._ui.Parent != null ? _ui.Parent.AccessibleProxy : null;
@@ -197,35 +197,35 @@ namespace Microsoft.Iris.Accessibility
internal static void NotifyCreated(UIClass ui)
{
if (!AccessibleProxy.AccessibilityActive)
if (!AccessibilityActive)
return;
ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectCreate);
}
internal static void NotifyDestroyed(UIClass ui)
{
if (!AccessibleProxy.AccessibilityActive)
if (!AccessibilityActive)
return;
ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectDestroy);
}
internal static void NotifyTreeChanged(UIClass ui)
{
if (!AccessibleProxy.AccessibilityActive || !ui.Initialized)
if (!AccessibilityActive || !ui.Initialized)
return;
ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectReorder);
}
internal static void NotifyVisibilityChange(UIClass ui, bool visible)
{
if (!AccessibleProxy.AccessibilityActive || !ui.Initialized)
if (!AccessibilityActive || !ui.Initialized)
return;
ui.AccessibleProxy.QueueNotifyEvent(visible ? AccEvents.ObjectShow : AccEvents.ObjectHide);
}
internal static void NotifyFocus(UIClass ui)
{
if (!AccessibleProxy.AccessibilityActive || !ui.Initialized)
if (!AccessibilityActive || !ui.Initialized)
return;
ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectFocus);
}
@@ -295,7 +295,7 @@ namespace Microsoft.Iris.Accessibility
this,
(int) eventType
};
DeferredCall.Post(DispatchPriority.AppEvent, AccessibleProxy.s_notifyEventHandler, obj);
DeferredCall.Post(DispatchPriority.AppEvent, s_notifyEventHandler, obj);
}
private static void NotifyEvent(object payload)
@@ -519,8 +519,8 @@ namespace Microsoft.Iris.Accessibility
{
if (this._proxyID == -1)
{
this._proxyID = ++AccessibleProxy.s_proxyIDAllocator;
AccessibleProxy.s_proxyFromID[this._proxyID] = this;
this._proxyID = ++s_proxyIDAllocator;
s_proxyFromID[this._proxyID] = this;
}
return this._proxyID;
}
@@ -529,7 +529,7 @@ namespace Microsoft.Iris.Accessibility
internal static AccessibleProxy AccessibleProxyFromID(int proxyID)
{
AccessibleProxy accessibleProxy;
AccessibleProxy.s_proxyFromID.TryGetValue(proxyID, out accessibleProxy);
s_proxyFromID.TryGetValue(proxyID, out accessibleProxy);
return accessibleProxy;
}
@@ -176,7 +176,7 @@ namespace Microsoft.Iris.Animations
ActiveTransitions activeTransitions = ActiveTransitions.None;
foreach (AnimationProxy animationProxy in animationCollection)
{
ActiveTransitions activeTransition = ActiveSequence.ConvertToActiveTransition(animationProxy.Type);
ActiveTransitions activeTransition = ConvertToActiveTransition(animationProxy.Type);
activeTransitions |= activeTransition;
}
return activeTransitions;
+12 -12
View File
@@ -41,18 +41,18 @@ namespace Microsoft.Iris.Animations
base.CloneWorker(rawAnimation);
Animation animation = (Animation)rawAnimation;
animation.Type = this.Type;
if (this.GetBit(Animation.Bits.CenterPointScale))
if (this.GetBit(Bits.CenterPointScale))
animation.CenterPointPercent = this.CenterPointPercent;
if (this.GetBit(Animation.Bits.RotationAxis))
if (this.GetBit(Bits.RotationAxis))
animation.RotationAxis = this.RotationAxis;
animation.DisableMouseInput = this.DisableMouseInput;
}
private void PrepareToPlay(ref AnimationArgs args)
{
if (this.GetBit(Animation.Bits.CenterPointScale))
if (this.GetBit(Bits.CenterPointScale))
args.ViewItem.VisualCenterPoint = this.CenterPointPercent;
if (!this.GetBit(Animation.Bits.RotationAxis))
if (!this.GetBit(Bits.RotationAxis))
return;
Rotation visualRotation = args.ViewItem.VisualRotation;
args.ViewItem.VisualRotation = new Rotation(visualRotation.AngleRadians, this.RotationAxis);
@@ -66,32 +66,32 @@ namespace Microsoft.Iris.Animations
public Vector3 CenterPointPercent
{
get => !this.GetBit(Animation.Bits.CenterPointScale) ? Vector3.Zero : (Vector3)this.GetData(Animation.s_centerPointScaleProperty);
get => !this.GetBit(Bits.CenterPointScale) ? Vector3.Zero : (Vector3)this.GetData(s_centerPointScaleProperty);
set
{
if (!(this.CenterPointPercent != value))
return;
this.SetData(Animation.s_centerPointScaleProperty, value);
this.SetBit(Animation.Bits.CenterPointScale, true);
this.SetData(s_centerPointScaleProperty, value);
this.SetBit(Bits.CenterPointScale, true);
}
}
public Vector3 RotationAxis
{
get => !this.GetBit(Animation.Bits.RotationAxis) ? Rotation.Default.Axis : (Vector3)this.GetData(Animation.s_rotationAxisProperty);
get => !this.GetBit(Bits.RotationAxis) ? Rotation.Default.Axis : (Vector3)this.GetData(s_rotationAxisProperty);
set
{
if (!(this.RotationAxis != value))
return;
this.SetData(Animation.s_rotationAxisProperty, value);
this.SetBit(Animation.Bits.RotationAxis, true);
this.SetData(s_rotationAxisProperty, value);
this.SetBit(Bits.RotationAxis, true);
}
}
public bool DisableMouseInput
{
get => this.GetBit(Animation.Bits.DisableMouseInput);
set => this.SetBit(Animation.Bits.DisableMouseInput, value);
get => this.GetBit(Bits.DisableMouseInput);
set => this.SetBit(Bits.DisableMouseInput, value);
}
AnimationTemplate IAnimationProvider.Build(
@@ -22,7 +22,7 @@ namespace Microsoft.Iris.Animations
private bool _doNotAutoReleaseFlag;
private IAnimatable _animatableTarget;
private RendererProperty _rendererProperty;
private static DeferredHandler s_deferredCleanupWorker = new DeferredHandler(AnimationProxy.DeferredCleanupWorker);
private static DeferredHandler s_deferredCleanupWorker = new DeferredHandler(DeferredCleanupWorker);
internal AnimationProxy(
ActiveSequence activeSequence,
@@ -91,7 +91,7 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddVector2Keyframe(BaseKeyframe keyframe, Vector2 value)
@@ -115,7 +115,7 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddVector3Keyframe(BaseKeyframe keyframe, Vector3 value)
@@ -139,7 +139,7 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddVector4Keyframe(BaseKeyframe keyframe, Vector4 value)
@@ -163,7 +163,7 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddRotationKeyframe(BaseKeyframe keyframe, Rotation value)
@@ -188,7 +188,7 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians));
AnimationInterpolation interpolation = AnimationProxy.GenerateInterpolation(keyframe.Interpolation);
AnimationInterpolation interpolation = GenerateInterpolation(keyframe.Interpolation);
interpolation.UseSphericalCombination = true;
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, interpolation));
}
@@ -266,7 +266,7 @@ namespace Microsoft.Iris.Animations
{
if (!this.Session.IsValid)
return;
DeferredCall.Post(DispatchPriority.Housekeeping, AnimationProxy.s_deferredCleanupWorker, this);
DeferredCall.Post(DispatchPriority.Housekeeping, s_deferredCleanupWorker, this);
}
}
@@ -20,62 +20,62 @@ namespace Microsoft.Iris.Animations
{
}
public static bool SequenceExists(string id) => AnimationSystem._sequences.ContainsKey(id);
public static bool SequenceExists(string id) => _sequences.ContainsKey(id);
public static AnimationTemplate GetSequenceByID(string id)
{
if (!AnimationSystem.Enabled)
if (!Enabled)
return null;
return AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : null;
return SequenceExists(id) ? (AnimationTemplate)_sequences[id].Clone() : null;
}
public static AnimationTemplate GetSequenceByIDAlways(string id) => AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : null;
public static AnimationTemplate GetSequenceByIDAlways(string id) => SequenceExists(id) ? (AnimationTemplate)_sequences[id].Clone() : null;
public static void AddSequenceByID(string id, AnimationTemplate seq)
{
if (AnimationSystem.SequenceExists(id))
if (SequenceExists(id))
return;
AnimationSystem._sequences.Add(id, seq);
_sequences.Add(id, seq);
}
public static void ClearSequences() => AnimationSystem._sequences = new Dictionary<string, AnimationTemplate>();
public static void ClearSequences() => _sequences = new Dictionary<string, AnimationTemplate>();
public static ICollection GetAllSequences() => _sequences.Values;
public static bool Enabled => AnimationSystem._enabledFlag;
public static bool Enabled => _enabledFlag;
public static void SetEnableState(bool value) => AnimationSystem._enabledFlag = value;
public static void SetEnableState(bool value) => _enabledFlag = value;
public static void OverrideAnimationState(bool overrideToFalseFlag)
{
if (AnimationSystem._overrideToFalseFlag == overrideToFalseFlag)
if (_overrideToFalseFlag == overrideToFalseFlag)
return;
AnimationSystem._overrideToFalseFlag = overrideToFalseFlag;
AnimationSystem.UpdateAnimationState();
_overrideToFalseFlag = overrideToFalseFlag;
UpdateAnimationState();
}
public static void UpdateAnimationState()
{
bool flag = true;
if (AnimationSystem._disableAnimationCount > 0 || AnimationSystem._overrideToFalseFlag)
if (_disableAnimationCount > 0 || _overrideToFalseFlag)
flag = false;
AnimationSystem.SetEnableState(flag);
SetEnableState(flag);
}
public static void PushDisableAnimations()
{
++AnimationSystem._disableAnimationCount;
if (AnimationSystem._disableAnimationCount != 1)
++_disableAnimationCount;
if (_disableAnimationCount != 1)
return;
AnimationSystem.UpdateAnimationState();
UpdateAnimationState();
}
public static void PopDisableAnimations()
{
--AnimationSystem._disableAnimationCount;
if (AnimationSystem._disableAnimationCount != 0)
--_disableAnimationCount;
if (_disableAnimationCount != 0)
return;
AnimationSystem.UpdateAnimationState();
UpdateAnimationState();
}
}
}
@@ -121,7 +121,7 @@ namespace Microsoft.Iris.Animations
for (int index = 0; index < count; ++index)
{
BaseKeyframe keyframes = this._keyframesList[index];
if (AnimationTemplate.IsSameTime(time, keyframes.Time))
if (IsSameTime(time, keyframes.Time))
return keyframes;
}
return null;
+17 -17
View File
@@ -19,22 +19,22 @@ namespace Microsoft.Iris.Animations
static BaseKeyframe()
{
BaseKeyframe.s_propertyMap[0] = new RendererProperty("Position");
BaseKeyframe.s_propertyMap[1] = new RendererProperty("Size");
BaseKeyframe.s_propertyMap[2] = new RendererProperty("Alpha");
BaseKeyframe.s_propertyMap[3] = new RendererProperty("Scale");
BaseKeyframe.s_propertyMap[4] = new RendererProperty("Rotation");
BaseKeyframe.s_propertyMap[5] = new RendererProperty("Orientation");
BaseKeyframe.s_propertyMap[6] = new RendererProperty("Position", "X", "X00");
BaseKeyframe.s_propertyMap[7] = new RendererProperty("Position", "Y", "0X0");
BaseKeyframe.s_propertyMap[8] = new RendererProperty("Size", "X", "X0");
BaseKeyframe.s_propertyMap[9] = new RendererProperty("Size", "Y", "0X");
BaseKeyframe.s_propertyMap[10] = new RendererProperty("Scale", "X", "X00");
BaseKeyframe.s_propertyMap[11] = new RendererProperty("Scale", "Y", "0X0");
BaseKeyframe.s_propertyMap[16] = new RendererProperty("CameraEye");
BaseKeyframe.s_propertyMap[17] = new RendererProperty("CameraAt");
BaseKeyframe.s_propertyMap[18] = new RendererProperty("CameraUp");
BaseKeyframe.s_propertyMap[19] = new RendererProperty("CameraZn");
s_propertyMap[0] = new RendererProperty("Position");
s_propertyMap[1] = new RendererProperty("Size");
s_propertyMap[2] = new RendererProperty("Alpha");
s_propertyMap[3] = new RendererProperty("Scale");
s_propertyMap[4] = new RendererProperty("Rotation");
s_propertyMap[5] = new RendererProperty("Orientation");
s_propertyMap[6] = new RendererProperty("Position", "X", "X00");
s_propertyMap[7] = new RendererProperty("Position", "Y", "0X0");
s_propertyMap[8] = new RendererProperty("Size", "X", "X0");
s_propertyMap[9] = new RendererProperty("Size", "Y", "0X");
s_propertyMap[10] = new RendererProperty("Scale", "X", "X00");
s_propertyMap[11] = new RendererProperty("Scale", "Y", "0X0");
s_propertyMap[16] = new RendererProperty("CameraEye");
s_propertyMap[17] = new RendererProperty("CameraAt");
s_propertyMap[18] = new RendererProperty("CameraUp");
s_propertyMap[19] = new RendererProperty("CameraZn");
}
public BaseKeyframe()
@@ -66,7 +66,7 @@ namespace Microsoft.Iris.Animations
string property)
{
StopCommand stopCommand = anim.GetStopCommand(this.Type);
RendererProperty rendererProperty = property != null ? new RendererProperty(property) : BaseKeyframe.s_propertyMap[(int)this.Type];
RendererProperty rendererProperty = property != null ? new RendererProperty(property) : s_propertyMap[(int)this.Type];
return new AnimationProxy(aseq, aseq.Target, this.Type, rendererProperty, anim.Loop, stopCommand);
}
@@ -20,7 +20,7 @@ namespace Microsoft.Iris.Animations
Vector3 baseValueVector,
ref AnimationArgs args)
{
return PositionKeyframe.GetEffectivePositionValue(this.RelativeTo, targetObject, baseValueVector, ref args);
return GetEffectivePositionValue(this.RelativeTo, targetObject, baseValueVector, ref args);
}
public static Vector3 GetEffectivePositionValue(
+9 -9
View File
@@ -26,7 +26,7 @@ namespace Microsoft.Iris.Animations
public RelativeTo(SnapshotPolicy snapshot) => this._snapshot = snapshot;
public bool IsRelativeToObject => this._sourceObject != null || this._sourceId != 0 || this == RelativeTo.s_current || this == RelativeTo.s_currentSnapshotOnLoop;
public bool IsRelativeToObject => this._sourceObject != null || this._sourceId != 0 || this == s_current || this == s_currentSnapshotOnLoop;
public IAnimatable Source
{
@@ -70,13 +70,13 @@ namespace Microsoft.Iris.Animations
set => this._add = value;
}
public static RelativeTo Absolute => RelativeTo.s_absolute;
public static RelativeTo Absolute => s_absolute;
public static RelativeTo Current => RelativeTo.s_current;
public static RelativeTo Current => s_current;
public static RelativeTo CurrentSnapshotOnLoop => RelativeTo.s_currentSnapshotOnLoop;
public static RelativeTo CurrentSnapshotOnLoop => s_currentSnapshotOnLoop;
public static RelativeTo Final => RelativeTo.s_final;
public static RelativeTo Final => s_final;
public AnimationInput CreateAnimationInput(
IAnimatable defaultSource,
@@ -126,13 +126,13 @@ namespace Microsoft.Iris.Animations
public override string ToString()
{
if (this == RelativeTo.s_absolute)
if (this == s_absolute)
return "Absolute";
if (this == RelativeTo.s_current)
if (this == s_current)
return "Current";
if (this == RelativeTo.s_currentSnapshotOnLoop)
if (this == s_currentSnapshotOnLoop)
return "CurrentSnapshotOnLoop";
return this == RelativeTo.s_final ? "Final" : string.Format("[Object = {0}, Property = {1}]", this._sourceObject != null ? _sourceObject : (object)this._sourceId, _sourceProperty);
return this == s_final ? "Final" : string.Format("[Object = {0}, Property = {1}]", this._sourceObject != null ? _sourceObject : (object)this._sourceId, _sourceProperty);
}
}
}
@@ -23,7 +23,7 @@ namespace Microsoft.Iris.Animations
Vector3 baseValueVector,
ref AnimationArgs args)
{
return ScaleKeyframe.GetEffectiveScaleValue(this.RelativeTo, targetObject, baseValueVector, ref args);
return GetEffectiveScaleValue(this.RelativeTo, targetObject, baseValueVector, ref args);
}
public static Vector3 GetEffectiveScaleValue(
@@ -83,7 +83,7 @@ namespace Microsoft.Iris.Animations
bool flag3 = magnitude != 1.0;
int filter = (int)this._filter;
AnimationTemplate anim1 = base.BuildWorker(ref args);
TransformAnimation.DumpAnimation(anim1, "Source");
DumpAnimation(anim1, "Source");
if (!flag1 && !flag2 && !flag3)
return anim1;
AnimationTemplate anim2 = (AnimationTemplate)anim1.Clone();
@@ -118,7 +118,7 @@ namespace Microsoft.Iris.Animations
if (this.ShouldApplyTransform(keyframe))
keyframe.Time *= timeScaleValue;
}
TransformAnimation.DumpAnimation(anim, "Result");
DumpAnimation(anim, "Result");
}
private void ApplyTimeOffset(AnimationTemplate anim, float timeOffsetValue)
@@ -135,7 +135,7 @@ namespace Microsoft.Iris.Animations
}
foreach (BaseKeyframe key in arrayList)
anim.AddKeyframe(key);
TransformAnimation.DumpAnimation(anim, "Result");
DumpAnimation(anim, "Result");
}
private void ApplyMagnitude(AnimationTemplate anim, float magnitudeValue)
@@ -145,7 +145,7 @@ namespace Microsoft.Iris.Animations
if (this.ShouldApplyTransform(keyframe))
keyframe.MagnifyValue(magnitudeValue);
}
TransformAnimation.DumpAnimation(anim, "Result");
DumpAnimation(anim, "Result");
}
private KeyframeFilter GetKeyframeFilter(BaseKeyframe key)
+84 -84
View File
@@ -25,7 +25,7 @@ namespace Microsoft.Iris
{
public static class Application
{
private static Application.InitializationState s_initializationState = Application.InitializationState.NotInitialized;
private static Application.InitializationState s_initializationState = InitializationState.NotInitialized;
private static UISession s_session;
private static Window s_mainWindow;
private static bool s_isShuttingDown;
@@ -47,11 +47,11 @@ namespace Microsoft.Iris
{
get
{
if (Application.s_initializationState != Application.InitializationState.FullyInitialized)
if (s_initializationState != InitializationState.FullyInitialized)
throw new InvalidOperationException("Application.Initialize must be called prior Window query");
if (Application.s_mainWindow == null)
Application.s_mainWindow = new Window((UIForm)Application.s_session.Form);
return Application.s_mainWindow;
if (s_mainWindow == null)
s_mainWindow = new Window((UIForm)s_session.Form);
return s_mainWindow;
}
}
@@ -59,74 +59,74 @@ namespace Microsoft.Iris
{
set
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Property cannot be modified after application has been initialized");
Application.s_renderType = value;
s_renderType = value;
}
get => Application.s_renderType;
get => s_renderType;
}
public static SoundType SoundType
{
set
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Property cannot be modified after application has been initialized");
Application.s_soundType = value;
s_soundType = value;
}
get => Application.s_soundType;
get => s_soundType;
}
public static RenderingQuality RenderingQuality
{
set
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Property cannot be modified after application has been initialized");
Application.s_renderingQuality = value;
s_renderingQuality = value;
}
get => Application.s_renderingQuality;
get => s_renderingQuality;
}
public static bool AnimationsEnabled
{
set
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Property cannot be modified after application has been initialized");
Application.s_EnableAnimations = value;
s_EnableAnimations = value;
}
get => Application.s_EnableAnimations;
get => s_EnableAnimations;
}
public static bool IsRTL
{
set
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Property cannot be modified after application has been initialized");
Application.s_IsRTL = value;
s_IsRTL = value;
}
get => Application.s_IsRTL;
get => s_IsRTL;
}
public static bool IsDx9AccelerationAvailable
{
get
{
if (Application.s_initializationState != Application.InitializationState.FullyInitialized)
if (s_initializationState != InitializationState.FullyInitialized)
throw new InvalidOperationException("Application.Initialize must be called prior to DX9 check");
return Application.s_session.IsGraphicsDeviceAvailable(GraphicsDeviceType.Direct3D9);
return s_session.IsGraphicsDeviceAvailable(GraphicsDeviceType.Direct3D9);
}
}
private static bool IsInitialized => Application.s_initializationState != Application.InitializationState.NotInitialized;
private static bool IsInitialized => s_initializationState != InitializationState.NotInitialized;
public static bool StaticDllResourcesOnly
{
set
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Property cannot be modified after application has been initialized");
DllResources.StaticDllResourcesOnly = value;
}
@@ -135,63 +135,63 @@ namespace Microsoft.Iris
public static void Initialize()
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Application already initialized");
Application.VerifyTrustedEnvironment();
Application.s_session = new UISession();
Application.s_session.IsRtl = Application.s_IsRTL;
Application.s_session.InputManager.KeyCoalescePolicy = new KeyCoalesceFilter(Application.QueryKeyCoalesce);
GraphicsDeviceType graphicsType = Application.ChooseRenderingGraphicsDevice(Application.s_renderType);
VerifyTrustedEnvironment();
s_session = new UISession();
s_session.IsRtl = s_IsRTL;
s_session.InputManager.KeyCoalescePolicy = new KeyCoalesceFilter(QueryKeyCoalesce);
GraphicsDeviceType graphicsType = ChooseRenderingGraphicsDevice(s_renderType);
switch (graphicsType)
{
case GraphicsDeviceType.Gdi:
Application.s_renderType = RenderingType.GDI;
s_renderType = RenderingType.GDI;
break;
case GraphicsDeviceType.Direct3D9:
Application.s_renderType = RenderingType.DX9;
s_renderType = RenderingType.DX9;
break;
default:
throw new ArgumentException(InvariantString.Format("Unknown graphics type {0}", graphicsType));
}
if (graphicsType == GraphicsDeviceType.Gdi)
Application.s_EnableAnimations = false;
SoundDeviceType soundType = Application.ChooseRendererSoundDevice(Application.s_soundType);
s_EnableAnimations = false;
SoundDeviceType soundType = ChooseRendererSoundDevice(s_soundType);
switch (soundType)
{
case SoundDeviceType.None:
Application.s_soundType = SoundType.None;
s_soundType = SoundType.None;
break;
case SoundDeviceType.DirectSound8:
Application.s_soundType = SoundType.DirectSound;
s_soundType = SoundType.DirectSound;
break;
default:
throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", soundType));
}
Application.s_session.InitializeRenderingDevices(graphicsType, (GraphicsRenderingQuality)Application.s_renderingQuality, soundType);
Application.s_renderingQuality = (RenderingQuality)Application.s_session.RenderSession.GraphicsDevice.RenderingQuality;
Application.InitializeCommon(true);
if (!Application.s_EnableAnimations)
s_session.InitializeRenderingDevices(graphicsType, (GraphicsRenderingQuality)s_renderingQuality, soundType);
s_renderingQuality = (RenderingQuality)s_session.RenderSession.GraphicsDevice.RenderingQuality;
InitializeCommon(true);
if (!s_EnableAnimations)
AnimationSystem.OverrideAnimationState(true);
UIForm uiForm = new UIForm(Application.s_session);
Application.s_initializationState = Application.InitializationState.FullyInitialized;
UIForm uiForm = new UIForm(s_session);
s_initializationState = InitializationState.FullyInitialized;
}
private static void InitializeCommon(bool fullInitialization)
{
ErrorManager.OnErrors += new NotifyErrorBatch(Application.NotifyErrorBatchHandler);
Microsoft.Iris.Debug.Trace.Initialize();
ErrorManager.OnErrors += new NotifyErrorBatch(NotifyErrorBatchHandler);
Debug.Trace.Initialize();
MarkupSystem.Startup(!fullInitialization);
StaticServices.Initialize();
}
public static void InitializeForToolOnly()
{
if (Application.IsInitialized)
if (IsInitialized)
throw new InvalidOperationException("Application has already been initialized");
RenderApi.InitializeForToolOnly();
UIDispatcher uiDispatcher = new UIDispatcher(true);
Application.InitializeCommon(false);
Application.s_initializationState = Application.InitializationState.InitializedWithoutUI;
InitializeCommon(false);
s_initializationState = InitializationState.InitializedWithoutUI;
}
public static bool IsApplicationThread => UIDispatcher.IsUIThread;
@@ -262,42 +262,42 @@ namespace Microsoft.Iris
public static void Run(DeferredInvokeHandler initialLoadComplete)
{
UIDispatcher.VerifyOnApplicationThread();
if (Application.s_initializationState != Application.InitializationState.FullyInitialized)
if (s_initializationState != InitializationState.FullyInitialized)
throw new InvalidOperationException("Application not initialized for displaying UI");
if (initialLoadComplete != null)
((UIForm)Application.s_session.Form).SetInitialLoadCompleteCallback(DeferredInvokeProxy.Thunk(initialLoadComplete));
((UIForm)s_session.Form).SetInitialLoadCompleteCallback(DeferredInvokeProxy.Thunk(initialLoadComplete));
UIApplication.Run();
}
public static void Run() => Application.Run(null);
public static void Run() => Run(null);
public static event EventHandler ShuttingDown;
public static bool IsShuttingDown => Application.s_isShuttingDown;
public static bool IsShuttingDown => s_isShuttingDown;
public static void Shutdown()
{
UIDispatcher.VerifyOnApplicationThread();
Application.s_isShuttingDown = true;
if (Application.ShuttingDown != null)
Application.ShuttingDown(null, EventArgs.Empty);
s_isShuttingDown = true;
if (ShuttingDown != null)
ShuttingDown(null, EventArgs.Empty);
MarkupSystem.Shutdown();
if (Application.s_initializationState == Application.InitializationState.FullyInitialized)
if (s_initializationState == InitializationState.FullyInitialized)
{
Application.s_session.Dispose();
Application.s_session = null;
s_session.Dispose();
s_session = null;
}
if (Application.s_initializationState == Application.InitializationState.InitializedWithoutUI)
if (s_initializationState == InitializationState.InitializedWithoutUI)
RenderApi.ShutdownForToolOnly();
StaticServices.Uninitialize();
Microsoft.Iris.Debug.Trace.Shutdown();
ErrorManager.OnErrors -= new NotifyErrorBatch(Application.NotifyErrorBatchHandler);
Application.s_initializationState = Application.InitializationState.NotInitialized;
Debug.Trace.Shutdown();
ErrorManager.OnErrors -= new NotifyErrorBatch(NotifyErrorBatchHandler);
s_initializationState = InitializationState.NotInitialized;
}
public static void DeferredInvoke(DeferredInvokeHandler method, DeferredInvokePriority priority) => Application.DeferredInvoke(method, null, priority);
public static void DeferredInvoke(DeferredInvokeHandler method, DeferredInvokePriority priority) => DeferredInvoke(method, null, priority);
public static void DeferredInvoke(DeferredInvokeHandler method, object args) => Application.DeferredInvoke(method, args, DeferredInvokePriority.Normal);
public static void DeferredInvoke(DeferredInvokeHandler method, object args) => DeferredInvoke(method, args, DeferredInvokePriority.Normal);
public static void DeferredInvoke(
DeferredInvokeHandler method,
@@ -321,7 +321,7 @@ namespace Microsoft.Iris
DeferredCall.Post(priority1, DeferredInvokeProxy.Thunk(method), args);
}
public static void DeferredInvoke(DeferredInvokeHandler method, TimeSpan delay) => Application.DeferredInvoke(method, null, delay);
public static void DeferredInvoke(DeferredInvokeHandler method, TimeSpan delay) => DeferredInvoke(method, null, delay);
public static void DeferredInvoke(DeferredInvokeHandler method, object args, TimeSpan delay)
{
@@ -330,7 +330,7 @@ namespace Microsoft.Iris
DeferredCall.Post(delay, DeferredInvokeProxy.Thunk(method), args);
}
public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method) => Application.DeferredInvoke(thread, method, null);
public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method) => DeferredInvoke(thread, method, null);
public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method, object args)
{
@@ -379,11 +379,11 @@ namespace Microsoft.Iris
public static int CreateExternalAnimationInput(IDictionary<string, int> propertyNameToId)
{
UIDispatcher.VerifyOnApplicationThread();
if (Application.s_idToExternalAnimationInput == null)
Application.s_idToExternalAnimationInput = new Dictionary<int, IExternalAnimationInput>();
if (s_idToExternalAnimationInput == null)
s_idToExternalAnimationInput = new Dictionary<int, IExternalAnimationInput>();
SimpleAnimationPropertyMap animationPropertyMap = new SimpleAnimationPropertyMap(propertyNameToId);
IExternalAnimationInput externalAnimationInput = Application.s_session.RenderSession.AnimationSystem.CreateExternalAnimationInput(s_idToExternalAnimationInput, animationPropertyMap);
Application.s_idToExternalAnimationInput.Add((int)externalAnimationInput.UniqueId, externalAnimationInput);
IExternalAnimationInput externalAnimationInput = s_session.RenderSession.AnimationSystem.CreateExternalAnimationInput(s_idToExternalAnimationInput, animationPropertyMap);
s_idToExternalAnimationInput.Add((int)externalAnimationInput.UniqueId, externalAnimationInput);
return (int)externalAnimationInput.UniqueId;
}
@@ -391,14 +391,14 @@ namespace Microsoft.Iris
{
UIDispatcher.VerifyOnApplicationThread();
IExternalAnimationInput externalAnimationInput;
if (Application.s_idToExternalAnimationInput == null || !Application.s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput))
if (s_idToExternalAnimationInput == null || !s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput))
return;
Application.s_idToExternalAnimationInput.Remove(animationId);
s_idToExternalAnimationInput.Remove(animationId);
externalAnimationInput.UnregisterUsage(s_idToExternalAnimationInput);
IAnimationInputProvider animationInputProvider;
if (Application.s_animationProviders == null || !Application.s_animationProviders.TryGetValue(animationId, out animationInputProvider))
if (s_animationProviders == null || !s_animationProviders.TryGetValue(animationId, out animationInputProvider))
return;
Application.s_animationProviders.Remove(animationId);
s_animationProviders.Remove(animationId);
animationInputProvider.UnregisterUsage(s_idToExternalAnimationInput);
}
@@ -407,8 +407,8 @@ namespace Microsoft.Iris
{
UIDispatcher.VerifyOnApplicationThread();
IExternalAnimationInput externalAnimationInput = null;
if (Application.s_idToExternalAnimationInput != null)
Application.s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput);
if (s_idToExternalAnimationInput != null)
s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput);
return externalAnimationInput;
}
@@ -419,12 +419,12 @@ namespace Microsoft.Iris
{
UIDispatcher.VerifyOnApplicationThread();
IAnimationInputProvider provider;
if (Application.s_animationProviders == null || !Application.s_animationProviders.TryGetValue(animationId, out provider))
if (s_animationProviders == null || !s_animationProviders.TryGetValue(animationId, out provider))
{
provider = Application.MapExternalAnimationInput(animationId).CreateProvider(s_idToExternalAnimationInput);
if (Application.s_animationProviders == null)
Application.s_animationProviders = new Dictionary<int, IAnimationInputProvider>();
Application.s_animationProviders.Add(animationId, provider);
provider = MapExternalAnimationInput(animationId).CreateProvider(s_idToExternalAnimationInput);
if (s_animationProviders == null)
s_animationProviders = new Dictionary<int, IAnimationInputProvider>();
s_animationProviders.Add(animationId, provider);
}
provider.PublishFloat(property, value);
}
@@ -433,7 +433,7 @@ namespace Microsoft.Iris
private static void NotifyErrorBatchHandler(IList records)
{
if (Application.ErrorReport == null)
if (ErrorReport == null)
return;
Error[] errors = new Error[records.Count];
for (int index = 0; index < records.Count; ++index)
@@ -448,7 +448,7 @@ namespace Microsoft.Iris
Column = record.Column
};
}
Application.ErrorReport(errors);
ErrorReport(errors);
}
private static GraphicsDeviceType ChooseRenderingGraphicsDevice(
@@ -467,7 +467,7 @@ namespace Microsoft.Iris
default:
throw new ArgumentException(InvariantString.Format("Unknown rendering type {0}", type));
}
if (type == RenderingType.Default && !Application.s_session.IsGraphicsDeviceRecommended(graphicsType) || !Application.s_session.IsGraphicsDeviceAvailable(graphicsType))
if (type == RenderingType.Default && !s_session.IsGraphicsDeviceRecommended(graphicsType) || !s_session.IsGraphicsDeviceAvailable(graphicsType))
graphicsType = GraphicsDeviceType.Gdi;
return graphicsType;
}
@@ -478,7 +478,7 @@ namespace Microsoft.Iris
return SoundDeviceType.None;
if (typeRequested != SoundType.DirectSound)
throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", typeRequested));
return Application.s_session.IsSoundDeviceAvailable(SoundDeviceType.DirectSound8) ? SoundDeviceType.DirectSound8 : SoundDeviceType.None;
return s_session.IsSoundDeviceAvailable(SoundDeviceType.DirectSound8) ? SoundDeviceType.DirectSound8 : SoundDeviceType.None;
}
private static bool QueryKeyCoalesce(Keys key) => true;
+3 -3
View File
@@ -249,12 +249,12 @@ namespace Microsoft.Iris
add
{
using (this.ThreadValidator)
this.AddEventHandler(Choice.s_chosenChangedEvent, value);
this.AddEventHandler(s_chosenChangedEvent, value);
}
remove
{
using (this.ThreadValidator)
this.RemoveEventHandler(Choice.s_chosenChangedEvent, value);
this.RemoveEventHandler(s_chosenChangedEvent, value);
}
}
@@ -315,7 +315,7 @@ namespace Microsoft.Iris
private void FireChangedChosenEvent()
{
if (this.GetEventHandler(Choice.s_chosenChangedEvent) is EventHandler eventHandler)
if (this.GetEventHandler(s_chosenChangedEvent) is EventHandler eventHandler)
eventHandler(this, EventArgs.Empty);
this.OnChosenChanged();
}
@@ -12,7 +12,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
{
protected IntPtr _interface;
~DllInterfaceProxy() => DllProxyObject.RegisterAppThreadRelease(new DllProxyObject.AppThreadReleaseEntry(this._interface));
~DllInterfaceProxy() => RegisterAppThreadRelease(new DllProxyObject.AppThreadReleaseEntry(this._interface));
protected override void OnDispose() => new DllProxyObject.AppThreadReleaseEntry(this._interface).Release();
@@ -18,7 +18,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
this._baseType = ObjectSchema.Type;
this._name = InvariantString.Format("<DLL Intrinsic> {0}", equivalentType.Name);
this._marshalAs = ID;
TypeSchema.RegisterOneWayEquivalence(this, equivalentType);
RegisterOneWayEquivalence(this, equivalentType);
}
}
}
@@ -30,23 +30,23 @@ namespace Microsoft.Iris.CodeModel.Cpp
{
DllLoadResultFactory.Startup();
DllProxyServices.Startup();
DllLoadResult.LoadIntrinsicTypeData();
LoadIntrinsicTypeData();
}
private static void LoadIntrinsicTypeData()
{
DllLoadResult.s_intrinsicData = new Map<uint, DllLoadResult.IntrinsicTypeData>();
DllLoadResult.s_intrinsicData[4294967294U] = new DllLoadResult.IntrinsicTypeData(BooleanSchema.Type);
DllLoadResult.s_intrinsicData[4294967293U] = new DllLoadResult.IntrinsicTypeData(ByteSchema.Type);
DllLoadResult.s_intrinsicData[4294967292U] = new DllLoadResult.IntrinsicTypeData(DoubleSchema.Type);
DllLoadResult.s_intrinsicData[4294967285U] = new DllLoadResult.IntrinsicTypeData(ListSchema.Type, typeof(DllProxyList));
DllLoadResult.s_intrinsicData[4294967284U] = new DllLoadResult.IntrinsicTypeData(ImageSchema.Type);
DllLoadResult.s_intrinsicData[4294967283U] = new DllLoadResult.IntrinsicTypeData(Int32Schema.Type);
DllLoadResult.s_intrinsicData[4294967282U] = new DllLoadResult.IntrinsicTypeData(Int64Schema.Type);
DllLoadResult.s_intrinsicData[4294967280U] = new DllLoadResult.IntrinsicTypeData(ObjectSchema.Type);
DllLoadResult.s_intrinsicData[4294967279U] = new DllLoadResult.IntrinsicTypeData(SingleSchema.Type);
DllLoadResult.s_intrinsicData[4294967278U] = new DllLoadResult.IntrinsicTypeData(StringSchema.Type);
DllLoadResult.s_intrinsicData[4294967277U] = new DllLoadResult.IntrinsicTypeData(VoidSchema.Type);
s_intrinsicData = new Map<uint, DllLoadResult.IntrinsicTypeData>();
s_intrinsicData[4294967294U] = new DllLoadResult.IntrinsicTypeData(BooleanSchema.Type);
s_intrinsicData[4294967293U] = new DllLoadResult.IntrinsicTypeData(ByteSchema.Type);
s_intrinsicData[4294967292U] = new DllLoadResult.IntrinsicTypeData(DoubleSchema.Type);
s_intrinsicData[4294967285U] = new DllLoadResult.IntrinsicTypeData(ListSchema.Type, typeof(DllProxyList));
s_intrinsicData[4294967284U] = new DllLoadResult.IntrinsicTypeData(ImageSchema.Type);
s_intrinsicData[4294967283U] = new DllLoadResult.IntrinsicTypeData(Int32Schema.Type);
s_intrinsicData[4294967282U] = new DllLoadResult.IntrinsicTypeData(Int64Schema.Type);
s_intrinsicData[4294967280U] = new DllLoadResult.IntrinsicTypeData(ObjectSchema.Type);
s_intrinsicData[4294967279U] = new DllLoadResult.IntrinsicTypeData(SingleSchema.Type);
s_intrinsicData[4294967278U] = new DllLoadResult.IntrinsicTypeData(StringSchema.Type);
s_intrinsicData[4294967277U] = new DllLoadResult.IntrinsicTypeData(VoidSchema.Type);
}
public static void Shutdown() => DllProxyServices.Shutdown();
@@ -59,13 +59,13 @@ namespace Microsoft.Iris.CodeModel.Cpp
return false;
}
private bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXTypeSchema");
private bool CheckNativeReturn(uint hr) => CheckNativeReturn(hr, "IUIXTypeSchema");
public static void PushContext(LoadResult newContext) => DllLoadResult.s_objectContext = newContext;
public static void PushContext(LoadResult newContext) => s_objectContext = newContext;
public static LoadResult CurrentContext => DllLoadResult.s_objectContext;
public static LoadResult CurrentContext => s_objectContext;
public static void PopContext() => DllLoadResult.s_objectContext = null;
public static void PopContext() => s_objectContext = null;
public static TypeSchema MapType(uint typeID)
{
@@ -78,7 +78,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
if (dllLoadResult != null)
typeSchema = dllLoadResult.MapLocalType(typeID);
}
else if (DllLoadResult.CurrentContext is DllLoadResult currentContext)
else if (CurrentContext is DllLoadResult currentContext)
typeSchema = currentContext.MapIntrinsicType(typeID);
if (typeSchema == null)
ErrorManager.ReportError("Unable to find type with ID '0x{0:X8}' in '{1}'", typeID, dllLoadResult != null ? dllLoadResult.Uri : string.Empty);
@@ -91,7 +91,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
this._intrinsicTypes = new Map<uint, TypeSchema>();
TypeSchema typeSchema;
DllLoadResult.IntrinsicTypeData intrinsicTypeData;
if (!this._intrinsicTypes.TryGetValue(typeID, out typeSchema) && DllLoadResult.s_intrinsicData.TryGetValue(typeID, out intrinsicTypeData))
if (!this._intrinsicTypes.TryGetValue(typeID, out typeSchema) && s_intrinsicData.TryGetValue(typeID, out intrinsicTypeData))
{
typeSchema = !intrinsicTypeData.DemandCreateTypeSchema ? intrinsicTypeData.FrameworkEquivalent : new DllIntrinsicTypeSchema(this, typeID, intrinsicTypeData.FrameworkEquivalent);
this._intrinsicTypes[typeID] = typeSchema;
@@ -113,7 +113,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
this._status = LoadResultStatus.Loading;
this._schema = nativeSchema;
this._loadPass = LoadPass.Invalid;
this._component = DllLoadResult.s_nextID++;
this._component = s_nextID++;
}
public override void Load(LoadPass pass)
@@ -291,7 +291,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
public override LoadResultStatus Status => this._status;
public override LoadResult[] Dependencies => LoadResult.EmptyList;
public override LoadResult[] Dependencies => EmptyList;
public override bool Cachable => true;
@@ -305,7 +305,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
else
{
DllLoadResult.IntrinsicTypeData intrinsicTypeData;
if (DllLoadResult.s_intrinsicData.TryGetValue(marshalAs, out intrinsicTypeData))
if (s_intrinsicData.TryGetValue(marshalAs, out intrinsicTypeData))
type = intrinsicTypeData.MarshalAsRuntimeType;
}
return type;
@@ -22,19 +22,19 @@ namespace Microsoft.Iris.CodeModel.Cpp
private static Map<uint, DllLoadResult> s_loadResultIDCache = new Map<uint, DllLoadResult>();
private static Map<string, DllLoadResultFactory> s_dllFactoriesCache = new Map<string, DllLoadResultFactory>();
public static void Startup() => MarkupSystem.RegisterFactoryByProtocol("dll://", new CreateLoadResultHandler(DllLoadResultFactory.GetLoadResult));
public static void Startup() => MarkupSystem.RegisterFactoryByProtocol("dll://", new CreateLoadResultHandler(GetLoadResult));
public static DllLoadResult GetLoadResultByID(uint id)
{
DllLoadResult dllLoadResult;
DllLoadResultFactory.s_loadResultIDCache.TryGetValue(id, out dllLoadResult);
s_loadResultIDCache.TryGetValue(id, out dllLoadResult);
return dllLoadResult;
}
private static LoadResult GetLoadResult(string uri)
{
DllLoadResult dllLoadResult;
if (DllLoadResultFactory.s_loadResultCache.TryGetValue(uri, out dllLoadResult))
if (s_loadResultCache.TryGetValue(uri, out dllLoadResult))
return dllLoadResult;
int length = uri.IndexOf('!');
string str;
@@ -50,16 +50,16 @@ namespace Microsoft.Iris.CodeModel.Cpp
qualifier = null;
}
DllLoadResultFactory loadResultFactory;
if (!DllLoadResultFactory.s_dllFactoriesCache.TryGetValue(str, out loadResultFactory))
if (!s_dllFactoriesCache.TryGetValue(str, out loadResultFactory))
{
loadResultFactory = new DllLoadResultFactory(str);
DllLoadResultFactory.s_dllFactoriesCache[str] = loadResultFactory;
s_dllFactoriesCache[str] = loadResultFactory;
}
DllLoadResult loadResult = loadResultFactory.GetLoadResult(uri, qualifier);
if (loadResult != null)
{
DllLoadResultFactory.s_loadResultCache[uri] = loadResult;
DllLoadResultFactory.s_loadResultIDCache[loadResult.SchemaComponent] = loadResult;
s_loadResultCache[uri] = loadResult;
s_loadResultIDCache[loadResult.SchemaComponent] = loadResult;
}
return loadResult;
}
@@ -76,7 +76,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
protected override void OnDispose()
{
base.OnDispose();
DllLoadResultFactory.s_dllFactoriesCache.Remove(this._dllName);
s_dllFactoriesCache.Remove(this._dllName);
if (this._schemaFactory != IntPtr.Zero)
{
NativeApi.SpReleaseExternalObject(this._schemaFactory);
@@ -110,8 +110,8 @@ namespace Microsoft.Iris.CodeModel.Cpp
public void NotifyLoadResultDisposed(DllLoadResult loadResult)
{
DllLoadResultFactory.s_loadResultCache.Remove(loadResult.Uri);
DllLoadResultFactory.s_loadResultIDCache.Remove(loadResult.SchemaComponent);
s_loadResultCache.Remove(loadResult.Uri);
s_loadResultIDCache.Remove(loadResult.SchemaComponent);
this.UnregisterUsage(loadResult);
}
}
@@ -54,11 +54,11 @@ namespace Microsoft.Iris.CodeModel.Cpp
public override TypeSchema AlternateType => (TypeSchema)null;
public override bool CanRead => this.GetBit(DllPropertySchema.Bits.CanRead);
public override bool CanRead => this.GetBit(Bits.CanRead);
public override bool CanWrite => this.GetBit(DllPropertySchema.Bits.CanWrite);
public override bool CanWrite => this.GetBit(Bits.CanWrite);
public override bool IsStatic => this.GetBit(DllPropertySchema.Bits.IsStatic);
public override bool IsStatic => this.GetBit(Bits.IsStatic);
public override ExpressionRestriction ExpressionRestriction => ExpressionRestriction.None;
@@ -66,7 +66,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
public override RangeValidator RangeValidator => (RangeValidator)null;
public override bool NotifiesOnChange => this.GetBit(DllPropertySchema.Bits.NotifiesOnChange);
public override bool NotifiesOnChange => this.GetBit(Bits.NotifiesOnChange);
private DllTypeSchema OwnerTypeSchema => (DllTypeSchema)this.Owner;
@@ -106,7 +106,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
bool canRead;
if (this.CheckNativeReturn(NativeApi.SpQueryPropertyCanRead(property, out canRead)))
{
this.SetBit(DllPropertySchema.Bits.CanRead, canRead);
this.SetBit(Bits.CanRead, canRead);
flag = true;
}
return flag;
@@ -118,7 +118,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
bool canWrite;
if (this.CheckNativeReturn(NativeApi.SpQueryPropertyCanWrite(property, out canWrite)))
{
this.SetBit(DllPropertySchema.Bits.CanWrite, canWrite);
this.SetBit(Bits.CanWrite, canWrite);
flag = true;
}
return flag;
@@ -130,7 +130,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
bool isStatic;
if (this.CheckNativeReturn(NativeApi.SpQueryPropertyIsStatic(property, out isStatic)))
{
this.SetBit(DllPropertySchema.Bits.IsStatic, isStatic);
this.SetBit(Bits.IsStatic, isStatic);
flag = true;
}
return flag;
@@ -144,7 +144,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
bool notifiesOnChange;
if (this.CheckNativeReturn(NativeApi.SpQueryPropertyNotifiesOnChange(property, out notifiesOnChange)))
{
this.SetBit(DllPropertySchema.Bits.NotifiesOnChange, notifiesOnChange);
this.SetBit(Bits.NotifiesOnChange, notifiesOnChange);
flag = true;
}
return flag;
@@ -21,19 +21,19 @@ namespace Microsoft.Iris.CodeModel.Cpp
private static object s_finalizeLock = new object();
private static bool s_pendingAppThreadRelease = false;
private static Vector<DllProxyObject.AppThreadReleaseEntry> s_pendingReleases;
private static SimpleCallback s_releaseOnAppThread = new SimpleCallback(DllProxyObject.ReleaseFinalizedObjects);
private static SimpleCallback s_releaseOnAppThread = new SimpleCallback(ReleaseFinalizedObjects);
private static DllProxyObjectHandleTable s_handleTable;
public static void CreateHandleTable() => DllProxyObject.s_handleTable = new DllProxyObjectHandleTable();
public static void CreateHandleTable() => s_handleTable = new DllProxyObjectHandleTable();
public static void ReleaseOutstandingProxies()
{
DllProxyObject.s_pendingAppThreadRelease = true;
s_pendingAppThreadRelease = true;
GC.Collect();
GC.WaitForPendingFinalizers();
foreach (IDisposableObject disposableObject in s_handleTable)
disposableObject.Dispose(disposableObject);
DllProxyObject.ReleaseFinalizedObjects();
ReleaseFinalizedObjects();
}
public static DllProxyObject Wrap(IntPtr nativeObject)
@@ -45,7 +45,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
TypeSchema type = DllLoadResult.MapType(typeID);
if (type != null)
{
dllProxyObject = DllProxyObject.GetExistingProxy(nativeObject) ?? DllProxyObject.WrapNewObject(nativeObject, type);
dllProxyObject = GetExistingProxy(nativeObject) ?? WrapNewObject(nativeObject, type);
NativeApi.SpReleaseExternalObject(nativeObject);
}
return dllProxyObject;
@@ -56,7 +56,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
DllProxyObject dllProxyObject = null;
ulong state;
NativeApi.SpGetStateCache(nativeObject, out state);
if (state != 0UL && !DllProxyObject.s_handleTable.LookupByHandle(state, out dllProxyObject))
if (state != 0UL && !s_handleTable.LookupByHandle(state, out dllProxyObject))
ErrorManager.ReportError("IUIXObject::GetStateCache retrieved unexpected value");
return dllProxyObject;
}
@@ -66,7 +66,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
DllProxyObject dllProxyObject = null;
uint marshalAs;
IntPtr nativeImpl;
if (DllProxyObject.DetermineProxyInterfaceForObject(nativeObject, type, out marshalAs, out nativeImpl))
if (DetermineProxyInterfaceForObject(nativeObject, type, out marshalAs, out nativeImpl))
{
switch (marshalAs)
{
@@ -108,7 +108,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
flag = true;
nativeImpl = IntPtr.Zero;
}
else if (DllProxyObject.CheckNativeReturn(NativeApi.SpQueryForMarshalAsInterface(nativeObject, marshalAs, out nativeImpl)) && nativeImpl != IntPtr.Zero)
else if (CheckNativeReturn(NativeApi.SpQueryForMarshalAsInterface(nativeObject, marshalAs, out nativeImpl)) && nativeImpl != IntPtr.Zero)
flag = true;
else
ErrorManager.ReportError("Object didn't implement expected interface '{0}'", marshalAs);
@@ -117,19 +117,19 @@ namespace Microsoft.Iris.CodeModel.Cpp
protected DllProxyObject() => this._handle = 0UL;
~DllProxyObject() => DllProxyObject.RegisterAppThreadRelease(new DllProxyObject.AppThreadReleaseEntry(this._nativeObject, this._handle, this.OwningLoadResult));
~DllProxyObject() => RegisterAppThreadRelease(new DllProxyObject.AppThreadReleaseEntry(this._nativeObject, this._handle, this.OwningLoadResult));
protected static void RegisterAppThreadRelease(DllProxyObject.AppThreadReleaseEntry entry)
{
lock (DllProxyObject.s_finalizeLock)
lock (s_finalizeLock)
{
if (DllProxyObject.s_pendingReleases == null)
DllProxyObject.s_pendingReleases = new Vector<DllProxyObject.AppThreadReleaseEntry>();
DllProxyObject.s_pendingReleases.Add(entry);
if (DllProxyObject.s_pendingAppThreadRelease)
if (s_pendingReleases == null)
s_pendingReleases = new Vector<DllProxyObject.AppThreadReleaseEntry>();
s_pendingReleases.Add(entry);
if (s_pendingAppThreadRelease)
return;
DllProxyObject.s_pendingAppThreadRelease = true;
DeferredCall.Post(DispatchPriority.Idle, DllProxyObject.s_releaseOnAppThread);
s_pendingAppThreadRelease = true;
DeferredCall.Post(DispatchPriority.Idle, s_releaseOnAppThread);
}
}
@@ -138,7 +138,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
this._type = type;
this._nativeObject = nativeObject;
this.OwningLoadResult.RegisterProxyUsage();
this._handle = DllProxyObject.s_handleTable.RegisterProxy(this);
this._handle = s_handleTable.RegisterProxy(this);
NativeApi.SpSetStateCache(this._nativeObject, this._handle);
NativeApi.SpAddRefExternalObject(this._nativeObject);
this.LoadWorker(nativeObject, marshalAs);
@@ -151,7 +151,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
public static HRESULT OnChangeNotification(IntPtr nativeObject, uint id)
{
HRESULT hresult = new HRESULT(0);
DllProxyObject existingProxy = DllProxyObject.GetExistingProxy(nativeObject);
DllProxyObject existingProxy = GetExistingProxy(nativeObject);
if (existingProxy != null)
{
string id1 = null;
@@ -204,22 +204,22 @@ namespace Microsoft.Iris.CodeModel.Cpp
private static void ReleaseFinalizedObjects()
{
Vector<DllProxyObject.AppThreadReleaseEntry> pendingReleases;
lock (DllProxyObject.s_finalizeLock)
lock (s_finalizeLock)
{
pendingReleases = DllProxyObject.s_pendingReleases;
DllProxyObject.s_pendingReleases = null;
DllProxyObject.s_pendingAppThreadRelease = false;
pendingReleases = s_pendingReleases;
s_pendingReleases = null;
s_pendingAppThreadRelease = false;
}
if (pendingReleases == null || pendingReleases.Count == 0)
return;
foreach (DllProxyObject.AppThreadReleaseEntry threadReleaseEntry in pendingReleases)
threadReleaseEntry.Release();
lock (DllProxyObject.s_finalizeLock)
lock (s_finalizeLock)
{
if (DllProxyObject.s_pendingAppThreadRelease)
if (s_pendingAppThreadRelease)
return;
pendingReleases.Clear();
DllProxyObject.s_pendingReleases = pendingReleases;
s_pendingReleases = pendingReleases;
}
}
@@ -256,7 +256,7 @@ namespace Microsoft.Iris.CodeModel.Cpp
{
if (this._releaseHandle)
{
DllProxyObject.s_handleTable.ReleaseProxy(this._handle);
s_handleTable.ReleaseProxy(this._handle);
ulong state;
NativeApi.SpGetStateCache(this._nativeObject, out state);
if ((long)this._handle == (long)state)

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