Simplified usages in UIX project

This commit is contained in:
Joshua Askharoun
2021-04-02 19:10:51 -05:00
parent 2b20ca46ad
commit c07b53bb0b
464 changed files with 14054 additions and 14064 deletions
File diff suppressed because it is too large Load Diff
@@ -25,24 +25,24 @@ namespace Microsoft.Iris.Accessibility
internal AccessibleChildren(AccessibleProxy proxy, int position)
{
this._proxy = proxy;
this._current = position;
_proxy = proxy;
_current = position;
}
internal IEnumVARIANT Clone() => new AccessibleChildren(this._proxy, this._current);
internal IEnumVARIANT Clone() => new AccessibleChildren(_proxy, _current);
internal int Next(int count, object[] children)
{
int index = 0;
do
{
++this._current;
if (this._current >= this._proxy.UI.Children.Count)
++_current;
if (_current >= _proxy.UI.Children.Count)
{
this._current = this._proxy.UI.Children.Count;
_current = _proxy.UI.Children.Count;
break;
}
UIClass child = (UIClass)this._proxy.UI.Children[this._current];
UIClass child = (UIClass)_proxy.UI.Children[_current];
children[index] = child.AccessibleProxy;
++index;
}
@@ -50,47 +50,47 @@ namespace Microsoft.Iris.Accessibility
return index;
}
internal void Reset() => this._current = -1;
internal void Reset() => _current = -1;
internal bool Skip(int count)
{
this._current += count;
if (this._current < this._proxy.UI.Children.Count)
_current += count;
if (_current < _proxy.UI.Children.Count)
return true;
this._current = this._proxy.UI.Children.Count;
_current = _proxy.UI.Children.Count;
return false;
}
IEnumVARIANT IEnumVARIANT.Clone()
{
this.VerifyEnumeratorAccess();
return this.Clone();
VerifyEnumeratorAccess();
return Clone();
}
unsafe int IEnumVARIANT.Next(int celt, object[] rgVar, IntPtr pceltFetched)
{
this.VerifyEnumeratorAccess();
int num = this.Next(celt, rgVar);
VerifyEnumeratorAccess();
int num = Next(celt, rgVar);
*(int*)(void*)pceltFetched = num;
return num != celt ? 1 : 0;
}
int IEnumVARIANT.Reset()
{
this.VerifyEnumeratorAccess();
this.Reset();
VerifyEnumeratorAccess();
Reset();
return 0;
}
int IEnumVARIANT.Skip(int celt)
{
this.VerifyEnumeratorAccess();
return !this.Skip(celt) ? 1 : 0;
VerifyEnumeratorAccess();
return !Skip(celt) ? 1 : 0;
}
private void VerifyEnumeratorAccess()
{
if (this._proxy.UI != null && UIDispatcher.IsUIThread)
if (_proxy.UI != null && UIDispatcher.IsUIThread)
return;
Marshal.ThrowExceptionForHR(-2147467259);
}
@@ -33,21 +33,21 @@ namespace Microsoft.Iris.Accessibility
internal AccessibleProxy(UIClass ui, Accessible data)
{
this._ui = ui;
this._data = data;
this._data.Attach(this);
this._children = new AccessibleChildren(this);
_ui = ui;
_data = data;
_data.Attach(this);
_children = new AccessibleChildren(this);
}
internal UIClass UI => this._ui;
internal UIClass UI => _ui;
internal void Detach()
{
this._data.Detach();
this._ui = null;
if (this._proxyID == -1)
_data.Detach();
_ui = null;
if (_proxyID == -1)
return;
s_proxyFromID.Remove(this._proxyID);
s_proxyFromID.Remove(_proxyID);
}
internal static bool AccessibilityActive
@@ -56,86 +56,86 @@ namespace Microsoft.Iris.Accessibility
set => s_accessibilityActive = true;
}
internal virtual IAccessible Parent => this._ui.Parent != null ? _ui.Parent.AccessibleProxy : null;
internal virtual IAccessible Parent => _ui.Parent != null ? _ui.Parent.AccessibleProxy : null;
internal int ChildCount => this._ui.Children.Count;
internal int ChildCount => _ui.Children.Count;
internal virtual string Name
{
get => this._data.Name;
set => this._data.Name = value;
get => _data.Name;
set => _data.Name = value;
}
internal string Value
{
get => this._data.Value;
set => this._data.Value = value;
get => _data.Value;
set => _data.Value = value;
}
internal string Description => this._data.Description;
internal string Description => _data.Description;
internal AccRole Role => this._data.Role;
internal AccRole Role => _data.Role;
internal AccStates State
{
get
{
AccStates accStates = AccStates.None;
if (this._ui.DirectKeyFocus)
if (_ui.DirectKeyFocus)
accStates |= AccStates.Focused;
if (this._ui.IsKeyFocusable())
if (_ui.IsKeyFocusable())
accStates |= AccStates.Focusable;
if (this._ui.DirectMouseFocus)
if (_ui.DirectMouseFocus)
accStates |= AccStates.HotTracked;
if (!this._ui.Visible)
if (!_ui.Visible)
accStates |= AccStates.Invisible;
if (this._ui.Host != null && this._ui.Host.IsOffscreen)
if (_ui.Host != null && _ui.Host.IsOffscreen)
accStates |= AccStates.OffScreen;
if (this._data.HasPopup)
if (_data.HasPopup)
accStates |= AccStates.HasPopup;
if (this._data.IsAnimated)
if (_data.IsAnimated)
accStates |= AccStates.Animated;
if (this._data.IsBusy)
if (_data.IsBusy)
accStates |= AccStates.Busy;
if (this._data.IsChecked)
if (_data.IsChecked)
accStates |= AccStates.Checked;
if (this._data.IsCollapsed)
if (_data.IsCollapsed)
accStates |= AccStates.Collapsed;
if (this._data.IsDefault)
if (_data.IsDefault)
accStates |= AccStates.Default;
if (this._data.IsExpanded)
if (_data.IsExpanded)
accStates |= AccStates.Expanded;
if (this._data.IsMarquee)
if (_data.IsMarquee)
accStates |= AccStates.Marquee;
if (this._data.IsMixed)
if (_data.IsMixed)
accStates |= AccStates.Mixed;
if (this._data.IsMultiSelectable)
if (_data.IsMultiSelectable)
accStates |= AccStates.MultiSelectable;
if (this._data.IsPressed)
if (_data.IsPressed)
accStates |= AccStates.Pressed;
if (this._data.IsProtected)
if (_data.IsProtected)
accStates |= AccStates.Protected;
if (this._data.IsSelectable)
if (_data.IsSelectable)
accStates |= AccStates.Selectable;
if (this._data.IsSelected)
if (_data.IsSelected)
accStates |= AccStates.Selected;
if (this._data.IsTraversed)
if (_data.IsTraversed)
accStates |= AccStates.Traversed;
if (this._data.IsUnavailable)
if (_data.IsUnavailable)
accStates |= AccStates.Unavailable;
return accStates;
}
}
internal string Help => this._data.Help;
internal string Help => _data.Help;
internal int HelpTopic => this._data.HelpTopic;
internal int HelpTopic => _data.HelpTopic;
internal string KeyboardShortcut => this._data.KeyboardShortcut;
internal string KeyboardShortcut => _data.KeyboardShortcut;
internal bool HasFocus => this._ui.DirectKeyFocus;
internal bool HasFocus => _ui.DirectKeyFocus;
internal string DefaultAction => this._data.DefaultAction;
internal string DefaultAction => _data.DefaultAction;
internal Rectangle Location
{
@@ -144,7 +144,7 @@ namespace Microsoft.Iris.Accessibility
Rectangle rectangle = Rectangle.Zero;
Vector3 positionPxlVector;
Vector3 sizePxlVector;
if (this._ui.RootItem != null && ((INavigationSite)this._ui.RootItem).ComputeBounds(out positionPxlVector, out sizePxlVector))
if (_ui.RootItem != null && ((INavigationSite)_ui.RootItem).ComputeBounds(out positionPxlVector, out sizePxlVector))
{
rectangle = new Rectangle((int)positionPxlVector.X, (int)positionPxlVector.Y, (int)sizePxlVector.X, (int)sizePxlVector.Y);
Point location = rectangle.Location;
@@ -161,28 +161,28 @@ namespace Microsoft.Iris.Accessibility
switch (navDir)
{
case AccNavDirs.Up:
this._ui.FindNextFocusablePeer(Direction.North, RectangleF.Zero, out resultUI);
_ui.FindNextFocusablePeer(Direction.North, RectangleF.Zero, out resultUI);
break;
case AccNavDirs.Down:
this._ui.FindNextFocusablePeer(Direction.South, RectangleF.Zero, out resultUI);
_ui.FindNextFocusablePeer(Direction.South, RectangleF.Zero, out resultUI);
break;
case AccNavDirs.Left:
this._ui.FindNextFocusablePeer(Direction.West, RectangleF.Zero, out resultUI);
_ui.FindNextFocusablePeer(Direction.West, RectangleF.Zero, out resultUI);
break;
case AccNavDirs.Right:
this._ui.FindNextFocusablePeer(Direction.East, RectangleF.Zero, out resultUI);
_ui.FindNextFocusablePeer(Direction.East, RectangleF.Zero, out resultUI);
break;
case AccNavDirs.Next:
resultUI = (UIClass)this._ui.NextSibling;
resultUI = (UIClass)_ui.NextSibling;
break;
case AccNavDirs.Previous:
resultUI = (UIClass)this._ui.PreviousSibling;
resultUI = (UIClass)_ui.PreviousSibling;
break;
case AccNavDirs.FirstChild:
resultUI = (UIClass)this._ui.FirstChild;
resultUI = (UIClass)_ui.FirstChild;
break;
case AccNavDirs.LastChild:
resultUI = (UIClass)this._ui.LastChild;
resultUI = (UIClass)_ui.LastChild;
break;
}
return resultUI != null ? resultUI.AccessibleProxy : null;
@@ -190,9 +190,9 @@ namespace Microsoft.Iris.Accessibility
internal void DoDefaultAction()
{
if (this._data.DefaultActionCommand == null)
if (_data.DefaultActionCommand == null)
return;
this._data.DefaultActionCommand.Invoke();
_data.DefaultActionCommand.Invoke();
}
internal static void NotifyCreated(UIClass ui)
@@ -232,7 +232,7 @@ namespace Microsoft.Iris.Accessibility
internal void NotifyAccessiblePropertyChanged(AccessibleProperty property)
{
if (!this._ui.Initialized)
if (!_ui.Initialized)
return;
AccEvents eventType = AccEvents.None;
switch (property)
@@ -267,7 +267,7 @@ namespace Microsoft.Iris.Accessibility
eventType = AccEvents.ObjectHelpChange;
break;
case AccessibleProperty.IsSelected:
if (this._data.IsSelected)
if (_data.IsSelected)
{
eventType = AccEvents.ObjectSelection;
break;
@@ -285,7 +285,7 @@ namespace Microsoft.Iris.Accessibility
}
if (eventType == AccEvents.None)
return;
this.QueueNotifyEvent(eventType);
QueueNotifyEvent(eventType);
}
private void QueueNotifyEvent(AccEvents eventType)
@@ -314,15 +314,15 @@ namespace Microsoft.Iris.Accessibility
{
get
{
this.VerifyProxyAccess();
VerifyProxyAccess();
return Parent;
}
}
object IAccessible.get_accChild(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
VerifyProxyAccess();
VerifySelfChildID(varChild);
return this;
}
@@ -330,74 +330,74 @@ namespace Microsoft.Iris.Accessibility
{
get
{
this.VerifyProxyAccess();
return this.ChildCount;
VerifyProxyAccess();
return ChildCount;
}
}
string IAccessible.get_accName(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return this.Name;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return Name;
}
string IAccessible.get_accValue(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return this.Value;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return Value;
}
string IAccessible.get_accDescription(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return this.Description;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return Description;
}
object IAccessible.get_accRole(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return (int)this.Role;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return (int)Role;
}
object IAccessible.get_accState(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return (int)this.State;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return (int)State;
}
string IAccessible.get_accHelp(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return this.Help;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return Help;
}
int IAccessible.get_accHelpTopic(out string pszHelpFile, object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
VerifyProxyAccess();
VerifySelfChildID(varChild);
pszHelpFile = null;
return this.HelpTopic;
return HelpTopic;
}
string IAccessible.get_accKeyboardShortcut(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return this.KeyboardShortcut;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return KeyboardShortcut;
}
object IAccessible.accFocus
{
get
{
this.VerifyProxyAccess();
return this.HasFocus ? 0 : (object)null;
VerifyProxyAccess();
return HasFocus ? 0 : (object)null;
}
}
@@ -405,7 +405,7 @@ namespace Microsoft.Iris.Accessibility
{
get
{
this.VerifyProxyAccess();
VerifyProxyAccess();
Marshal.ThrowExceptionForHR(-2147467263);
return null;
}
@@ -413,15 +413,15 @@ namespace Microsoft.Iris.Accessibility
string IAccessible.get_accDefaultAction(object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
return this.DefaultAction;
VerifyProxyAccess();
VerifySelfChildID(varChild);
return DefaultAction;
}
void IAccessible.accSelect(int flagsSelect, object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
VerifyProxyAccess();
VerifySelfChildID(varChild);
Marshal.ThrowExceptionForHR(-2147467263);
}
@@ -432,9 +432,9 @@ namespace Microsoft.Iris.Accessibility
out int pcyHeight,
object varChild)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
Rectangle location = this.Location;
VerifyProxyAccess();
VerifySelfChildID(varChild);
Rectangle location = Location;
pxLeft = location.X;
pyTop = location.Y;
pcxWidth = location.Width;
@@ -443,65 +443,65 @@ namespace Microsoft.Iris.Accessibility
object IAccessible.accNavigate(int navDir, object varStart)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varStart);
return this.Navigate((AccNavDirs)navDir);
VerifyProxyAccess();
VerifySelfChildID(varStart);
return Navigate((AccNavDirs)navDir);
}
object IAccessible.accHitTest(int xLeft, int yTop)
{
this.VerifyProxyAccess();
VerifyProxyAccess();
Marshal.ThrowExceptionForHR(-2147467263);
return null;
}
void IAccessible.accDoDefaultAction(object varChild)
{
this.VerifyProxyAccess();
this.DoDefaultAction();
VerifyProxyAccess();
DoDefaultAction();
}
void IAccessible.set_accName(object varChild, string pszName)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
this.Name = pszName;
VerifyProxyAccess();
VerifySelfChildID(varChild);
Name = pszName;
}
void IAccessible.set_accValue(object varChild, string pszValue)
{
this.VerifyProxyAccess();
this.VerifySelfChildID(varChild);
this.Value = pszValue;
VerifyProxyAccess();
VerifySelfChildID(varChild);
Value = pszValue;
}
IEnumVARIANT IEnumVARIANT.Clone()
{
this.VerifyProxyAccess();
return this._children.Clone();
VerifyProxyAccess();
return _children.Clone();
}
int IEnumVARIANT.Next(int celt, object[] rgVar, IntPtr pceltFetched)
{
this.VerifyProxyAccess();
return this._children.Next(celt, rgVar, pceltFetched);
VerifyProxyAccess();
return _children.Next(celt, rgVar, pceltFetched);
}
int IEnumVARIANT.Reset()
{
this.VerifyProxyAccess();
return this._children.Reset();
VerifyProxyAccess();
return _children.Reset();
}
int IEnumVARIANT.Skip(int celt)
{
this.VerifyProxyAccess();
return this._children.Skip(celt);
VerifyProxyAccess();
return _children.Skip(celt);
}
private void VerifyProxyAccess()
{
if (this._ui != null && UIDispatcher.IsUIThread)
if (_ui != null && UIDispatcher.IsUIThread)
return;
Marshal.ThrowExceptionForHR(-2147467259);
}
@@ -517,12 +517,12 @@ namespace Microsoft.Iris.Accessibility
{
get
{
if (this._proxyID == -1)
if (_proxyID == -1)
{
this._proxyID = ++s_proxyIDAllocator;
s_proxyFromID[this._proxyID] = this;
_proxyID = ++s_proxyIDAllocator;
s_proxyFromID[_proxyID] = this;
}
return this._proxyID;
return _proxyID;
}
}
@@ -21,7 +21,7 @@ namespace Microsoft.Iris.Accessibility
{
}
internal override IAccessible Parent => (IAccessible)this._clientBridge.accParent;
internal override IAccessible Parent => (IAccessible)_clientBridge.accParent;
internal override IAccessible Navigate(AccNavDirs navDir)
{
@@ -34,7 +34,7 @@ namespace Microsoft.Iris.Accessibility
case AccNavDirs.Right:
case AccNavDirs.Next:
case AccNavDirs.Previous:
accessible = (IAccessible)this._clientBridge.accNavigate((int)navDir, 0);
accessible = (IAccessible)_clientBridge.accNavigate((int)navDir, 0);
break;
case AccNavDirs.FirstChild:
case AccNavDirs.LastChild:
@@ -46,8 +46,8 @@ namespace Microsoft.Iris.Accessibility
internal override string Name => UIApplication.ApplicationName;
internal IAccessible ClientBridge => this._clientBridge;
internal IAccessible ClientBridge => _clientBridge;
internal void AttachClientBridge(IAccessible clientBridge) => this._clientBridge = clientBridge;
internal void AttachClientBridge(IAccessible clientBridge) => _clientBridge = clientBridge;
}
}
+31 -31
View File
@@ -45,28 +45,28 @@ namespace Microsoft.Iris
{
if (lists == null)
lists = new IList[0];
this._lists = lists;
UIListContentsChangedHandler contentsChangedHandler = new UIListContentsChangedHandler(this.ChildListModified);
SlowDataAcquireCompleteHandler acquireCompleteHandler = new SlowDataAcquireCompleteHandler(this.ChildListSlowDataAcquired);
for (int index = 0; index < this._lists.Length; ++index)
_lists = lists;
UIListContentsChangedHandler contentsChangedHandler = new UIListContentsChangedHandler(ChildListModified);
SlowDataAcquireCompleteHandler acquireCompleteHandler = new SlowDataAcquireCompleteHandler(ChildListSlowDataAcquired);
for (int index = 0; index < _lists.Length; ++index)
{
if (this._lists[index] == null)
this._lists[index] = new ArrayList();
IList list = this._lists[index];
if (_lists[index] == null)
_lists[index] = new ArrayList();
IList list = _lists[index];
if (list is INotifyList notifyList)
notifyList.ContentsChanged += contentsChangedHandler;
if (list is IVirtualList virtualList && virtualList.SlowDataRequestsEnabled)
virtualList.SlowDataAcquireCompleteHandler = acquireCompleteHandler;
}
this.Count = this.ItemCount;
Count = ItemCount;
}
protected override void OnDispose(bool disposing)
{
if (disposing)
{
UIListContentsChangedHandler contentsChangedHandler = new UIListContentsChangedHandler(this.ChildListModified);
foreach (IList list in this._lists)
UIListContentsChangedHandler contentsChangedHandler = new UIListContentsChangedHandler(ChildListModified);
foreach (IList list in _lists)
{
if (list is INotifyList notifyList)
notifyList.ContentsChanged -= contentsChangedHandler;
@@ -79,7 +79,7 @@ namespace Microsoft.Iris
protected override object OnRequestItem(int index)
{
foreach (IList list in this._lists)
foreach (IList list in _lists)
{
if (index < list.Count)
return list[index];
@@ -90,7 +90,7 @@ namespace Microsoft.Iris
protected override void OnRequestSlowData(int index)
{
foreach (IList list in this._lists)
foreach (IList list in _lists)
{
if (index < list.Count)
{
@@ -103,43 +103,43 @@ namespace Microsoft.Iris
}
index -= list.Count;
}
this.NotifySlowDataAcquireComplete(index);
NotifySlowDataAcquireComplete(index);
}
private bool ChildListSlowDataAcquired(IVirtualList childList, int index)
{
this.NotifySlowDataAcquireComplete(this.ListIndexToMasterIndex(childList, index));
NotifySlowDataAcquireComplete(ListIndexToMasterIndex(childList, index));
return true;
}
private void ChildListModified(IList listSender, UIListContentsChangedArgs args)
{
int masterIndex1 = this.ListIndexToMasterIndex(listSender, args.OldIndex);
int masterIndex2 = this.ListIndexToMasterIndex(listSender, args.NewIndex);
int masterIndex1 = ListIndexToMasterIndex(listSender, args.OldIndex);
int masterIndex2 = ListIndexToMasterIndex(listSender, args.NewIndex);
switch (args.Type)
{
case UIListContentsChangeType.Add:
case UIListContentsChangeType.Insert:
this.Insert(masterIndex2);
Insert(masterIndex2);
break;
case UIListContentsChangeType.AddRange:
case UIListContentsChangeType.InsertRange:
this.InsertRange(masterIndex2, args.Count);
InsertRange(masterIndex2, args.Count);
break;
case UIListContentsChangeType.Remove:
this.RemoveAt(masterIndex1);
RemoveAt(masterIndex1);
break;
case UIListContentsChangeType.Move:
if (masterIndex1 == masterIndex2)
break;
this.Move(masterIndex1, masterIndex2);
Move(masterIndex1, masterIndex2);
break;
case UIListContentsChangeType.Modified:
this.Modified(masterIndex2);
Modified(masterIndex2);
break;
default:
this.Clear();
this.Count = this.ItemCount;
Clear();
Count = ItemCount;
break;
}
}
@@ -148,11 +148,11 @@ namespace Microsoft.Iris
private void DEBUG_ValidateConsistency()
{
int index1 = 0;
for (int index2 = 0; index2 < this._lists.Length; ++index2)
for (int index2 = 0; index2 < _lists.Length; ++index2)
{
for (int index3 = 0; index3 < this._lists[index2].Count; ++index3)
for (int index3 = 0; index3 < _lists[index2].Count; ++index3)
{
object obj1 = this._lists[index2][index3];
object obj1 = _lists[index2][index3];
object obj2 = this[index1];
++index1;
}
@@ -162,8 +162,8 @@ namespace Microsoft.Iris
private int ListIndexToMasterIndex(IList list, int index)
{
int num = 0;
for (int index1 = 0; index1 < this._lists.Length && this._lists[index1] != list; ++index1)
num += this._lists[index1].Count;
for (int index1 = 0; index1 < _lists.Length && _lists[index1] != list; ++index1)
num += _lists[index1].Count;
return num + index;
}
@@ -172,9 +172,9 @@ namespace Microsoft.Iris
int num = 0;
int index1 = 0;
list = null;
for (; index1 < this._lists.Length; ++index1)
for (; index1 < _lists.Length; ++index1)
{
list = this._lists[index1];
list = _lists[index1];
if (num + list.Count <= masterIndex)
num += list.Count;
else
@@ -188,7 +188,7 @@ namespace Microsoft.Iris
get
{
int num = 0;
foreach (IList list in this._lists)
foreach (IList list in _lists)
num += list.Count;
return num;
}
+57 -57
View File
@@ -27,71 +27,71 @@ namespace Microsoft.Iris.Animations
IAnimatable animatableTarget,
UISession session)
{
this._animatableTarget = animatableTarget;
this._session = session;
this._template = template_;
this._ready = new Vector<AnimationProxy>();
_animatableTarget = animatableTarget;
_session = session;
_template = template_;
_ready = new Vector<AnimationProxy>();
}
protected override void OnDispose()
{
base.OnDispose();
Vector<AnimationProxy> animationCollection = this.GetAnimationCollection();
Vector<AnimationProxy> animationCollection = GetAnimationCollection();
if (animationCollection != null)
{
foreach (DisposableObject disposableObject in animationCollection)
disposableObject.Dispose(this);
this.FireComplete(false);
FireComplete(false);
}
this._session = null;
this._animatableTarget = null;
this._template = null;
this._ready = null;
_session = null;
_animatableTarget = null;
_template = null;
_ready = null;
}
public UISession Session => this._session;
public UISession Session => _session;
internal IAnimatable Target => this._animatableTarget;
internal IAnimatable Target => _animatableTarget;
public AnimationTemplate Template => this._template;
public AnimationTemplate Template => _template;
public bool Playing => this._playing != null;
public bool Playing => _playing != null;
internal Vector<AnimationProxy> PendingProxies => this._ready;
internal Vector<AnimationProxy> PendingProxies => _ready;
public void Play()
{
Vector<AnimationProxy> ready = this._ready;
this._ready = null;
Vector<AnimationProxy> ready = _ready;
_ready = null;
if (ready.Count > 0)
{
foreach (AnimationProxy animationProxy in ready)
animationProxy.Play();
this._playing = ready;
this.FireStart();
_playing = ready;
FireStart();
}
else
{
this.FireStart();
this.FireComplete(true);
FireStart();
FireComplete(true);
}
}
public void Stop() => this.Stop(null);
public void Stop() => Stop(null);
public void Stop(StopCommandSet stopSetCommand)
{
if (UIDispatcher.IsUIThread)
{
this.StopWorker(stopSetCommand);
StopWorker(stopSetCommand);
}
else
{
try
{
if (!this.Session.IsValid)
if (!Session.IsValid)
return;
DeferredCall.Post(DispatchPriority.High, new DeferredHandler(this.DeferredStop), stopSetCommand);
DeferredCall.Post(DispatchPriority.High, new DeferredHandler(DeferredStop), stopSetCommand);
}
catch (InvalidOperationException ex)
{
@@ -101,9 +101,9 @@ namespace Microsoft.Iris.Animations
private void StopWorker(StopCommandSet stopSetCommand)
{
if (this._playing == null)
if (_playing == null)
return;
foreach (AnimationProxy animationProxy in this._playing)
foreach (AnimationProxy animationProxy in _playing)
{
if (stopSetCommand != null)
animationProxy.Stop(stopSetCommand[animationProxy.Type]);
@@ -112,11 +112,11 @@ namespace Microsoft.Iris.Animations
}
}
private void DeferredStop(object args) => this.StopWorker((StopCommandSet)args);
private void DeferredStop(object args) => StopWorker((StopCommandSet)args);
public bool ValidatePlayable()
{
foreach (AnimationProxy animationProxy in this._ready)
foreach (AnimationProxy animationProxy in _ready)
{
if (!animationProxy.ValidatePlayable())
return false;
@@ -127,38 +127,38 @@ namespace Microsoft.Iris.Animations
internal void OnAttachChildAnimation(AnimationProxy child)
{
child.DeclareOwner(this);
this._ready.Add(child);
_ready.Add(child);
}
private Vector<AnimationProxy> GetAnimationCollection() => this._ready ?? this._playing;
private Vector<AnimationProxy> GetAnimationCollection() => _ready ?? _playing;
internal void OnDetachChildAnimation(AnimationProxy child, float progress)
{
Vector<AnimationProxy> animationCollection = this.GetAnimationCollection();
Vector<AnimationProxy> animationCollection = GetAnimationCollection();
if (animationCollection == null)
return;
animationCollection.Remove(child);
child.Dispose(this);
if (_lastProgress < (double)progress)
this._lastProgress = progress;
if (animationCollection != this._playing || animationCollection.Count != 0)
_lastProgress = progress;
if (animationCollection != _playing || animationCollection.Count != 0)
return;
this.FireComplete(true);
FireComplete(true);
}
private void FireStart() => this.OnStart();
private void FireStart() => OnStart();
private void FireComplete(bool notify)
{
if (this._playing != null)
this._playing = null;
this.OnStop(this._lastProgress, notify);
if (_playing != null)
_playing = null;
OnStop(_lastProgress, notify);
}
public StopCommandSet GetStopCommandSet()
{
StopCommandSet stopCommandSet = null;
foreach (AnimationProxy animation in this.GetAnimationCollection())
foreach (AnimationProxy animation in GetAnimationCollection())
{
if (animation.HasDynamicKeyframes)
{
@@ -172,7 +172,7 @@ namespace Microsoft.Iris.Animations
public ActiveTransitions GetActiveTransitions()
{
Vector<AnimationProxy> animationCollection = this.GetAnimationCollection();
Vector<AnimationProxy> animationCollection = GetAnimationCollection();
ActiveTransitions activeTransitions = ActiveTransitions.None;
foreach (AnimationProxy animationProxy in animationCollection)
{
@@ -251,24 +251,24 @@ namespace Microsoft.Iris.Animations
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("{ActiveSequence Template=\"");
if (this._template.DebugID != null)
if (_template.DebugID != null)
{
stringBuilder.Append(this._template.DebugID);
stringBuilder.Append(_template.DebugID);
}
else
{
Animation template = this._template as Animation;
Animation template = _template as Animation;
if (template != null)
stringBuilder.Append(template.Type);
else
stringBuilder.Append("<Unknown>");
}
stringBuilder.Append("\", Target=");
stringBuilder.Append(this._animatableTarget.GetType().Name);
if (this._animatableTarget is IVisual)
stringBuilder.Append(_animatableTarget.GetType().Name);
if (_animatableTarget is IVisual)
{
stringBuilder.Append(", IVisual=");
stringBuilder.Append(((IVisual)this._animatableTarget).DebugID);
stringBuilder.Append(((IVisual)_animatableTarget).DebugID);
}
stringBuilder.Append("}");
return stringBuilder.ToString();
@@ -282,27 +282,27 @@ namespace Microsoft.Iris.Animations
internal void OnStart()
{
++this._playingCount;
if (this._playingCount != 1 || this.AnimationStarted == null)
++_playingCount;
if (_playingCount != 1 || AnimationStarted == null)
return;
this.AnimationStarted(this, EventArgs.Empty);
AnimationStarted(this, EventArgs.Empty);
}
internal void OnStop(float progress, bool notify)
{
--this._playingCount;
if (notify && this._playingCount == 0)
--_playingCount;
if (notify && _playingCount == 0)
{
EventArgs e = new AnimationCompleteArgs(progress);
if (this.AnimationCompleted != null)
this.AnimationCompleted(this, e);
if (this.AfterAnimationCompleted == null)
if (AnimationCompleted != null)
AnimationCompleted(this, e);
if (AfterAnimationCompleted == null)
return;
this.AfterAnimationCompleted(this, e);
AfterAnimationCompleted(this, e);
}
else
{
int playingCount = this._playingCount;
int playingCount = _playingCount;
}
}
}
@@ -18,17 +18,17 @@ namespace Microsoft.Iris.Animations
float baseValue,
ref AnimationArgs args)
{
return this.RelativeTo == RelativeTo.Final ? baseValue * args.NewAlpha : baseValue;
return RelativeTo == RelativeTo.Final ? baseValue * args.NewAlpha : baseValue;
}
public override void Apply(IAnimatableOwner animationTarget, float value) => ((ViewItem)animationTarget).VisualAlpha = value;
public override void MagnifyValue(float magnifyValue)
{
float num = this.Value * magnifyValue;
float num = Value * magnifyValue;
if (num > 1.0)
num = 1f;
this.Value = num;
Value = num;
}
}
}
+40 -40
View File
@@ -24,15 +24,15 @@ namespace Microsoft.Iris.Animations
public Animation()
{
this._type = AnimationEventType.Idle;
this._bitsBitVector = new BitVector32();
this._dataMap = new DynamicData();
_type = AnimationEventType.Idle;
_bitsBitVector = new BitVector32();
_dataMap = new DynamicData();
}
public override object Clone()
{
Animation animation = new Animation();
this.CloneWorker(animation);
CloneWorker(animation);
return animation;
}
@@ -40,64 +40,64 @@ namespace Microsoft.Iris.Animations
{
base.CloneWorker(rawAnimation);
Animation animation = (Animation)rawAnimation;
animation.Type = this.Type;
if (this.GetBit(Bits.CenterPointScale))
animation.CenterPointPercent = this.CenterPointPercent;
if (this.GetBit(Bits.RotationAxis))
animation.RotationAxis = this.RotationAxis;
animation.DisableMouseInput = this.DisableMouseInput;
animation.Type = Type;
if (GetBit(Bits.CenterPointScale))
animation.CenterPointPercent = CenterPointPercent;
if (GetBit(Bits.RotationAxis))
animation.RotationAxis = RotationAxis;
animation.DisableMouseInput = DisableMouseInput;
}
private void PrepareToPlay(ref AnimationArgs args)
{
if (this.GetBit(Bits.CenterPointScale))
args.ViewItem.VisualCenterPoint = this.CenterPointPercent;
if (!this.GetBit(Bits.RotationAxis))
if (GetBit(Bits.CenterPointScale))
args.ViewItem.VisualCenterPoint = CenterPointPercent;
if (!GetBit(Bits.RotationAxis))
return;
Rotation visualRotation = args.ViewItem.VisualRotation;
args.ViewItem.VisualRotation = new Rotation(visualRotation.AngleRadians, this.RotationAxis);
args.ViewItem.VisualRotation = new Rotation(visualRotation.AngleRadians, RotationAxis);
}
public AnimationEventType Type
{
get => this._type;
set => this._type = value;
get => _type;
set => _type = value;
}
public Vector3 CenterPointPercent
{
get => !this.GetBit(Bits.CenterPointScale) ? Vector3.Zero : (Vector3)this.GetData(s_centerPointScaleProperty);
get => !GetBit(Bits.CenterPointScale) ? Vector3.Zero : (Vector3)GetData(s_centerPointScaleProperty);
set
{
if (!(this.CenterPointPercent != value))
if (!(CenterPointPercent != value))
return;
this.SetData(s_centerPointScaleProperty, value);
this.SetBit(Bits.CenterPointScale, true);
SetData(s_centerPointScaleProperty, value);
SetBit(Bits.CenterPointScale, true);
}
}
public Vector3 RotationAxis
{
get => !this.GetBit(Bits.RotationAxis) ? Rotation.Default.Axis : (Vector3)this.GetData(s_rotationAxisProperty);
get => !GetBit(Bits.RotationAxis) ? Rotation.Default.Axis : (Vector3)GetData(s_rotationAxisProperty);
set
{
if (!(this.RotationAxis != value))
if (!(RotationAxis != value))
return;
this.SetData(s_rotationAxisProperty, value);
this.SetBit(Bits.RotationAxis, true);
SetData(s_rotationAxisProperty, value);
SetBit(Bits.RotationAxis, true);
}
}
public bool DisableMouseInput
{
get => this.GetBit(Bits.DisableMouseInput);
set => this.SetBit(Bits.DisableMouseInput, value);
get => GetBit(Bits.DisableMouseInput);
set => SetBit(Bits.DisableMouseInput, value);
}
AnimationTemplate IAnimationProvider.Build(
ref AnimationArgs args)
{
this.PrepareToPlay(ref args);
PrepareToPlay(ref args);
return this;
}
@@ -107,38 +107,38 @@ namespace Microsoft.Iris.Animations
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("{AnimationTemplate ID=");
stringBuilder.Append(this.DebugID);
stringBuilder.Append(DebugID);
stringBuilder.Append(", Loop=");
stringBuilder.Append(this.Loop);
stringBuilder.Append(Loop);
stringBuilder.Append(", KeyframeCount=");
stringBuilder.Append(this.Keyframes.Count);
stringBuilder.Append(Keyframes.Count);
stringBuilder.Append("}");
return stringBuilder.ToString();
}
private bool GetBit(Animation.Bits bit) => this._bitsBitVector[(int)bit];
private bool GetBit(Animation.Bits bit) => _bitsBitVector[(int)bit];
private void SetBit(Animation.Bits bit, bool value) => this._bitsBitVector[(int)bit] = value;
private void SetBit(Animation.Bits bit, bool value) => _bitsBitVector[(int)bit] = value;
private bool ChangeBit(Animation.Bits bit, bool value)
{
if (this._bitsBitVector[(int)bit] == value)
if (_bitsBitVector[(int)bit] == value)
return false;
this._bitsBitVector[(int)bit] = value;
_bitsBitVector[(int)bit] = value;
return true;
}
protected object GetData(DataCookie cookie) => this._dataMap.GetData(cookie);
protected object GetData(DataCookie cookie) => _dataMap.GetData(cookie);
protected void SetData(DataCookie cookie, object value) => this._dataMap.SetData(cookie, value);
protected void SetData(DataCookie cookie, object value) => _dataMap.SetData(cookie, value);
protected Delegate GetEventHandler(EventCookie cookie) => this._dataMap.GetEventHandler(cookie);
protected Delegate GetEventHandler(EventCookie cookie) => _dataMap.GetEventHandler(cookie);
protected void AddEventHandler(EventCookie cookie, Delegate handlerToAdd) => this._dataMap.AddEventHandler(cookie, handlerToAdd);
protected void AddEventHandler(EventCookie cookie, Delegate handlerToAdd) => _dataMap.AddEventHandler(cookie, handlerToAdd);
protected void RemoveEventHandler(EventCookie cookie, Delegate handlerToRemove) => this._dataMap.RemoveEventHandler(cookie, handlerToRemove);
protected void RemoveEventHandler(EventCookie cookie, Delegate handlerToRemove) => _dataMap.RemoveEventHandler(cookie, handlerToRemove);
protected void RemoveEventHandlers(EventCookie cookie) => this._dataMap.RemoveEventHandlers(cookie);
protected void RemoveEventHandlers(EventCookie cookie) => _dataMap.RemoveEventHandlers(cookie);
private static uint GetKey(EventCookie cookie) => EventCookie.ToUInt32(cookie);
+38 -38
View File
@@ -34,25 +34,25 @@ namespace Microsoft.Iris.Animations
public AnimationArgs(Camera cam)
{
this.ViewItem = null;
this.OldPosition = Vector3.Zero;
this.OldSize = Vector2.Zero;
this.OldScale = Vector3.Zero;
this.OldRotation = Rotation.Default;
this.OldAlpha = 0.0f;
this.NewPosition = Vector3.Zero;
this.NewSize = Vector2.Zero;
this.NewScale = Vector3.Zero;
this.NewRotation = Rotation.Default;
this.NewAlpha = 0.0f;
this.OldEye = cam.Eye;
this.NewEye = cam.Eye;
this.OldAt = cam.At;
this.NewAt = cam.At;
this.OldUp = cam.Up;
this.NewUp = cam.Up;
this.OldZn = cam.Zn;
this.NewZn = cam.Zn;
ViewItem = null;
OldPosition = Vector3.Zero;
OldSize = Vector2.Zero;
OldScale = Vector3.Zero;
OldRotation = Rotation.Default;
OldAlpha = 0.0f;
NewPosition = Vector3.Zero;
NewSize = Vector2.Zero;
NewScale = Vector3.Zero;
NewRotation = Rotation.Default;
NewAlpha = 0.0f;
OldEye = cam.Eye;
NewEye = cam.Eye;
OldAt = cam.At;
NewAt = cam.At;
OldUp = cam.Up;
NewUp = cam.Up;
OldZn = cam.Zn;
NewZn = cam.Zn;
}
public AnimationArgs(
@@ -68,25 +68,25 @@ namespace Microsoft.Iris.Animations
Rotation newRotation,
float newAlpha)
{
this.ViewItem = vi;
this.OldPosition = oldPosition;
this.OldSize = oldSize;
this.OldScale = oldScale;
this.OldRotation = oldRotation;
this.OldAlpha = oldAlpha;
this.NewPosition = newPosition;
this.NewSize = newSize;
this.NewScale = newScale;
this.NewRotation = newRotation;
this.NewAlpha = newAlpha;
this.OldEye = Vector3.Zero;
this.NewEye = Vector3.Zero;
this.OldAt = Vector3.Zero;
this.NewAt = Vector3.Zero;
this.OldUp = Vector3.Zero;
this.NewUp = Vector3.Zero;
this.OldZn = 0.0f;
this.NewZn = 0.0f;
ViewItem = vi;
OldPosition = oldPosition;
OldSize = oldSize;
OldScale = oldScale;
OldRotation = oldRotation;
OldAlpha = oldAlpha;
NewPosition = newPosition;
NewSize = newSize;
NewScale = newScale;
NewRotation = newRotation;
NewAlpha = newAlpha;
OldEye = Vector3.Zero;
NewEye = Vector3.Zero;
OldAt = Vector3.Zero;
NewAt = Vector3.Zero;
OldUp = Vector3.Zero;
NewUp = Vector3.Zero;
OldZn = 0.0f;
NewZn = 0.0f;
}
public AnimationArgs(
@@ -12,8 +12,8 @@ namespace Microsoft.Iris.Animations
{
private float _progress;
public AnimationCompleteArgs(float progress) => this._progress = progress;
public AnimationCompleteArgs(float progress) => _progress = progress;
public float Progress => this._progress;
public float Progress => _progress;
}
}
@@ -16,32 +16,32 @@ namespace Microsoft.Iris.Animations
public event EventHandler Completed;
public bool Playing => this._playing > 0;
public bool Playing => _playing > 0;
internal void AssociateWithAnimationInstance(ActiveSequence anim)
{
anim.AnimationCompleted += new EventHandler(this.OnAnimationCompleted);
++this._playing;
if (this._playing != 1)
anim.AnimationCompleted += new EventHandler(OnAnimationCompleted);
++_playing;
if (_playing != 1)
return;
this.FireNotification(NotificationID.Playing);
FireNotification(NotificationID.Playing);
}
internal void FireCompleted()
{
if (this.Completed != null)
this.Completed(this, EventArgs.Empty);
this.FireNotification(NotificationID.Completed);
if (Completed != null)
Completed(this, EventArgs.Empty);
FireNotification(NotificationID.Completed);
}
private void OnAnimationCompleted(object sender, EventArgs args)
{
((ActiveSequence)sender).AnimationCompleted -= new EventHandler(this.OnAnimationCompleted);
--this._playing;
if (this._playing != 0)
((ActiveSequence)sender).AnimationCompleted -= new EventHandler(OnAnimationCompleted);
--_playing;
if (_playing != 0)
return;
this.FireNotification(NotificationID.Playing);
this.FireCompleted();
FireNotification(NotificationID.Playing);
FireCompleted();
}
}
}
@@ -32,49 +32,49 @@ namespace Microsoft.Iris.Animations
public AnimationManager(IRenderSession session)
{
this._session = session;
this._orphans = new Vector<OrphanedVisualCollection>();
this._session.AnimationSystem.UpdatesPerSecond = session.GraphicsDevice.DeviceType != GraphicsDeviceType.Gdi ? 0 : 3;
this._session.AnimationSystem.BackCompat = true;
_session = session;
_orphans = new Vector<OrphanedVisualCollection>();
_session.AnimationSystem.UpdatesPerSecond = session.GraphicsDevice.DeviceType != GraphicsDeviceType.Gdi ? 0 : 3;
_session.AnimationSystem.BackCompat = true;
}
~AnimationManager() => this.Dispose(false);
~AnimationManager() => Dispose(false);
public void Dispose()
{
GC.SuppressFinalize(this);
this.Dispose(true);
Dispose(true);
}
protected virtual void Dispose(bool inDisposeFlag)
{
this._shuttingDown = true;
_shuttingDown = true;
if (!inDisposeFlag)
return;
foreach (DisposableObject orphan in this._orphans)
foreach (DisposableObject orphan in _orphans)
orphan.Dispose(this);
this._orphans.Clear();
_orphans.Clear();
}
internal bool ShuttingDown => this._shuttingDown;
internal bool ShuttingDown => _shuttingDown;
public void SetGlobalSpeedAdjustment(float value)
{
this.ValidateConnected();
this._session.AnimationSystem.SpeedAdjustment = value;
ValidateConnected();
_session.AnimationSystem.SpeedAdjustment = value;
}
public void PulseTimeAdvance(int pulseSize)
{
this.ValidateConnected();
this._session.AnimationSystem.PulseTimeAdvance(pulseSize);
ValidateConnected();
_session.AnimationSystem.PulseTimeAdvance(pulseSize);
}
public void RegisterAnimatedOrphans(OrphanedVisualCollection orphan) => this._orphans.Add(orphan);
public void RegisterAnimatedOrphans(OrphanedVisualCollection orphan) => _orphans.Add(orphan);
public void UnregisterAnimatedOrphans(OrphanedVisualCollection orphan) => this._orphans.Remove(orphan);
public void UnregisterAnimatedOrphans(OrphanedVisualCollection orphan) => _orphans.Remove(orphan);
public bool CanPlayAnimationType(AnimationType type) => this._session.GraphicsDevice.DeviceType != GraphicsDeviceType.Gdi || type == AnimationType.Position || (type == AnimationType.Size || type == AnimationType.Scale) || type == AnimationType.Alpha;
public bool CanPlayAnimationType(AnimationType type) => _session.GraphicsDevice.DeviceType != GraphicsDeviceType.Gdi || type == AnimationType.Position || (type == AnimationType.Size || type == AnimationType.Scale) || type == AnimationType.Alpha;
private void ValidateConnected()
{
@@ -82,27 +82,27 @@ namespace Microsoft.Iris.Animations
internal IKeyframeAnimation BuildAnimation(AnimationProxy owner)
{
this.ValidateConnected();
ValidateConnected();
IKeyframeAnimation keyframeAnimation = null;
switch (owner.Type)
{
case AnimationType.Position:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultPositionInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultPositionInput);
break;
case AnimationType.Size:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultSizeInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultSizeInput);
break;
case AnimationType.Alpha:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultAlphaInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultAlphaInput);
break;
case AnimationType.Scale:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultScaleInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultScaleInput);
break;
case AnimationType.Rotate:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultRotationInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultRotationInput);
break;
case AnimationType.Orientation:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultOrientationInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultOrientationInput);
break;
case AnimationType.PositionX:
case AnimationType.PositionY:
@@ -111,28 +111,28 @@ namespace Microsoft.Iris.Animations
case AnimationType.ScaleX:
case AnimationType.ScaleY:
case AnimationType.Float:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultFloatInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultFloatInput);
break;
case AnimationType.Vector2:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector2Input);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector2Input);
break;
case AnimationType.Vector3:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector3Input);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector3Input);
break;
case AnimationType.Vector4:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector4Input);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector4Input);
break;
case AnimationType.CameraEye:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraEyeInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraEyeInput);
break;
case AnimationType.CameraAt:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraAtInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraAtInput);
break;
case AnimationType.CameraUp:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraUpInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraUpInput);
break;
case AnimationType.CameraZn:
keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraZnInput);
keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraZnInput);
break;
}
return keyframeAnimation;
+71 -71
View File
@@ -34,50 +34,50 @@ namespace Microsoft.Iris.Animations
{
UISession.Validate(activeSequence.Session);
AnimationSystem.ValidateAnimationType(createType);
this._activeSequence = activeSequence;
this._type = createType;
this._animatableTarget = animatableTarget;
this._rendererProperty = rendererProperty;
this._animation = this._activeSequence.Session.AnimationManager.BuildAnimation(this);
this.CommonCreate(loopCount, stopCmd);
_activeSequence = activeSequence;
_type = createType;
_animatableTarget = animatableTarget;
_rendererProperty = rendererProperty;
_animation = _activeSequence.Session.AnimationManager.BuildAnimation(this);
CommonCreate(loopCount, stopCmd);
}
private void CommonCreate(int loopCount, StopCommand stopCmd)
{
this._animation.RepeatCount = loopCount;
this._animation.AsyncNotifyEvent += new AsyncNotifyHandler(this.OnAsyncNotification);
this._animation.AddStageEvent(AnimationStage.Complete, new AnimationEvent(_animation, "AsyncNotify", 1U));
this._animation.AddStageEvent(AnimationStage.Reset, new AnimationEvent(_animation, "AsyncNotify", 2U));
this.SetStopCommand(stopCmd);
this._activeSequence.OnAttachChildAnimation(this);
_animation.RepeatCount = loopCount;
_animation.AsyncNotifyEvent += new AsyncNotifyHandler(OnAsyncNotification);
_animation.AddStageEvent(AnimationStage.Complete, new AnimationEvent(_animation, "AsyncNotify", 1U));
_animation.AddStageEvent(AnimationStage.Reset, new AnimationEvent(_animation, "AsyncNotify", 2U));
SetStopCommand(stopCmd);
_activeSequence.OnAttachChildAnimation(this);
}
protected override void OnDispose()
{
this.CleanupWorker(0.0f, false);
CleanupWorker(0.0f, false);
base.OnDispose();
}
public UISession Session => this._activeSequence.Session;
public UISession Session => _activeSequence.Session;
public AnimationType Type => this._type;
public AnimationType Type => _type;
public bool HasDynamicKeyframes => this._dynamicFlag;
public bool HasDynamicKeyframes => _dynamicFlag;
internal bool DoNotAutoRelease
{
get => this._doNotAutoReleaseFlag;
set => this._doNotAutoReleaseFlag = value;
get => _doNotAutoReleaseFlag;
set => _doNotAutoReleaseFlag = value;
}
public void AddFloatKeyframe(BaseKeyframe keyframe, float value)
{
++this._keyframesValue;
++_keyframesValue;
AnimationInput animationInput1;
if (keyframe.IsRelativeToObject)
{
this._dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
_dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask);
if (keyframe.Multiply && value != 1.0)
{
AnimationInput animationInput2 = new ConstantAnimationInput(value);
@@ -91,17 +91,17 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
_animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddVector2Keyframe(BaseKeyframe keyframe, Vector2 value)
{
++this._keyframesValue;
++_keyframesValue;
AnimationInput animationInput1;
if (keyframe.IsRelativeToObject)
{
this._dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
_dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask);
if (keyframe.Multiply && value != Vector2.UnitVector)
{
AnimationInput animationInput2 = new ConstantAnimationInput(value);
@@ -115,17 +115,17 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
_animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddVector3Keyframe(BaseKeyframe keyframe, Vector3 value)
{
++this._keyframesValue;
++_keyframesValue;
AnimationInput animationInput1;
if (keyframe.IsRelativeToObject)
{
this._dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
_dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask);
if (keyframe.Multiply && value != Vector3.UnitVector)
{
AnimationInput animationInput2 = new ConstantAnimationInput(value);
@@ -139,17 +139,17 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
_animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddVector4Keyframe(BaseKeyframe keyframe, Vector4 value)
{
++this._keyframesValue;
++_keyframesValue;
AnimationInput animationInput1;
if (keyframe.IsRelativeToObject)
{
this._dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
_dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask);
if (keyframe.Multiply && value != Vector4.UnitVector)
{
AnimationInput animationInput2 = new ConstantAnimationInput(value);
@@ -163,23 +163,23 @@ namespace Microsoft.Iris.Animations
}
else
animationInput1 = new ConstantAnimationInput(value);
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
_animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation)));
}
public void AddRotationKeyframe(BaseKeyframe keyframe, Rotation value)
{
if (keyframe.Type != AnimationType.Orientation)
{
this.AddVector4Keyframe(keyframe, new Vector4(value.Axis.X, value.Axis.Y, value.Axis.Z, value.AngleRadians));
AddVector4Keyframe(keyframe, new Vector4(value.Axis.X, value.Axis.Y, value.Axis.Z, value.AngleRadians));
}
else
{
++this._keyframesValue;
++_keyframesValue;
AnimationInput animationInput1;
if (keyframe.IsRelativeToObject)
{
this._dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask);
_dynamicFlag = true;
animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask);
if (value != Rotation.Default)
{
AnimationInput animationInput2 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians));
@@ -190,7 +190,7 @@ namespace Microsoft.Iris.Animations
animationInput1 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians));
AnimationInterpolation interpolation = GenerateInterpolation(keyframe.Interpolation);
interpolation.UseSphericalCombination = true;
this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, interpolation));
_animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, interpolation));
}
}
@@ -199,21 +199,21 @@ namespace Microsoft.Iris.Animations
switch (stopCmd)
{
case StopCommand.LeaveCurrent:
this._animation.ResetBehavior = AnimationResetBehavior.LeaveCurrent;
_animation.ResetBehavior = AnimationResetBehavior.LeaveCurrent;
break;
case StopCommand.MoveToBegin:
this._animation.ResetBehavior = AnimationResetBehavior.SetInitialValue;
_animation.ResetBehavior = AnimationResetBehavior.SetInitialValue;
break;
case StopCommand.MoveToEnd:
this._animation.ResetBehavior = AnimationResetBehavior.SetFinalValue;
_animation.ResetBehavior = AnimationResetBehavior.SetFinalValue;
break;
}
this._animation.AutoReset = true;
_animation.AutoReset = true;
}
public bool ValidatePlayable()
{
if (this._keyframesValue >= 2)
if (_keyframesValue >= 2)
return true;
ErrorManager.ReportError("Animations must have at least 2 keyframes to play");
return false;
@@ -221,50 +221,50 @@ namespace Microsoft.Iris.Animations
public void Play()
{
if (!this.ValidatePlayable())
if (!ValidatePlayable())
return;
if (!this._activeSequence.Session.AnimationManager.CanPlayAnimationType(this._type))
if (!_activeSequence.Session.AnimationManager.CanPlayAnimationType(_type))
{
this.Cleanup(0.0f, true);
Cleanup(0.0f, true);
}
else
{
if (this._playingFlag || this._animation == null || !this.Session.IsValid)
if (_playingFlag || _animation == null || !Session.IsValid)
return;
this._animation.AddTarget(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.TargetMask);
this._animation.Play();
this._playingFlag = true;
_animation.AddTarget(_animatableTarget, _rendererProperty.Property, _rendererProperty.TargetMask);
_animation.Play();
_playingFlag = true;
}
}
public void Stop() => this.StopWorker(false, StopCommand.MoveToEnd);
public void Stop() => StopWorker(false, StopCommand.MoveToEnd);
public void Stop(StopCommand stopCommand) => this.StopWorker(true, stopCommand);
public void Stop(StopCommand stopCommand) => StopWorker(true, stopCommand);
private void StopWorker(bool stopCommandFlag, StopCommand stopCommand)
{
if (!this._playingFlag)
if (!_playingFlag)
return;
this._playingFlag = false;
if (this._animation == null || !this.Session.IsValid)
_playingFlag = false;
if (_animation == null || !Session.IsValid)
return;
if (stopCommandFlag)
this.SetStopCommand(stopCommand);
this._animation.Reset();
this._animation.RemoveAllTargets();
SetStopCommand(stopCommand);
_animation.Reset();
_animation.RemoveAllTargets();
}
private void Cleanup(float progress, bool forceDeferFlag)
{
if (this._animation == null)
if (_animation == null)
return;
if (UIDispatcher.IsUIThread && !forceDeferFlag)
{
this.CleanupWorker(progress, true);
CleanupWorker(progress, true);
}
else
{
if (!this.Session.IsValid)
if (!Session.IsValid)
return;
DeferredCall.Post(DispatchPriority.Housekeeping, s_deferredCleanupWorker, this);
}
@@ -272,17 +272,17 @@ namespace Microsoft.Iris.Animations
private void CleanupWorker(float progress, bool withNotifications)
{
this._playingFlag = false;
if (this._animation != null)
_playingFlag = false;
if (_animation != null)
{
this._animation.AsyncNotifyEvent -= new AsyncNotifyHandler(this.OnAsyncNotification);
this._animation.UnregisterUsage(this);
this._animation = null;
_animation.AsyncNotifyEvent -= new AsyncNotifyHandler(OnAsyncNotification);
_animation.UnregisterUsage(this);
_animation = null;
}
this._animatableTarget = null;
_animatableTarget = null;
if (!withNotifications)
return;
this._activeSequence.OnDetachChildAnimation(this, progress);
_activeSequence.OnDetachChildAnimation(this, progress);
}
private static void DeferredCleanupWorker(object args) => (args as AnimationProxy).CleanupWorker(0.0f, true);
@@ -322,10 +322,10 @@ namespace Microsoft.Iris.Animations
switch (nCookie)
{
case 1:
this.Cleanup(0.0f, false);
Cleanup(0.0f, false);
break;
case 2:
this.Cleanup(0.0f, false);
Cleanup(0.0f, false);
break;
}
}
@@ -29,28 +29,28 @@ namespace Microsoft.Iris.Animations
public AnimationTemplate(string debugIDName)
{
this._keyframesList = new List<BaseKeyframe>();
this.DebugID = debugIDName;
_keyframesList = new List<BaseKeyframe>();
DebugID = debugIDName;
}
public string DebugID
{
get => this._debugIDName;
set => this._debugIDName = value;
get => _debugIDName;
set => _debugIDName = value;
}
public int Loop
{
get => this._loopCount;
set => this._loopCount = value;
get => _loopCount;
set => _loopCount = value;
}
public List<BaseKeyframe> Keyframes => this._keyframesList;
public List<BaseKeyframe> Keyframes => _keyframesList;
public ActiveSequence Play(ViewItem vi)
{
AnimationArgs args = new AnimationArgs(vi);
return this.Play(vi.RendererVisual, ref args, null);
return Play(vi.RendererVisual, ref args, null);
}
public ActiveSequence Play(
@@ -58,7 +58,7 @@ namespace Microsoft.Iris.Animations
ref AnimationArgs args,
EventHandler onCompleteHandler)
{
ActiveSequence instance = this.CreateInstance(visualTarget, ref args);
ActiveSequence instance = CreateInstance(visualTarget, ref args);
if (onCompleteHandler != null)
instance.AnimationCompleted += onCompleteHandler;
instance.Play();
@@ -70,7 +70,7 @@ namespace Microsoft.Iris.Animations
string property,
ref AnimationArgs args)
{
if (this._keyframesList.Count == 0)
if (_keyframesList.Count == 0)
{
ErrorManager.ReportError("Animations must have at least 2 keyframes to play");
return null;
@@ -79,7 +79,7 @@ namespace Microsoft.Iris.Animations
AnimationProxy[] animationProxyArray = new AnimationProxy[20];
int[] numArray = new int[20];
bool[] flagArray = new bool[20];
foreach (BaseKeyframe keyframes in this._keyframesList)
foreach (BaseKeyframe keyframes in _keyframesList)
{
int type = (int)keyframes.Type;
keyframes.AddtoAnimation(this, aseq, property, ref args, ref animationProxyArray[type]);
@@ -110,17 +110,17 @@ namespace Microsoft.Iris.Animations
IAnimatable animatableTarget,
ref AnimationArgs args)
{
return this.CreateInstance(animatableTarget, null, ref args);
return CreateInstance(animatableTarget, null, ref args);
}
public void AddKeyframe(BaseKeyframe key) => this.InsertSorted(key);
public void AddKeyframe(BaseKeyframe key) => InsertSorted(key);
public BaseKeyframe GetKeyframe(float time)
{
int count = this._keyframesList.Count;
int count = _keyframesList.Count;
for (int index = 0; index < count; ++index)
{
BaseKeyframe keyframes = this._keyframesList[index];
BaseKeyframe keyframes = _keyframesList[index];
if (IsSameTime(time, keyframes.Time))
return keyframes;
}
@@ -129,58 +129,58 @@ namespace Microsoft.Iris.Animations
public void RemoveKeyframe(float time)
{
BaseKeyframe keyframe = this.GetKeyframe(time);
BaseKeyframe keyframe = GetKeyframe(time);
if (keyframe == null)
return;
this._keyframesList.Remove(keyframe);
_keyframesList.Remove(keyframe);
}
public StopCommand GetStopCommand(AnimationType paramType)
{
AnimationSystem.ValidateAnimationType(paramType);
StopCommand stopCommand = StopCommand.MoveToEnd;
if (this._StopCommandSet != null)
stopCommand = this._StopCommandSet[paramType];
if (_StopCommandSet != null)
stopCommand = _StopCommandSet[paramType];
return stopCommand;
}
public void SetStopCommand(AnimationType paramType, StopCommand command)
{
AnimationSystem.ValidateAnimationType(paramType);
if (this._StopCommandSet == null)
this._StopCommandSet = new StopCommandSet(StopCommand.MoveToEnd);
this._StopCommandSet[paramType] = command;
if (_StopCommandSet == null)
_StopCommandSet = new StopCommandSet(StopCommand.MoveToEnd);
_StopCommandSet[paramType] = command;
}
object ICloneable.Clone() => this.Clone();
object ICloneable.Clone() => Clone();
public virtual object Clone()
{
AnimationTemplate anim = new AnimationTemplate(this._debugIDName);
this.CloneWorker(anim);
AnimationTemplate anim = new AnimationTemplate(_debugIDName);
CloneWorker(anim);
return anim;
}
protected virtual void CloneWorker(AnimationTemplate anim)
{
anim._loopCount = this._loopCount;
int count = this._keyframesList.Count;
anim._loopCount = _loopCount;
int count = _keyframesList.Count;
for (int index = 0; index < count; ++index)
anim._keyframesList.Add(this._keyframesList[index].Clone());
anim._debugIDName = this._debugIDName;
anim._keyframesList.Add(_keyframesList[index].Clone());
anim._debugIDName = _debugIDName;
}
private void InsertSorted(BaseKeyframe key)
{
for (int index = this._keyframesList.Count - 1; index >= 0; --index)
for (int index = _keyframesList.Count - 1; index >= 0; --index)
{
if (_keyframesList[index].Time < (double)key.Time)
{
this._keyframesList.Insert(index + 1, key);
_keyframesList.Insert(index + 1, key);
return;
}
}
this._keyframesList.Insert(0, key);
_keyframesList.Insert(0, key);
}
private static bool IsSameTime(float t1, float t2)
@@ -17,14 +17,14 @@ namespace Microsoft.Iris.Animations
AnimationProxy animation,
ref AnimationArgs args)
{
float effectiveValue = this.GetEffectiveValue(targetObject, this._value, ref args);
float effectiveValue = GetEffectiveValue(targetObject, _value, ref args);
animation.AddFloatKeyframe(this, effectiveValue);
}
public float Value
{
get => this._value;
set => this._value = value;
get => _value;
set => _value = value;
}
public override object ObjectValue => Value;
@@ -39,12 +39,12 @@ namespace Microsoft.Iris.Animations
public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args)
{
float effectiveValue = this.GetEffectiveValue(animationTarget.AnimationTarget, this._value, ref args);
this.Apply(animationTarget, effectiveValue);
float effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _value, ref args);
Apply(animationTarget, effectiveValue);
}
public abstract void Apply(IAnimatableOwner animationTarget, float value);
public override void MagnifyValue(float magnifyValue) => this.Value *= magnifyValue;
public override void MagnifyValue(float magnifyValue) => Value *= magnifyValue;
}
}
+22 -22
View File
@@ -44,8 +44,8 @@ namespace Microsoft.Iris.Animations
public BaseKeyframe(float timeValue)
{
this._timeValue = timeValue;
this._relative = RelativeTo.Final;
_timeValue = timeValue;
_relative = RelativeTo.Final;
}
public void AddtoAnimation(
@@ -56,8 +56,8 @@ namespace Microsoft.Iris.Animations
ref AnimationProxy animation)
{
if (animation == null)
animation = this.CreateProxy(anim, aseq, property);
this.PopulateAnimationWorker(aseq.Target, animation, ref args);
animation = CreateProxy(anim, aseq, property);
PopulateAnimationWorker(aseq.Target, animation, ref args);
}
protected virtual AnimationProxy CreateProxy(
@@ -65,14 +65,14 @@ namespace Microsoft.Iris.Animations
ActiveSequence aseq,
string property)
{
StopCommand stopCommand = anim.GetStopCommand(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);
StopCommand stopCommand = anim.GetStopCommand(Type);
RendererProperty rendererProperty = property != null ? new RendererProperty(property) : s_propertyMap[(int)Type];
return new AnimationProxy(aseq, aseq.Target, Type, rendererProperty, anim.Loop, stopCommand);
}
public BaseKeyframe Clone() => (BaseKeyframe)this.MemberwiseClone();
public BaseKeyframe Clone() => (BaseKeyframe)MemberwiseClone();
object ICloneable.Clone() => this.Clone();
object ICloneable.Clone() => Clone();
protected abstract void PopulateAnimationWorker(
IAnimatable targetObject,
@@ -81,22 +81,22 @@ namespace Microsoft.Iris.Animations
public float Time
{
get => this._timeValue;
set => this._timeValue = value;
get => _timeValue;
set => _timeValue = value;
}
public RelativeTo RelativeTo
{
get => this._relative == null ? RelativeTo.Absolute : this._relative;
set => this._relative = value;
get => _relative == null ? RelativeTo.Absolute : _relative;
set => _relative = value;
}
public bool IsRelativeToObject => this.RelativeTo.IsRelativeToObject;
public bool IsRelativeToObject => RelativeTo.IsRelativeToObject;
public Interpolation Interpolation
{
get => this._interpolation;
set => this._interpolation = value;
get => _interpolation;
set => _interpolation = value;
}
public abstract AnimationType Type { get; }
@@ -113,24 +113,24 @@ namespace Microsoft.Iris.Animations
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("<");
stringBuilder.Append(this.GetType().Name);
stringBuilder.Append(GetType().Name);
stringBuilder.Append(" Time=\"");
stringBuilder.Append(this._timeValue);
stringBuilder.Append(_timeValue);
stringBuilder.Append("\"");
if (this._interpolation != null)
if (_interpolation != null)
{
stringBuilder.Append(" Interpolation=\"");
stringBuilder.Append(this._interpolation.ToString());
stringBuilder.Append(_interpolation.ToString());
stringBuilder.Append("\"");
}
if (this._relative != RelativeTo.Absolute)
if (_relative != RelativeTo.Absolute)
{
stringBuilder.Append(" RelativeTo=\"");
stringBuilder.Append(_relative);
stringBuilder.Append("\"");
}
stringBuilder.Append(" Value=\"");
stringBuilder.Append(this.ObjectValue);
stringBuilder.Append(ObjectValue);
stringBuilder.Append("\"");
stringBuilder.Append("/>");
return stringBuilder.ToString();
@@ -8,7 +8,7 @@ namespace Microsoft.Iris.Animations
{
internal abstract class BaseMultiplyFloatKeyframe : BaseFloatKeyframe
{
public BaseMultiplyFloatKeyframe() => this.Value = 1f;
public BaseMultiplyFloatKeyframe() => Value = 1f;
public override bool Multiply => true;
}
@@ -10,7 +10,7 @@ namespace Microsoft.Iris.Animations
{
internal abstract class BaseMultiplyVector3Keyframe : BaseVector3Keyframe
{
public BaseMultiplyVector3Keyframe() => this.Value = Vector3.UnitVector;
public BaseMultiplyVector3Keyframe() => Value = Vector3.UnitVector;
public override bool Multiply => true;
@@ -19,8 +19,8 @@ namespace Microsoft.Iris.Animations
Vector3 baseValueVector,
ref AnimationArgs args)
{
if (this.RelativeTo == RelativeTo.Final)
baseValueVector *= this.GetRelativeToFinalValue(targetObject, ref args);
if (RelativeTo == RelativeTo.Final)
baseValueVector *= GetRelativeToFinalValue(targetObject, ref args);
return baseValueVector;
}
@@ -13,21 +13,21 @@ namespace Microsoft.Iris.Animations
{
private Rotation _valueRotation;
public BaseRotationKeyframe() => this._valueRotation = Rotation.Default;
public BaseRotationKeyframe() => _valueRotation = Rotation.Default;
protected override void PopulateAnimationWorker(
IAnimatable targetObject,
AnimationProxy animation,
ref AnimationArgs args)
{
Rotation effectiveValue = this.GetEffectiveValue(targetObject, this._valueRotation, ref args);
Rotation effectiveValue = GetEffectiveValue(targetObject, _valueRotation, ref args);
animation.AddRotationKeyframe(this, effectiveValue);
}
public Rotation Value
{
get => this._valueRotation;
set => this._valueRotation = value;
get => _valueRotation;
set => _valueRotation = value;
}
public override object ObjectValue => Value;
@@ -42,8 +42,8 @@ namespace Microsoft.Iris.Animations
public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args)
{
Rotation effectiveValue = this.GetEffectiveValue(animationTarget.AnimationTarget, this._valueRotation, ref args);
this.Apply(animationTarget, effectiveValue);
Rotation effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _valueRotation, ref args);
Apply(animationTarget, effectiveValue);
}
public abstract void Apply(IAnimatableOwner animationTarget, Rotation valueRotation);
@@ -17,14 +17,14 @@ namespace Microsoft.Iris.Animations
AnimationProxy animation,
ref AnimationArgs args)
{
Vector2 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args);
Vector2 effectiveValue = GetEffectiveValue(targetObject, _valueVector, ref args);
animation.AddVector2Keyframe(this, effectiveValue);
}
public Vector2 Value
{
get => this._valueVector;
set => this._valueVector = value;
get => _valueVector;
set => _valueVector = value;
}
public override object ObjectValue => Value;
@@ -39,12 +39,12 @@ namespace Microsoft.Iris.Animations
public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args)
{
Vector2 effectiveValue = this.GetEffectiveValue(animationTarget.AnimationTarget, this._valueVector, ref args);
this.Apply(animationTarget, effectiveValue);
Vector2 effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _valueVector, ref args);
Apply(animationTarget, effectiveValue);
}
public abstract void Apply(IAnimatableOwner animationTarget, Vector2 valueVector);
public override void MagnifyValue(float magnifyValue) => this.Value *= magnifyValue;
public override void MagnifyValue(float magnifyValue) => Value *= magnifyValue;
}
}

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