MyPageLeft.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Windows;
  5. using System.Windows.Controls;
  6. using System.Windows.Media;
  7. using Microsoft.VisualBasic.CompilerServices;
  8. namespace PCL
  9. {
  10. // Token: 0x0200004B RID: 75
  11. public class MyPageLeft : Grid
  12. {
  13. // Token: 0x060001A3 RID: 419 RVA: 0x00002FCB File Offset: 0x000011CB
  14. public MyPageLeft()
  15. {
  16. this.m_Manager = ModBase.GetUuid();
  17. }
  18. // Token: 0x1700001B RID: 27
  19. // (get) Token: 0x060001A4 RID: 420 RVA: 0x00002FDF File Offset: 0x000011DF
  20. // (set) Token: 0x060001A5 RID: 421 RVA: 0x00002FF1 File Offset: 0x000011F1
  21. public FrameworkElement AnimatedControl
  22. {
  23. get
  24. {
  25. return (FrameworkElement)base.GetValue(MyPageLeft.m_Wrapper);
  26. }
  27. set
  28. {
  29. base.SetValue(MyPageLeft.m_Wrapper, value);
  30. }
  31. }
  32. // Token: 0x060001A6 RID: 422 RVA: 0x00014138 File Offset: 0x00012338
  33. public void TriggerShowAnimation()
  34. {
  35. if (this.AnimatedControl == null)
  36. {
  37. if (!(base.RenderTransform is ScaleTransform))
  38. {
  39. base.RenderTransform = new ScaleTransform(0.96, 0.96);
  40. base.RenderTransformOrigin = new Point(0.5, 0.5);
  41. }
  42. base.Opacity = 0.0;
  43. ModAnimation.AniStart(new ModAnimation.AniData[]
  44. {
  45. ModAnimation.AaScaleTransform(this, 1.0 - ((ScaleTransform)base.RenderTransform).ScaleX, 400, 0, new ModAnimation.AniEaseOutBack(ModAnimation.AniEasePower.Weak), false),
  46. ModAnimation.AaOpacity(this, 1.0, 100, 0, null, false)
  47. }, "PageLeft PageChange " + Conversions.ToString(this.m_Manager), false);
  48. return;
  49. }
  50. List<ModAnimation.AniData> list = new List<ModAnimation.AniData>();
  51. int num = 0;
  52. int num2 = 0;
  53. checked
  54. {
  55. try
  56. {
  57. List<FrameworkElement>.Enumerator enumerator = this.GetAllAnimControls(true).GetEnumerator();
  58. while (enumerator.MoveNext())
  59. {
  60. MyPageLeft._Closure$__7-0 CS$<>8__locals1 = new MyPageLeft._Closure$__7-0(CS$<>8__locals1);
  61. CS$<>8__locals1.$VB$Me = this;
  62. CS$<>8__locals1.$VB$Local_Element = enumerator.Current;
  63. if (CS$<>8__locals1.$VB$Local_Element.Visibility == Visibility.Collapsed)
  64. {
  65. CS$<>8__locals1.$VB$Local_Element.Opacity = 1.0;
  66. CS$<>8__locals1.$VB$Local_Element.RenderTransform = new TranslateTransform(0.0, 0.0);
  67. if (CS$<>8__locals1.$VB$Local_Element is MyListItem)
  68. {
  69. ((MyListItem)CS$<>8__locals1.$VB$Local_Element)._ProccesorComposer = true;
  70. }
  71. }
  72. else
  73. {
  74. CS$<>8__locals1.$VB$Local_Element.Opacity = 0.0;
  75. CS$<>8__locals1.$VB$Local_Element.RenderTransform = new TranslateTransform(-25.0, 0.0);
  76. if (CS$<>8__locals1.$VB$Local_Element is MyListItem)
  77. {
  78. ((MyListItem)CS$<>8__locals1.$VB$Local_Element)._ProccesorComposer = false;
  79. }
  80. list.Add(ModAnimation.AaOpacity(CS$<>8__locals1.$VB$Local_Element, (CS$<>8__locals1.$VB$Local_Element is TextBlock) ? 0.6 : 1.0, 200, num2, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Weak), false));
  81. list.Add(ModAnimation.AaTranslateX(CS$<>8__locals1.$VB$Local_Element, 5.0, 200, num2, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false));
  82. list.Add(ModAnimation.AaTranslateX(CS$<>8__locals1.$VB$Local_Element, 20.0, 300, num2, new ModAnimation.AniEaseOutBack(ModAnimation.AniEasePower.Weak), false));
  83. if (CS$<>8__locals1.$VB$Local_Element is MyListItem)
  84. {
  85. list.Add(ModAnimation.AaCode(delegate
  86. {
  87. ((MyListItem)CS$<>8__locals1.$VB$Local_Element)._ProccesorComposer = true;
  88. ((MyListItem)CS$<>8__locals1.$VB$Local_Element).RefreshColor(CS$<>8__locals1.$VB$Me, new EventArgs());
  89. }, num2 + 280, false));
  90. }
  91. num2 = (int)Math.Round(unchecked((double)num2 + (double)Math.Max(8, checked(20 - num)) * 2.5));
  92. num++;
  93. }
  94. }
  95. }
  96. finally
  97. {
  98. List<FrameworkElement>.Enumerator enumerator;
  99. ((IDisposable)enumerator).Dispose();
  100. }
  101. ModAnimation.AniStart(list, "PageLeft PageChange " + Conversions.ToString(this.m_Manager), false);
  102. }
  103. }
  104. // Token: 0x060001A7 RID: 423 RVA: 0x00014450 File Offset: 0x00012650
  105. public void TriggerHideAnimation()
  106. {
  107. if (this.AnimatedControl == null)
  108. {
  109. if (!(base.RenderTransform is ScaleTransform))
  110. {
  111. base.RenderTransform = new ScaleTransform(1.0, 1.0);
  112. base.RenderTransformOrigin = new Point(0.5, 0.5);
  113. }
  114. ModAnimation.AniStart(new ModAnimation.AniData[]
  115. {
  116. ModAnimation.AaScaleTransform(this, 0.95 - ((ScaleTransform)base.RenderTransform).ScaleX, 130, 0, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Weak), false),
  117. ModAnimation.AaOpacity(this, -base.Opacity, 100, 30, null, false)
  118. }, "PageLeft PageChange " + Conversions.ToString(this.m_Manager), false);
  119. return;
  120. }
  121. List<ModAnimation.AniData> list = new List<ModAnimation.AniData>();
  122. int num = 0;
  123. List<FrameworkElement> allAnimControls = this.GetAllAnimControls(false);
  124. checked
  125. {
  126. try
  127. {
  128. foreach (FrameworkElement frameworkElement in allAnimControls)
  129. {
  130. list.Add(ModAnimation.AaOpacity(frameworkElement, unchecked(-frameworkElement.Opacity), 60, (int)Math.Round(unchecked(80.0 / (double)allAnimControls.Count * (double)num)), null, false));
  131. list.Add(ModAnimation.AaTranslateX(frameworkElement, -6.0, 60, (int)Math.Round(unchecked(80.0 / (double)allAnimControls.Count * (double)num)), null, false));
  132. num++;
  133. }
  134. }
  135. finally
  136. {
  137. List<FrameworkElement>.Enumerator enumerator;
  138. ((IDisposable)enumerator).Dispose();
  139. }
  140. ModAnimation.AniStart(list, "PageLeft PageChange " + Conversions.ToString(this.m_Manager), false);
  141. }
  142. }
  143. // Token: 0x060001A8 RID: 424 RVA: 0x000145F4 File Offset: 0x000127F4
  144. private List<FrameworkElement> GetAllAnimControls(bool IgnoreInvisibility = false)
  145. {
  146. List<FrameworkElement> result = new List<FrameworkElement>();
  147. this.GetAllAnimControls(this.AnimatedControl, ref result, IgnoreInvisibility);
  148. return result;
  149. }
  150. // Token: 0x060001A9 RID: 425 RVA: 0x00014618 File Offset: 0x00012818
  151. private void GetAllAnimControls(FrameworkElement Element, ref List<FrameworkElement> AllControls, bool IgnoreInvisibility)
  152. {
  153. if (IgnoreInvisibility || Element.Visibility != Visibility.Collapsed)
  154. {
  155. if (Element is MyTextButton)
  156. {
  157. AllControls.Add(Element);
  158. return;
  159. }
  160. if (Element is MyListItem)
  161. {
  162. AllControls.Add(Element);
  163. return;
  164. }
  165. if (Element is ContentControl)
  166. {
  167. this.GetAllAnimControls((FrameworkElement)((ContentControl)Element).Content, ref AllControls, IgnoreInvisibility);
  168. return;
  169. }
  170. if (Element is Panel)
  171. {
  172. try
  173. {
  174. foreach (object obj in ((Panel)Element).Children)
  175. {
  176. FrameworkElement element = (FrameworkElement)obj;
  177. this.GetAllAnimControls(element, ref AllControls, IgnoreInvisibility);
  178. }
  179. return;
  180. }
  181. finally
  182. {
  183. IEnumerator enumerator;
  184. if (enumerator is IDisposable)
  185. {
  186. (enumerator as IDisposable).Dispose();
  187. }
  188. }
  189. }
  190. AllControls.Add(Element);
  191. }
  192. }
  193. // Token: 0x040000BB RID: 187
  194. private int m_Manager;
  195. // Token: 0x040000BC RID: 188
  196. public static readonly DependencyProperty m_Wrapper = DependencyProperty.Register("AnimatedControl", typeof(FrameworkElement), typeof(MyPageLeft), new PropertyMetadata(null));
  197. }
  198. }