Removed unnecessary casts

This commit is contained in:
Joshua Askharoun
2021-03-31 17:15:06 -05:00
parent f7d5fa4120
commit 9b09412b45
587 changed files with 7864 additions and 7862 deletions
+29 -29
View File
@@ -41,7 +41,7 @@ namespace Microsoft.Iris.Accessibility
private static readonly DataCookie s_popupStateSlot = DataCookie.ReserveSlot(); private static readonly DataCookie s_popupStateSlot = DataCookie.ReserveSlot();
private static readonly DataCookie s_multiSelectableStateSlot = DataCookie.ReserveSlot(); private static readonly DataCookie s_multiSelectableStateSlot = DataCookie.ReserveSlot();
public Accessible() => this.SetData(Accessible.s_roleSlot, (object)AccRole.Client); public Accessible() => this.SetData(Accessible.s_roleSlot, AccRole.Client);
public void Attach(AccessibleProxy proxy) public void Attach(AccessibleProxy proxy)
{ {
@@ -51,8 +51,8 @@ namespace Microsoft.Iris.Accessibility
public void Detach() public void Detach()
{ {
this.SetData(Accessible.s_defaultActionCommandSlot, (object)null); this.SetData(Accessible.s_defaultActionCommandSlot, null);
this._proxy = (AccessibleProxy)null; this._proxy = null;
} }
public bool Enabled => this._proxy != null; public bool Enabled => this._proxy != null;
@@ -65,7 +65,7 @@ namespace Microsoft.Iris.Accessibility
string description = this.Description; string description = this.Description;
if (!(value != description)) if (!(value != description))
return; return;
this.SetData(Accessible.s_descriptionSlot, (object)value); this.SetData(Accessible.s_descriptionSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Description, AccessibleProperty.Description); this.FireAccessiblePropertyChanged(NotificationID.Description, AccessibleProperty.Description);
} }
} }
@@ -78,7 +78,7 @@ namespace Microsoft.Iris.Accessibility
string defaultAction = this.DefaultAction; string defaultAction = this.DefaultAction;
if (!(value != defaultAction)) if (!(value != defaultAction))
return; return;
this.SetData(Accessible.s_defaultActionSlot, (object)value); this.SetData(Accessible.s_defaultActionSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.DefaultAction, AccessibleProperty.DefaultAction); this.FireAccessiblePropertyChanged(NotificationID.DefaultAction, AccessibleProperty.DefaultAction);
} }
} }
@@ -91,7 +91,7 @@ namespace Microsoft.Iris.Accessibility
IUICommand defaultActionCommand = this.DefaultActionCommand; IUICommand defaultActionCommand = this.DefaultActionCommand;
if (value == defaultActionCommand) if (value == defaultActionCommand)
return; return;
this.SetData(Accessible.s_defaultActionCommandSlot, (object)value); this.SetData(Accessible.s_defaultActionCommandSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.DefaultActionCommand, AccessibleProperty.DefaultActionCommand); this.FireAccessiblePropertyChanged(NotificationID.DefaultActionCommand, AccessibleProperty.DefaultActionCommand);
} }
} }
@@ -104,7 +104,7 @@ namespace Microsoft.Iris.Accessibility
string help = this.Help; string help = this.Help;
if (!(value != help)) if (!(value != help))
return; return;
this.SetData(Accessible.s_helpSlot, (object)value); this.SetData(Accessible.s_helpSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Help, AccessibleProperty.Help); this.FireAccessiblePropertyChanged(NotificationID.Help, AccessibleProperty.Help);
} }
} }
@@ -121,7 +121,7 @@ namespace Microsoft.Iris.Accessibility
int helpTopic = this.HelpTopic; int helpTopic = this.HelpTopic;
if (value == helpTopic) if (value == helpTopic)
return; return;
this.SetData(Accessible.s_helpTopicSlot, (object)value); this.SetData(Accessible.s_helpTopicSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.HelpTopic, AccessibleProperty.HelpTopic); this.FireAccessiblePropertyChanged(NotificationID.HelpTopic, AccessibleProperty.HelpTopic);
} }
} }
@@ -134,7 +134,7 @@ namespace Microsoft.Iris.Accessibility
string keyboardShortcut = this.KeyboardShortcut; string keyboardShortcut = this.KeyboardShortcut;
if (!(value != keyboardShortcut)) if (!(value != keyboardShortcut))
return; return;
this.SetData(Accessible.s_keyboardShortcutSlot, (object)value); this.SetData(Accessible.s_keyboardShortcutSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.KeyboardShortcut, AccessibleProperty.KeyboardShortcut); this.FireAccessiblePropertyChanged(NotificationID.KeyboardShortcut, AccessibleProperty.KeyboardShortcut);
} }
} }
@@ -147,7 +147,7 @@ namespace Microsoft.Iris.Accessibility
string name = this.Name; string name = this.Name;
if (!(value != name)) if (!(value != name))
return; return;
this.SetData(Accessible.s_nameSlot, (object)value); this.SetData(Accessible.s_nameSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Name, AccessibleProperty.Name); this.FireAccessiblePropertyChanged(NotificationID.Name, AccessibleProperty.Name);
} }
} }
@@ -164,7 +164,7 @@ namespace Microsoft.Iris.Accessibility
AccRole role = this.Role; AccRole role = this.Role;
if (value == role) if (value == role)
return; return;
this.SetData(Accessible.s_roleSlot, (object)value); this.SetData(Accessible.s_roleSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Role, AccessibleProperty.Role); this.FireAccessiblePropertyChanged(NotificationID.Role, AccessibleProperty.Role);
} }
} }
@@ -177,7 +177,7 @@ namespace Microsoft.Iris.Accessibility
string str = this.Value; string str = this.Value;
if (!(value != str)) if (!(value != str))
return; return;
this.SetData(Accessible.s_valueSlot, (object)value); this.SetData(Accessible.s_valueSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.Value, AccessibleProperty.Value); this.FireAccessiblePropertyChanged(NotificationID.Value, AccessibleProperty.Value);
} }
} }
@@ -194,7 +194,7 @@ namespace Microsoft.Iris.Accessibility
bool isAnimated = this.IsAnimated; bool isAnimated = this.IsAnimated;
if (value == isAnimated) if (value == isAnimated)
return; return;
this.SetData(Accessible.s_animatedStateSlot, (object)value); this.SetData(Accessible.s_animatedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsAnimated, AccessibleProperty.IsAnimated); this.FireAccessiblePropertyChanged(NotificationID.IsAnimated, AccessibleProperty.IsAnimated);
} }
} }
@@ -211,7 +211,7 @@ namespace Microsoft.Iris.Accessibility
bool isUnavailable = this.IsUnavailable; bool isUnavailable = this.IsUnavailable;
if (value == isUnavailable) if (value == isUnavailable)
return; return;
this.SetData(Accessible.s_unavailableStateSlot, (object)value); this.SetData(Accessible.s_unavailableStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsUnavailable, AccessibleProperty.IsUnavailable); this.FireAccessiblePropertyChanged(NotificationID.IsUnavailable, AccessibleProperty.IsUnavailable);
} }
} }
@@ -228,7 +228,7 @@ namespace Microsoft.Iris.Accessibility
bool isSelected = this.IsSelected; bool isSelected = this.IsSelected;
if (value == isSelected) if (value == isSelected)
return; return;
this.SetData(Accessible.s_selectedStateSlot, (object)value); this.SetData(Accessible.s_selectedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsSelected, AccessibleProperty.IsSelected); this.FireAccessiblePropertyChanged(NotificationID.IsSelected, AccessibleProperty.IsSelected);
} }
} }
@@ -245,7 +245,7 @@ namespace Microsoft.Iris.Accessibility
bool isBusy = this.IsBusy; bool isBusy = this.IsBusy;
if (value == isBusy) if (value == isBusy)
return; return;
this.SetData(Accessible.s_busyStateSlot, (object)value); this.SetData(Accessible.s_busyStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsBusy, AccessibleProperty.IsBusy); this.FireAccessiblePropertyChanged(NotificationID.IsBusy, AccessibleProperty.IsBusy);
} }
} }
@@ -262,7 +262,7 @@ namespace Microsoft.Iris.Accessibility
bool isPressed = this.IsPressed; bool isPressed = this.IsPressed;
if (value == isPressed) if (value == isPressed)
return; return;
this.SetData(Accessible.s_pressedStateSlot, (object)value); this.SetData(Accessible.s_pressedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsPressed, AccessibleProperty.IsPressed); this.FireAccessiblePropertyChanged(NotificationID.IsPressed, AccessibleProperty.IsPressed);
} }
} }
@@ -279,7 +279,7 @@ namespace Microsoft.Iris.Accessibility
bool isChecked = this.IsChecked; bool isChecked = this.IsChecked;
if (value == isChecked) if (value == isChecked)
return; return;
this.SetData(Accessible.s_checkedStateSlot, (object)value); this.SetData(Accessible.s_checkedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsChecked, AccessibleProperty.IsChecked); this.FireAccessiblePropertyChanged(NotificationID.IsChecked, AccessibleProperty.IsChecked);
} }
} }
@@ -296,7 +296,7 @@ namespace Microsoft.Iris.Accessibility
bool isCollapsed = this.IsCollapsed; bool isCollapsed = this.IsCollapsed;
if (value == isCollapsed) if (value == isCollapsed)
return; return;
this.SetData(Accessible.s_collapsedStateSlot, (object)value); this.SetData(Accessible.s_collapsedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsCollapsed, AccessibleProperty.IsCollapsed); this.FireAccessiblePropertyChanged(NotificationID.IsCollapsed, AccessibleProperty.IsCollapsed);
} }
} }
@@ -313,7 +313,7 @@ namespace Microsoft.Iris.Accessibility
bool isDefault = this.IsDefault; bool isDefault = this.IsDefault;
if (value == isDefault) if (value == isDefault)
return; return;
this.SetData(Accessible.s_defaultStateSlot, (object)value); this.SetData(Accessible.s_defaultStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsDefault, AccessibleProperty.IsDefault); this.FireAccessiblePropertyChanged(NotificationID.IsDefault, AccessibleProperty.IsDefault);
} }
} }
@@ -330,7 +330,7 @@ namespace Microsoft.Iris.Accessibility
bool isMarquee = this.IsMarquee; bool isMarquee = this.IsMarquee;
if (value == isMarquee) if (value == isMarquee)
return; return;
this.SetData(Accessible.s_marqueeStateSlot, (object)value); this.SetData(Accessible.s_marqueeStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsMarquee, AccessibleProperty.IsMarquee); this.FireAccessiblePropertyChanged(NotificationID.IsMarquee, AccessibleProperty.IsMarquee);
} }
} }
@@ -347,7 +347,7 @@ namespace Microsoft.Iris.Accessibility
bool isMixed = this.IsMixed; bool isMixed = this.IsMixed;
if (value == isMixed) if (value == isMixed)
return; return;
this.SetData(Accessible.s_mixedStateSlot, (object)value); this.SetData(Accessible.s_mixedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsMixed, AccessibleProperty.IsMixed); this.FireAccessiblePropertyChanged(NotificationID.IsMixed, AccessibleProperty.IsMixed);
} }
} }
@@ -364,7 +364,7 @@ namespace Microsoft.Iris.Accessibility
bool isExpanded = this.IsExpanded; bool isExpanded = this.IsExpanded;
if (value == isExpanded) if (value == isExpanded)
return; return;
this.SetData(Accessible.s_expandedStateSlot, (object)value); this.SetData(Accessible.s_expandedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsExpanded, AccessibleProperty.IsExpanded); this.FireAccessiblePropertyChanged(NotificationID.IsExpanded, AccessibleProperty.IsExpanded);
} }
} }
@@ -381,7 +381,7 @@ namespace Microsoft.Iris.Accessibility
bool isTraversed = this.IsTraversed; bool isTraversed = this.IsTraversed;
if (value == isTraversed) if (value == isTraversed)
return; return;
this.SetData(Accessible.s_traversedStateSlot, (object)value); this.SetData(Accessible.s_traversedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsTraversed, AccessibleProperty.IsTraversed); this.FireAccessiblePropertyChanged(NotificationID.IsTraversed, AccessibleProperty.IsTraversed);
} }
} }
@@ -398,7 +398,7 @@ namespace Microsoft.Iris.Accessibility
bool isSelectable = this.IsSelectable; bool isSelectable = this.IsSelectable;
if (value == isSelectable) if (value == isSelectable)
return; return;
this.SetData(Accessible.s_selectableStateSlot, (object)value); this.SetData(Accessible.s_selectableStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsSelectable, AccessibleProperty.IsSelectable); this.FireAccessiblePropertyChanged(NotificationID.IsSelectable, AccessibleProperty.IsSelectable);
} }
} }
@@ -415,7 +415,7 @@ namespace Microsoft.Iris.Accessibility
bool isMultiSelectable = this.IsMultiSelectable; bool isMultiSelectable = this.IsMultiSelectable;
if (value == isMultiSelectable) if (value == isMultiSelectable)
return; return;
this.SetData(Accessible.s_multiSelectableStateSlot, (object)value); this.SetData(Accessible.s_multiSelectableStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsMultiSelectable, AccessibleProperty.IsMultiSelectable); this.FireAccessiblePropertyChanged(NotificationID.IsMultiSelectable, AccessibleProperty.IsMultiSelectable);
} }
} }
@@ -432,7 +432,7 @@ namespace Microsoft.Iris.Accessibility
bool isProtected = this.IsProtected; bool isProtected = this.IsProtected;
if (value == isProtected) if (value == isProtected)
return; return;
this.SetData(Accessible.s_protectedStateSlot, (object)value); this.SetData(Accessible.s_protectedStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.IsProtected, AccessibleProperty.IsProtected); this.FireAccessiblePropertyChanged(NotificationID.IsProtected, AccessibleProperty.IsProtected);
} }
} }
@@ -449,7 +449,7 @@ namespace Microsoft.Iris.Accessibility
bool hasPopup = this.HasPopup; bool hasPopup = this.HasPopup;
if (value == hasPopup) if (value == hasPopup)
return; return;
this.SetData(Accessible.s_popupStateSlot, (object)value); this.SetData(Accessible.s_popupStateSlot, value);
this.FireAccessiblePropertyChanged(NotificationID.HasPopup, AccessibleProperty.HasPopup); this.FireAccessiblePropertyChanged(NotificationID.HasPopup, AccessibleProperty.HasPopup);
} }
} }
@@ -467,7 +467,7 @@ namespace Microsoft.Iris.Accessibility
{ {
if (accessibleProperty == AccessibleProperty.Name) if (accessibleProperty == AccessibleProperty.Name)
return; return;
ErrorManager.ReportWarning("Accessibility: Script modifications to the 'Accessible' object ('{0}' property) detected even though an Accessibility client is not is use. Use 'if (Accessible.Enabled) {{ ... }}' to bypass Accessible property access in this case", (object)propertyName); ErrorManager.ReportWarning("Accessibility: Script modifications to the 'Accessible' object ('{0}' property) detected even though an Accessibility client is not is use. Use 'if (Accessible.Enabled) {{ ... }}' to bypass Accessible property access in this case", propertyName);
} }
} }
@@ -29,7 +29,7 @@ namespace Microsoft.Iris.Accessibility
this._current = position; this._current = position;
} }
internal IEnumVARIANT Clone() => (IEnumVARIANT)new AccessibleChildren(this._proxy, this._current); internal IEnumVARIANT Clone() => new AccessibleChildren(this._proxy, this._current);
internal int Next(int count, object[] children) internal int Next(int count, object[] children)
{ {
@@ -43,7 +43,7 @@ namespace Microsoft.Iris.Accessibility
break; break;
} }
UIClass child = (UIClass)this._proxy.UI.Children[this._current]; UIClass child = (UIClass)this._proxy.UI.Children[this._current];
children[index] = (object)child.AccessibleProxy; children[index] = child.AccessibleProxy;
++index; ++index;
} }
while (index < count); while (index < count);
@@ -36,7 +36,7 @@ namespace Microsoft.Iris.Accessibility
this._ui = ui; this._ui = ui;
this._data = data; this._data = data;
this._data.Attach(this); this._data.Attach(this);
this._children = (IEnumVARIANT)new AccessibleChildren(this); this._children = new AccessibleChildren(this);
} }
internal UIClass UI => this._ui; internal UIClass UI => this._ui;
@@ -44,7 +44,7 @@ namespace Microsoft.Iris.Accessibility
internal void Detach() internal void Detach()
{ {
this._data.Detach(); this._data.Detach();
this._ui = (UIClass)null; this._ui = null;
if (this._proxyID == -1) if (this._proxyID == -1)
return; return;
AccessibleProxy.s_proxyFromID.Remove(this._proxyID); AccessibleProxy.s_proxyFromID.Remove(this._proxyID);
@@ -56,7 +56,7 @@ namespace Microsoft.Iris.Accessibility
set => AccessibleProxy.s_accessibilityActive = true; set => AccessibleProxy.s_accessibilityActive = true;
} }
internal virtual IAccessible Parent => this._ui.Parent != null ? (IAccessible)this._ui.Parent.AccessibleProxy : (IAccessible)null; internal virtual IAccessible Parent => this._ui.Parent != null ? _ui.Parent.AccessibleProxy : null;
internal int ChildCount => this._ui.Children.Count; internal int ChildCount => this._ui.Children.Count;
@@ -157,7 +157,7 @@ namespace Microsoft.Iris.Accessibility
internal virtual IAccessible Navigate(AccNavDirs navDir) internal virtual IAccessible Navigate(AccNavDirs navDir)
{ {
UIClass resultUI = (UIClass)null; UIClass resultUI = null;
switch (navDir) switch (navDir)
{ {
case AccNavDirs.Up: case AccNavDirs.Up:
@@ -185,7 +185,7 @@ namespace Microsoft.Iris.Accessibility
resultUI = (UIClass)this._ui.LastChild; resultUI = (UIClass)this._ui.LastChild;
break; break;
} }
return resultUI != null ? (IAccessible)resultUI.AccessibleProxy : (IAccessible)null; return resultUI != null ? resultUI.AccessibleProxy : null;
} }
internal void DoDefaultAction() internal void DoDefaultAction()
@@ -290,10 +290,10 @@ namespace Microsoft.Iris.Accessibility
private void QueueNotifyEvent(AccEvents eventType) private void QueueNotifyEvent(AccEvents eventType)
{ {
object obj = (object)new object[2] object obj = new object[2]
{ {
(object) this, this,
(object) (int) eventType (int) eventType
}; };
DeferredCall.Post(DispatchPriority.AppEvent, AccessibleProxy.s_notifyEventHandler, obj); DeferredCall.Post(DispatchPriority.AppEvent, AccessibleProxy.s_notifyEventHandler, obj);
} }
@@ -315,7 +315,7 @@ namespace Microsoft.Iris.Accessibility
get get
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
return (object)this.Parent; return Parent;
} }
} }
@@ -323,7 +323,7 @@ namespace Microsoft.Iris.Accessibility
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
this.VerifySelfChildID(varChild); this.VerifySelfChildID(varChild);
return (object)this; return this;
} }
int IAccessible.accChildCount int IAccessible.accChildCount
@@ -360,14 +360,14 @@ namespace Microsoft.Iris.Accessibility
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
this.VerifySelfChildID(varChild); this.VerifySelfChildID(varChild);
return (object)(int)this.Role; return (int)this.Role;
} }
object IAccessible.get_accState(object varChild) object IAccessible.get_accState(object varChild)
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
this.VerifySelfChildID(varChild); this.VerifySelfChildID(varChild);
return (object)(int)this.State; return (int)this.State;
} }
string IAccessible.get_accHelp(object varChild) string IAccessible.get_accHelp(object varChild)
@@ -381,7 +381,7 @@ namespace Microsoft.Iris.Accessibility
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
this.VerifySelfChildID(varChild); this.VerifySelfChildID(varChild);
pszHelpFile = (string)null; pszHelpFile = null;
return this.HelpTopic; return this.HelpTopic;
} }
@@ -397,7 +397,7 @@ namespace Microsoft.Iris.Accessibility
get get
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
return this.HasFocus ? (object)0 : (object)null; return this.HasFocus ? 0 : (object)null;
} }
} }
@@ -407,7 +407,7 @@ namespace Microsoft.Iris.Accessibility
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
Marshal.ThrowExceptionForHR(-2147467263); Marshal.ThrowExceptionForHR(-2147467263);
return (object)null; return null;
} }
} }
@@ -445,14 +445,14 @@ namespace Microsoft.Iris.Accessibility
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
this.VerifySelfChildID(varStart); this.VerifySelfChildID(varStart);
return (object)this.Navigate((AccNavDirs)navDir); return this.Navigate((AccNavDirs)navDir);
} }
object IAccessible.accHitTest(int xLeft, int yTop) object IAccessible.accHitTest(int xLeft, int yTop)
{ {
this.VerifyProxyAccess(); this.VerifyProxyAccess();
Marshal.ThrowExceptionForHR(-2147467263); Marshal.ThrowExceptionForHR(-2147467263);
return (object)null; return null;
} }
void IAccessible.accDoDefaultAction(object varChild) void IAccessible.accDoDefaultAction(object varChild)
@@ -25,7 +25,7 @@ namespace Microsoft.Iris.Accessibility
internal override IAccessible Navigate(AccNavDirs navDir) internal override IAccessible Navigate(AccNavDirs navDir)
{ {
IAccessible accessible = (IAccessible)null; IAccessible accessible = null;
switch (navDir) switch (navDir)
{ {
case AccNavDirs.Up: case AccNavDirs.Up:
@@ -34,7 +34,7 @@ namespace Microsoft.Iris.Accessibility
case AccNavDirs.Right: case AccNavDirs.Right:
case AccNavDirs.Next: case AccNavDirs.Next:
case AccNavDirs.Previous: case AccNavDirs.Previous:
accessible = (IAccessible)this._clientBridge.accNavigate((int)navDir, (object)0); accessible = (IAccessible)this._clientBridge.accNavigate((int)navDir, 0);
break; break;
case AccNavDirs.FirstChild: case AccNavDirs.FirstChild:
case AccNavDirs.LastChild: case AccNavDirs.LastChild:
+5 -5
View File
@@ -16,7 +16,7 @@ namespace Microsoft.Iris
private IList[] _lists; private IList[] _lists;
public AggregateList() public AggregateList()
: this((IList[])null) : this(null)
{ {
} }
@@ -51,7 +51,7 @@ namespace Microsoft.Iris
for (int index = 0; index < this._lists.Length; ++index) for (int index = 0; index < this._lists.Length; ++index)
{ {
if (this._lists[index] == null) if (this._lists[index] == null)
this._lists[index] = (IList)new ArrayList(); this._lists[index] = new ArrayList();
IList list = this._lists[index]; IList list = this._lists[index];
if (list is INotifyList notifyList) if (list is INotifyList notifyList)
notifyList.ContentsChanged += contentsChangedHandler; notifyList.ContentsChanged += contentsChangedHandler;
@@ -71,7 +71,7 @@ namespace Microsoft.Iris
if (list is INotifyList notifyList) if (list is INotifyList notifyList)
notifyList.ContentsChanged -= contentsChangedHandler; notifyList.ContentsChanged -= contentsChangedHandler;
if (list is IVirtualList virtualList && virtualList.SlowDataRequestsEnabled) if (list is IVirtualList virtualList && virtualList.SlowDataRequestsEnabled)
virtualList.SlowDataAcquireCompleteHandler = (SlowDataAcquireCompleteHandler)null; virtualList.SlowDataAcquireCompleteHandler = null;
} }
} }
base.OnDispose(disposing); base.OnDispose(disposing);
@@ -108,7 +108,7 @@ namespace Microsoft.Iris
private bool ChildListSlowDataAcquired(IVirtualList childList, int index) private bool ChildListSlowDataAcquired(IVirtualList childList, int index)
{ {
this.NotifySlowDataAcquireComplete(this.ListIndexToMasterIndex((IList)childList, index)); this.NotifySlowDataAcquireComplete(this.ListIndexToMasterIndex(childList, index));
return true; return true;
} }
@@ -171,7 +171,7 @@ namespace Microsoft.Iris
{ {
int num = 0; int num = 0;
int index1 = 0; int index1 = 0;
list = (IList)null; list = null;
for (; index1 < this._lists.Length; ++index1) for (; index1 < this._lists.Length; ++index1)
{ {
list = this._lists[index1]; list = this._lists[index1];
+19 -19
View File
@@ -40,13 +40,13 @@ namespace Microsoft.Iris.Animations
if (animationCollection != null) if (animationCollection != null)
{ {
foreach (DisposableObject disposableObject in animationCollection) foreach (DisposableObject disposableObject in animationCollection)
disposableObject.Dispose((object)this); disposableObject.Dispose(this);
this.FireComplete(false); this.FireComplete(false);
} }
this._session = (UISession)null; this._session = null;
this._animatableTarget = (IAnimatable)null; this._animatableTarget = null;
this._template = (AnimationTemplate)null; this._template = null;
this._ready = (Vector<AnimationProxy>)null; this._ready = null;
} }
public UISession Session => this._session; public UISession Session => this._session;
@@ -62,7 +62,7 @@ namespace Microsoft.Iris.Animations
public void Play() public void Play()
{ {
Vector<AnimationProxy> ready = this._ready; Vector<AnimationProxy> ready = this._ready;
this._ready = (Vector<AnimationProxy>)null; this._ready = null;
if (ready.Count > 0) if (ready.Count > 0)
{ {
foreach (AnimationProxy animationProxy in ready) foreach (AnimationProxy animationProxy in ready)
@@ -77,7 +77,7 @@ namespace Microsoft.Iris.Animations
} }
} }
public void Stop() => this.Stop((StopCommandSet)null); public void Stop() => this.Stop(null);
public void Stop(StopCommandSet stopSetCommand) public void Stop(StopCommandSet stopSetCommand)
{ {
@@ -91,7 +91,7 @@ namespace Microsoft.Iris.Animations
{ {
if (!this.Session.IsValid) if (!this.Session.IsValid)
return; return;
DeferredCall.Post(DispatchPriority.High, new DeferredHandler(this.DeferredStop), (object)stopSetCommand); DeferredCall.Post(DispatchPriority.High, new DeferredHandler(this.DeferredStop), stopSetCommand);
} }
catch (InvalidOperationException ex) catch (InvalidOperationException ex)
{ {
@@ -126,7 +126,7 @@ namespace Microsoft.Iris.Animations
internal void OnAttachChildAnimation(AnimationProxy child) internal void OnAttachChildAnimation(AnimationProxy child)
{ {
child.DeclareOwner((object)this); child.DeclareOwner(this);
this._ready.Add(child); this._ready.Add(child);
} }
@@ -138,8 +138,8 @@ namespace Microsoft.Iris.Animations
if (animationCollection == null) if (animationCollection == null)
return; return;
animationCollection.Remove(child); animationCollection.Remove(child);
child.Dispose((object)this); child.Dispose(this);
if ((double)this._lastProgress < (double)progress) if (_lastProgress < (double)progress)
this._lastProgress = progress; this._lastProgress = progress;
if (animationCollection != this._playing || animationCollection.Count != 0) if (animationCollection != this._playing || animationCollection.Count != 0)
return; return;
@@ -151,13 +151,13 @@ namespace Microsoft.Iris.Animations
private void FireComplete(bool notify) private void FireComplete(bool notify)
{ {
if (this._playing != null) if (this._playing != null)
this._playing = (Vector<AnimationProxy>)null; this._playing = null;
this.OnStop(this._lastProgress, notify); this.OnStop(this._lastProgress, notify);
} }
public StopCommandSet GetStopCommandSet() public StopCommandSet GetStopCommandSet()
{ {
StopCommandSet stopCommandSet = (StopCommandSet)null; StopCommandSet stopCommandSet = null;
foreach (AnimationProxy animation in this.GetAnimationCollection()) foreach (AnimationProxy animation in this.GetAnimationCollection())
{ {
if (animation.HasDynamicKeyframes) if (animation.HasDynamicKeyframes)
@@ -258,8 +258,8 @@ namespace Microsoft.Iris.Animations
else else
{ {
Animation template = this._template as Animation; Animation template = this._template as Animation;
if ((object)template != null) if (template != null)
stringBuilder.Append((object)template.Type); stringBuilder.Append(template.Type);
else else
stringBuilder.Append("<Unknown>"); stringBuilder.Append("<Unknown>");
} }
@@ -285,7 +285,7 @@ namespace Microsoft.Iris.Animations
++this._playingCount; ++this._playingCount;
if (this._playingCount != 1 || this.AnimationStarted == null) if (this._playingCount != 1 || this.AnimationStarted == null)
return; return;
this.AnimationStarted((object)this, EventArgs.Empty); this.AnimationStarted(this, EventArgs.Empty);
} }
internal void OnStop(float progress, bool notify) internal void OnStop(float progress, bool notify)
@@ -293,12 +293,12 @@ namespace Microsoft.Iris.Animations
--this._playingCount; --this._playingCount;
if (notify && this._playingCount == 0) if (notify && this._playingCount == 0)
{ {
EventArgs e = (EventArgs)new AnimationCompleteArgs(progress); EventArgs e = new AnimationCompleteArgs(progress);
if (this.AnimationCompleted != null) if (this.AnimationCompleted != null)
this.AnimationCompleted((object)this, e); this.AnimationCompleted(this, e);
if (this.AfterAnimationCompleted == null) if (this.AfterAnimationCompleted == null)
return; return;
this.AfterAnimationCompleted((object)this, e); this.AfterAnimationCompleted(this, e);
} }
else else
{ {
@@ -26,7 +26,7 @@ namespace Microsoft.Iris.Animations
public override void MagnifyValue(float magnifyValue) public override void MagnifyValue(float magnifyValue)
{ {
float num = this.Value * magnifyValue; float num = this.Value * magnifyValue;
if ((double)num > 1.0) if (num > 1.0)
num = 1f; num = 1f;
this.Value = num; this.Value = num;
} }
+5 -5
View File
@@ -32,8 +32,8 @@ namespace Microsoft.Iris.Animations
public override object Clone() public override object Clone()
{ {
Animation animation = new Animation(); Animation animation = new Animation();
this.CloneWorker((AnimationTemplate)animation); this.CloneWorker(animation);
return (object)animation; return animation;
} }
protected override void CloneWorker(AnimationTemplate rawAnimation) protected override void CloneWorker(AnimationTemplate rawAnimation)
@@ -71,7 +71,7 @@ namespace Microsoft.Iris.Animations
{ {
if (!(this.CenterPointPercent != value)) if (!(this.CenterPointPercent != value))
return; return;
this.SetData(Animation.s_centerPointScaleProperty, (object)value); this.SetData(Animation.s_centerPointScaleProperty, value);
this.SetBit(Animation.Bits.CenterPointScale, true); this.SetBit(Animation.Bits.CenterPointScale, true);
} }
} }
@@ -83,7 +83,7 @@ namespace Microsoft.Iris.Animations
{ {
if (!(this.RotationAxis != value)) if (!(this.RotationAxis != value))
return; return;
this.SetData(Animation.s_rotationAxisProperty, (object)value); this.SetData(Animation.s_rotationAxisProperty, value);
this.SetBit(Animation.Bits.RotationAxis, true); this.SetBit(Animation.Bits.RotationAxis, true);
} }
} }
@@ -98,7 +98,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args) ref AnimationArgs args)
{ {
this.PrepareToPlay(ref args); this.PrepareToPlay(ref args);
return (AnimationTemplate)this; return this;
} }
public bool CanCache => true; public bool CanCache => true;
@@ -34,7 +34,7 @@ namespace Microsoft.Iris.Animations
public AnimationArgs(Camera cam) public AnimationArgs(Camera cam)
{ {
this.ViewItem = (ViewItem)null; this.ViewItem = null;
this.OldPosition = Vector3.Zero; this.OldPosition = Vector3.Zero;
this.OldSize = Vector2.Zero; this.OldSize = Vector2.Zero;
this.OldScale = Vector3.Zero; this.OldScale = Vector3.Zero;
@@ -30,7 +30,7 @@ namespace Microsoft.Iris.Animations
internal void FireCompleted() internal void FireCompleted()
{ {
if (this.Completed != null) if (this.Completed != null)
this.Completed((object)this, EventArgs.Empty); this.Completed(this, EventArgs.Empty);
this.FireNotification(NotificationID.Completed); this.FireNotification(NotificationID.Completed);
} }
@@ -42,7 +42,7 @@ namespace Microsoft.Iris.Animations
public void Dispose() public void Dispose()
{ {
GC.SuppressFinalize((object)this); GC.SuppressFinalize(this);
this.Dispose(true); this.Dispose(true);
} }
@@ -52,7 +52,7 @@ namespace Microsoft.Iris.Animations
if (!inDisposeFlag) if (!inDisposeFlag)
return; return;
foreach (DisposableObject orphan in this._orphans) foreach (DisposableObject orphan in this._orphans)
orphan.Dispose((object)this); orphan.Dispose(this);
this._orphans.Clear(); this._orphans.Clear();
} }
@@ -83,26 +83,26 @@ namespace Microsoft.Iris.Animations
internal IKeyframeAnimation BuildAnimation(AnimationProxy owner) internal IKeyframeAnimation BuildAnimation(AnimationProxy owner)
{ {
this.ValidateConnected(); this.ValidateConnected();
IKeyframeAnimation keyframeAnimation = (IKeyframeAnimation)null; IKeyframeAnimation keyframeAnimation = null;
switch (owner.Type) switch (owner.Type)
{ {
case AnimationType.Position: case AnimationType.Position:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultPositionInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultPositionInput);
break; break;
case AnimationType.Size: case AnimationType.Size:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultSizeInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultSizeInput);
break; break;
case AnimationType.Alpha: case AnimationType.Alpha:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultAlphaInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultAlphaInput);
break; break;
case AnimationType.Scale: case AnimationType.Scale:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultScaleInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultScaleInput);
break; break;
case AnimationType.Rotate: case AnimationType.Rotate:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultRotationInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultRotationInput);
break; break;
case AnimationType.Orientation: case AnimationType.Orientation:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultOrientationInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultOrientationInput);
break; break;
case AnimationType.PositionX: case AnimationType.PositionX:
case AnimationType.PositionY: case AnimationType.PositionY:
@@ -111,28 +111,28 @@ namespace Microsoft.Iris.Animations
case AnimationType.ScaleX: case AnimationType.ScaleX:
case AnimationType.ScaleY: case AnimationType.ScaleY:
case AnimationType.Float: case AnimationType.Float:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultFloatInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultFloatInput);
break; break;
case AnimationType.Vector2: case AnimationType.Vector2:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultVector2Input); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector2Input);
break; break;
case AnimationType.Vector3: case AnimationType.Vector3:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultVector3Input); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector3Input);
break; break;
case AnimationType.Vector4: case AnimationType.Vector4:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultVector4Input); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector4Input);
break; break;
case AnimationType.CameraEye: case AnimationType.CameraEye:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraEyeInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraEyeInput);
break; break;
case AnimationType.CameraAt: case AnimationType.CameraAt:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraAtInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraAtInput);
break; break;
case AnimationType.CameraUp: case AnimationType.CameraUp:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraUpInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraUpInput);
break; break;
case AnimationType.CameraZn: case AnimationType.CameraZn:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraZnInput); keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraZnInput);
break; break;
} }
return keyframeAnimation; return keyframeAnimation;
+33 -33
View File
@@ -46,8 +46,8 @@ namespace Microsoft.Iris.Animations
{ {
this._animation.RepeatCount = loopCount; this._animation.RepeatCount = loopCount;
this._animation.AsyncNotifyEvent += new AsyncNotifyHandler(this.OnAsyncNotification); this._animation.AsyncNotifyEvent += new AsyncNotifyHandler(this.OnAsyncNotification);
this._animation.AddStageEvent(AnimationStage.Complete, new AnimationEvent((IActivatable)this._animation, "AsyncNotify", 1U)); this._animation.AddStageEvent(AnimationStage.Complete, new AnimationEvent(_animation, "AsyncNotify", 1U));
this._animation.AddStageEvent(AnimationStage.Reset, new AnimationEvent((IActivatable)this._animation, "AsyncNotify", 2U)); this._animation.AddStageEvent(AnimationStage.Reset, new AnimationEvent(_animation, "AsyncNotify", 2U));
this.SetStopCommand(stopCmd); this.SetStopCommand(stopCmd);
this._activeSequence.OnAttachChildAnimation(this); this._activeSequence.OnAttachChildAnimation(this);
} }
@@ -78,19 +78,19 @@ namespace Microsoft.Iris.Animations
{ {
this._dynamicFlag = true; this._dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
if (keyframe.Multiply && (double)value != 1.0) if (keyframe.Multiply && value != 1.0)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 *= animationInput2; animationInput1 *= animationInput2;
} }
else if (!keyframe.Multiply && (double)value != 0.0) else if (!keyframe.Multiply && value != 0.0)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 += animationInput2; animationInput1 += animationInput2;
} }
} }
else else
animationInput1 = (AnimationInput)new ConstantAnimationInput(value); animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
} }
@@ -104,17 +104,17 @@ namespace Microsoft.Iris.Animations
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
if (keyframe.Multiply && value != Vector2.UnitVector) if (keyframe.Multiply && value != Vector2.UnitVector)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 *= animationInput2; animationInput1 *= animationInput2;
} }
else if (!keyframe.Multiply && value != Vector2.Zero) else if (!keyframe.Multiply && value != Vector2.Zero)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 += animationInput2; animationInput1 += animationInput2;
} }
} }
else else
animationInput1 = (AnimationInput)new ConstantAnimationInput(value); animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
} }
@@ -128,17 +128,17 @@ namespace Microsoft.Iris.Animations
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
if (keyframe.Multiply && value != Vector3.UnitVector) if (keyframe.Multiply && value != Vector3.UnitVector)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 *= animationInput2; animationInput1 *= animationInput2;
} }
else if (!keyframe.Multiply && value != Vector3.Zero) else if (!keyframe.Multiply && value != Vector3.Zero)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 += animationInput2; animationInput1 += animationInput2;
} }
} }
else else
animationInput1 = (AnimationInput)new ConstantAnimationInput(value); animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
} }
@@ -152,17 +152,17 @@ namespace Microsoft.Iris.Animations
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
if (keyframe.Multiply && value != Vector4.UnitVector) if (keyframe.Multiply && value != Vector4.UnitVector)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 *= animationInput2; animationInput1 *= animationInput2;
} }
else if (!keyframe.Multiply && value != Vector4.Zero) else if (!keyframe.Multiply && value != Vector4.Zero)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); AnimationInput animationInput2 = new ConstantAnimationInput(value);
animationInput1 += animationInput2; animationInput1 += animationInput2;
} }
} }
else else
animationInput1 = (AnimationInput)new ConstantAnimationInput(value); animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation)));
} }
@@ -182,12 +182,12 @@ namespace Microsoft.Iris.Animations
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
if (value != Rotation.Default) if (value != Rotation.Default)
{ {
AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); AnimationInput animationInput2 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians));
animationInput1 *= animationInput2; animationInput1 *= animationInput2;
} }
} }
else else
animationInput1 = (AnimationInput)new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); animationInput1 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians));
AnimationInterpolation interpolation = AnimationProxy.GenerateInterpolation(keyframe.Interpolation); AnimationInterpolation interpolation = AnimationProxy.GenerateInterpolation(keyframe.Interpolation);
interpolation.UseSphericalCombination = true; interpolation.UseSphericalCombination = true;
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, interpolation)); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, interpolation));
@@ -266,7 +266,7 @@ namespace Microsoft.Iris.Animations
{ {
if (!this.Session.IsValid) if (!this.Session.IsValid)
return; return;
DeferredCall.Post(DispatchPriority.Housekeeping, AnimationProxy.s_deferredCleanupWorker, (object)this); DeferredCall.Post(DispatchPriority.Housekeeping, AnimationProxy.s_deferredCleanupWorker, this);
} }
} }
@@ -276,10 +276,10 @@ namespace Microsoft.Iris.Animations
if (this._animation != null) if (this._animation != null)
{ {
this._animation.AsyncNotifyEvent -= new AsyncNotifyHandler(this.OnAsyncNotification); this._animation.AsyncNotifyEvent -= new AsyncNotifyHandler(this.OnAsyncNotification);
this._animation.UnregisterUsage((object)this); this._animation.UnregisterUsage(this);
this._animation = (IKeyframeAnimation)null; this._animation = null;
} }
this._animatableTarget = (IAnimatable)null; this._animatableTarget = null;
if (!withNotifications) if (!withNotifications)
return; return;
this._activeSequence.OnDetachChildAnimation(this, progress); this._activeSequence.OnDetachChildAnimation(this, progress);
@@ -291,29 +291,29 @@ namespace Microsoft.Iris.Animations
Interpolation interpolation) Interpolation interpolation)
{ {
if (interpolation == null) if (interpolation == null)
return (AnimationInterpolation)new LinearInterpolation(); return new LinearInterpolation();
switch (interpolation.Type) switch (interpolation.Type)
{ {
case InterpolationType.Linear: case InterpolationType.Linear:
return (AnimationInterpolation)new LinearInterpolation(); return new LinearInterpolation();
case InterpolationType.SCurve: case InterpolationType.SCurve:
return (AnimationInterpolation)new SCurveInterpolation(interpolation.Weight * 10f); return new SCurveInterpolation(interpolation.Weight * 10f);
case InterpolationType.Exp: case InterpolationType.Exp:
return (double)interpolation.Weight > 0.0 ? (AnimationInterpolation)new ExponentialInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); return interpolation.Weight > 0.0 ? new ExponentialInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation();
case InterpolationType.Log: case InterpolationType.Log:
return (double)interpolation.Weight > 0.0 ? (AnimationInterpolation)new LogarithmicInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); return interpolation.Weight > 0.0 ? new LogarithmicInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation();
case InterpolationType.Sine: case InterpolationType.Sine:
return (AnimationInterpolation)new SineInterpolation(); return new SineInterpolation();
case InterpolationType.Cosine: case InterpolationType.Cosine:
return (AnimationInterpolation)new CosineInterpolation(); return new CosineInterpolation();
case InterpolationType.Bezier: case InterpolationType.Bezier:
return (AnimationInterpolation)new BezierInterpolation(interpolation.BezierHandle1, interpolation.BezierHandle2); return new BezierInterpolation(interpolation.BezierHandle1, interpolation.BezierHandle2);
case InterpolationType.EaseIn: case InterpolationType.EaseIn:
return (AnimationInterpolation)new EaseInInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); return new EaseInInterpolation(interpolation.Weight * 10f, interpolation.EasePercent);
case InterpolationType.EaseOut: case InterpolationType.EaseOut:
return (AnimationInterpolation)new EaseOutInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); return new EaseOutInterpolation(interpolation.Weight * 10f, interpolation.EasePercent);
default: default:
return (AnimationInterpolation)new LinearInterpolation(); return new LinearInterpolation();
} }
} }
@@ -25,11 +25,11 @@ namespace Microsoft.Iris.Animations
public static AnimationTemplate GetSequenceByID(string id) public static AnimationTemplate GetSequenceByID(string id)
{ {
if (!AnimationSystem.Enabled) if (!AnimationSystem.Enabled)
return (AnimationTemplate)null; return null;
return AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : (AnimationTemplate)null; return AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : null;
} }
public static AnimationTemplate GetSequenceByIDAlways(string id) => AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : (AnimationTemplate)null; public static AnimationTemplate GetSequenceByIDAlways(string id) => AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : null;
public static void AddSequenceByID(string id, AnimationTemplate seq) public static void AddSequenceByID(string id, AnimationTemplate seq)
{ {
@@ -40,7 +40,7 @@ namespace Microsoft.Iris.Animations
public static void ClearSequences() => AnimationSystem._sequences = new Dictionary<string, AnimationTemplate>(); public static void ClearSequences() => AnimationSystem._sequences = new Dictionary<string, AnimationTemplate>();
public static ICollection GetAllSequences() => (ICollection)AnimationSystem._sequences.Values; public static ICollection GetAllSequences() => _sequences.Values;
public static bool Enabled => AnimationSystem._enabledFlag; public static bool Enabled => AnimationSystem._enabledFlag;
@@ -23,7 +23,7 @@ namespace Microsoft.Iris.Animations
private StopCommandSet _StopCommandSet; private StopCommandSet _StopCommandSet;
public AnimationTemplate() public AnimationTemplate()
: this((string)null) : this(null)
{ {
} }
@@ -50,7 +50,7 @@ namespace Microsoft.Iris.Animations
public ActiveSequence Play(ViewItem vi) public ActiveSequence Play(ViewItem vi)
{ {
AnimationArgs args = new AnimationArgs(vi); AnimationArgs args = new AnimationArgs(vi);
return this.Play(vi.RendererVisual, ref args, (EventHandler)null); return this.Play(vi.RendererVisual, ref args, null);
} }
public ActiveSequence Play( public ActiveSequence Play(
@@ -58,7 +58,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args, ref AnimationArgs args,
EventHandler onCompleteHandler) EventHandler onCompleteHandler)
{ {
ActiveSequence instance = this.CreateInstance((IAnimatable)visualTarget, ref args); ActiveSequence instance = this.CreateInstance(visualTarget, ref args);
if (onCompleteHandler != null) if (onCompleteHandler != null)
instance.AnimationCompleted += onCompleteHandler; instance.AnimationCompleted += onCompleteHandler;
instance.Play(); instance.Play();
@@ -73,7 +73,7 @@ namespace Microsoft.Iris.Animations
if (this._keyframesList.Count == 0) if (this._keyframesList.Count == 0)
{ {
ErrorManager.ReportError("Animations must have at least 2 keyframes to play"); ErrorManager.ReportError("Animations must have at least 2 keyframes to play");
return (ActiveSequence)null; return null;
} }
ActiveSequence aseq = new ActiveSequence(this, animatableTarget, UISession.Default); ActiveSequence aseq = new ActiveSequence(this, animatableTarget, UISession.Default);
AnimationProxy[] animationProxyArray = new AnimationProxy[20]; AnimationProxy[] animationProxyArray = new AnimationProxy[20];
@@ -84,7 +84,7 @@ namespace Microsoft.Iris.Animations
int type = (int)keyframes.Type; int type = (int)keyframes.Type;
keyframes.AddtoAnimation(this, aseq, property, ref args, ref animationProxyArray[type]); keyframes.AddtoAnimation(this, aseq, property, ref args, ref animationProxyArray[type]);
++numArray[type]; ++numArray[type];
flagArray[type] |= (double)keyframes.Time == 0.0; flagArray[type] |= keyframes.Time == 0.0;
} }
for (int index = 0; index <= 19; ++index) for (int index = 0; index <= 19; ++index)
{ {
@@ -93,24 +93,24 @@ namespace Microsoft.Iris.Animations
AnimationType animationType = (AnimationType)index; AnimationType animationType = (AnimationType)index;
if (numArray[index] < 2) if (numArray[index] < 2)
{ {
ErrorManager.ReportError("Animation must have at least 2 keyframes of each type. Attempted to play an animation that only has {0} keyframe of type '{1}'.", (object)numArray[index], (object)animationType); ErrorManager.ReportError("Animation must have at least 2 keyframes of each type. Attempted to play an animation that only has {0} keyframe of type '{1}'.", numArray[index], animationType);
return (ActiveSequence)null; return null;
} }
if (!flagArray[index]) if (!flagArray[index])
{ {
ErrorManager.ReportError("Animation must have a keyframe at time 0.0 for each type. Attempted to play an animation that has no start keyframe for type '{0}'", (object)animationType); ErrorManager.ReportError("Animation must have a keyframe at time 0.0 for each type. Attempted to play an animation that has no start keyframe for type '{0}'", animationType);
return (ActiveSequence)null; return null;
} }
} }
} }
return !aseq.ValidatePlayable() ? (ActiveSequence)null : aseq; return !aseq.ValidatePlayable() ? null : aseq;
} }
public ActiveSequence CreateInstance( public ActiveSequence CreateInstance(
IAnimatable animatableTarget, IAnimatable animatableTarget,
ref AnimationArgs args) ref AnimationArgs args)
{ {
return this.CreateInstance(animatableTarget, (string)null, ref args); return this.CreateInstance(animatableTarget, null, ref args);
} }
public void AddKeyframe(BaseKeyframe key) => this.InsertSorted(key); public void AddKeyframe(BaseKeyframe key) => this.InsertSorted(key);
@@ -124,7 +124,7 @@ namespace Microsoft.Iris.Animations
if (AnimationTemplate.IsSameTime(time, keyframes.Time)) if (AnimationTemplate.IsSameTime(time, keyframes.Time))
return keyframes; return keyframes;
} }
return (BaseKeyframe)null; return null;
} }
public void RemoveKeyframe(float time) public void RemoveKeyframe(float time)
@@ -158,7 +158,7 @@ namespace Microsoft.Iris.Animations
{ {
AnimationTemplate anim = new AnimationTemplate(this._debugIDName); AnimationTemplate anim = new AnimationTemplate(this._debugIDName);
this.CloneWorker(anim); this.CloneWorker(anim);
return (object)anim; return anim;
} }
protected virtual void CloneWorker(AnimationTemplate anim) protected virtual void CloneWorker(AnimationTemplate anim)
@@ -174,7 +174,7 @@ namespace Microsoft.Iris.Animations
{ {
for (int index = this._keyframesList.Count - 1; index >= 0; --index) for (int index = this._keyframesList.Count - 1; index >= 0; --index)
{ {
if ((double)this._keyframesList[index].Time < (double)key.Time) if (_keyframesList[index].Time < (double)key.Time)
{ {
this._keyframesList.Insert(index + 1, key); this._keyframesList.Insert(index + 1, key);
return; return;
@@ -186,9 +186,9 @@ namespace Microsoft.Iris.Animations
private static bool IsSameTime(float t1, float t2) private static bool IsSameTime(float t1, float t2)
{ {
float num = t2 - t1; float num = t2 - t1;
if ((double)num < 0.0) if (num < 0.0)
num *= -1f; num *= -1f;
return (double)num < 9.99999974737875E-05; return num < 9.99999974737875E-05;
} }
internal class AnimationTemplateComparer : IComparer internal class AnimationTemplateComparer : IComparer
@@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args) ref AnimationArgs args)
{ {
float effectiveValue = this.GetEffectiveValue(targetObject, this._value, ref args); float effectiveValue = this.GetEffectiveValue(targetObject, this._value, ref args);
animation.AddFloatKeyframe((BaseKeyframe)this, effectiveValue); animation.AddFloatKeyframe(this, effectiveValue);
} }
public float Value public float Value
@@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations
set => this._value = value; set => this._value = value;
} }
public override object ObjectValue => (object)this.Value; public override object ObjectValue => Value;
public virtual float GetEffectiveValue( public virtual float GetEffectiveValue(
IAnimatable targetObject, IAnimatable targetObject,
@@ -72,7 +72,7 @@ namespace Microsoft.Iris.Animations
public BaseKeyframe Clone() => (BaseKeyframe)this.MemberwiseClone(); public BaseKeyframe Clone() => (BaseKeyframe)this.MemberwiseClone();
object ICloneable.Clone() => (object)this.Clone(); object ICloneable.Clone() => this.Clone();
protected abstract void PopulateAnimationWorker( protected abstract void PopulateAnimationWorker(
IAnimatable targetObject, IAnimatable targetObject,
@@ -126,7 +126,7 @@ namespace Microsoft.Iris.Animations
if (this._relative != RelativeTo.Absolute) if (this._relative != RelativeTo.Absolute)
{ {
stringBuilder.Append(" RelativeTo=\""); stringBuilder.Append(" RelativeTo=\"");
stringBuilder.Append((object)this._relative); stringBuilder.Append(_relative);
stringBuilder.Append("\""); stringBuilder.Append("\"");
} }
stringBuilder.Append(" Value=\""); stringBuilder.Append(" Value=\"");
@@ -21,7 +21,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args) ref AnimationArgs args)
{ {
Rotation effectiveValue = this.GetEffectiveValue(targetObject, this._valueRotation, ref args); Rotation effectiveValue = this.GetEffectiveValue(targetObject, this._valueRotation, ref args);
animation.AddRotationKeyframe((BaseKeyframe)this, effectiveValue); animation.AddRotationKeyframe(this, effectiveValue);
} }
public Rotation Value public Rotation Value
@@ -30,7 +30,7 @@ namespace Microsoft.Iris.Animations
set => this._valueRotation = value; set => this._valueRotation = value;
} }
public override object ObjectValue => (object)this.Value; public override object ObjectValue => Value;
public virtual Rotation GetEffectiveValue( public virtual Rotation GetEffectiveValue(
IAnimatable targetObject, IAnimatable targetObject,
@@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args) ref AnimationArgs args)
{ {
Vector2 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args); Vector2 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args);
animation.AddVector2Keyframe((BaseKeyframe)this, effectiveValue); animation.AddVector2Keyframe(this, effectiveValue);
} }
public Vector2 Value public Vector2 Value
@@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations
set => this._valueVector = value; set => this._valueVector = value;
} }
public override object ObjectValue => (object)this.Value; public override object ObjectValue => Value;
public virtual Vector2 GetEffectiveValue( public virtual Vector2 GetEffectiveValue(
IAnimatable targetObject, IAnimatable targetObject,
@@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args) ref AnimationArgs args)
{ {
Vector3 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args); Vector3 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args);
animation.AddVector3Keyframe((BaseKeyframe)this, effectiveValue); animation.AddVector3Keyframe(this, effectiveValue);
} }
public Vector3 Value public Vector3 Value
@@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations
set => this._valueVector = value; set => this._valueVector = value;
} }
public override object ObjectValue => (object)this.Value; public override object ObjectValue => Value;
public virtual Vector3 GetEffectiveValue( public virtual Vector3 GetEffectiveValue(
IAnimatable targetObject, IAnimatable targetObject,
@@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args) ref AnimationArgs args)
{ {
Vector4 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args); Vector4 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args);
animation.AddVector4Keyframe((BaseKeyframe)this, effectiveValue); animation.AddVector4Keyframe(this, effectiveValue);
} }
public Vector4 Value public Vector4 Value
@@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations
set => this._valueVector = value; set => this._valueVector = value;
} }
public override object ObjectValue => (object)this.Value; public override object ObjectValue => Value;
public virtual Vector4 GetEffectiveValue( public virtual Vector4 GetEffectiveValue(
IAnimatable targetObject, IAnimatable targetObject,

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