Add source
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200000B RID: 11
|
||||
internal interface IManagedType
|
||||
{
|
||||
// Token: 0x06000125 RID: 293
|
||||
Type getManagedType();
|
||||
|
||||
// Token: 0x06000126 RID: 294
|
||||
object copy(object o);
|
||||
|
||||
// Token: 0x06000127 RID: 295
|
||||
object getIntermediateValue(object start, object end, double dPercentage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200000C RID: 12
|
||||
internal interface ITransitionType
|
||||
{
|
||||
// Token: 0x06000128 RID: 296
|
||||
void onTimer(int iTime, out double dPercentage, out bool bCompleted);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000015 RID: 21
|
||||
internal enum InterpolationMethod
|
||||
{
|
||||
// Token: 0x04000101 RID: 257
|
||||
Linear,
|
||||
// Token: 0x04000102 RID: 258
|
||||
Accleration,
|
||||
// Token: 0x04000103 RID: 259
|
||||
Deceleration,
|
||||
// Token: 0x04000104 RID: 260
|
||||
EaseInEaseOut
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200000D RID: 13
|
||||
internal class ManagedType_Color : IManagedType
|
||||
{
|
||||
// Token: 0x06000129 RID: 297 RVA: 0x00013650 File Offset: 0x00011850
|
||||
public Type getManagedType()
|
||||
{
|
||||
return typeof(Color);
|
||||
}
|
||||
|
||||
// Token: 0x0600012A RID: 298 RVA: 0x0001366C File Offset: 0x0001186C
|
||||
public object copy(object o)
|
||||
{
|
||||
Color color = Color.FromArgb(((Color)o).ToArgb());
|
||||
return color;
|
||||
}
|
||||
|
||||
// Token: 0x0600012B RID: 299 RVA: 0x00013698 File Offset: 0x00011898
|
||||
public object getIntermediateValue(object start, object end, double dPercentage)
|
||||
{
|
||||
Color color = (Color)start;
|
||||
Color color2 = (Color)end;
|
||||
int r = (int)color.R;
|
||||
int g = (int)color.G;
|
||||
int b = (int)color.B;
|
||||
int a = (int)color.A;
|
||||
int r2 = (int)color2.R;
|
||||
int g2 = (int)color2.G;
|
||||
int b2 = (int)color2.B;
|
||||
int a2 = (int)color2.A;
|
||||
int num = Utility.interpolate(r, r2, dPercentage);
|
||||
int num2 = Utility.interpolate(g, g2, dPercentage);
|
||||
int num3 = Utility.interpolate(b, b2, dPercentage);
|
||||
int num4 = Utility.interpolate(a, a2, dPercentage);
|
||||
return Color.FromArgb(num4, num, num2, num3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200000E RID: 14
|
||||
internal class ManagedType_Double : IManagedType
|
||||
{
|
||||
// Token: 0x0600012D RID: 301 RVA: 0x0001374C File Offset: 0x0001194C
|
||||
public Type getManagedType()
|
||||
{
|
||||
return typeof(double);
|
||||
}
|
||||
|
||||
// Token: 0x0600012E RID: 302 RVA: 0x00013768 File Offset: 0x00011968
|
||||
public object copy(object o)
|
||||
{
|
||||
double num = (double)o;
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x0600012F RID: 303 RVA: 0x00013788 File Offset: 0x00011988
|
||||
public object getIntermediateValue(object start, object end, double dPercentage)
|
||||
{
|
||||
double num = (double)start;
|
||||
double num2 = (double)end;
|
||||
return Utility.interpolate(num, num2, dPercentage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200000F RID: 15
|
||||
internal class ManagedType_Float : IManagedType
|
||||
{
|
||||
// Token: 0x06000131 RID: 305 RVA: 0x000137C0 File Offset: 0x000119C0
|
||||
public Type getManagedType()
|
||||
{
|
||||
return typeof(float);
|
||||
}
|
||||
|
||||
// Token: 0x06000132 RID: 306 RVA: 0x000137DC File Offset: 0x000119DC
|
||||
public object copy(object o)
|
||||
{
|
||||
float num = (float)o;
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06000133 RID: 307 RVA: 0x000137FC File Offset: 0x000119FC
|
||||
public object getIntermediateValue(object start, object end, double dPercentage)
|
||||
{
|
||||
float num = (float)start;
|
||||
float num2 = (float)end;
|
||||
return Utility.interpolate(num, num2, dPercentage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000010 RID: 16
|
||||
internal class ManagedType_Int : IManagedType
|
||||
{
|
||||
// Token: 0x06000135 RID: 309 RVA: 0x00013834 File Offset: 0x00011A34
|
||||
public Type getManagedType()
|
||||
{
|
||||
return typeof(int);
|
||||
}
|
||||
|
||||
// Token: 0x06000136 RID: 310 RVA: 0x00013850 File Offset: 0x00011A50
|
||||
public object copy(object o)
|
||||
{
|
||||
int num = (int)o;
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06000137 RID: 311 RVA: 0x00013870 File Offset: 0x00011A70
|
||||
public object getIntermediateValue(object start, object end, double dPercentage)
|
||||
{
|
||||
int num = (int)start;
|
||||
int num2 = (int)end;
|
||||
return Utility.interpolate(num, num2, dPercentage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000011 RID: 17
|
||||
internal class ManagedType_String : IManagedType
|
||||
{
|
||||
// Token: 0x06000139 RID: 313 RVA: 0x000138A8 File Offset: 0x00011AA8
|
||||
public Type getManagedType()
|
||||
{
|
||||
return typeof(string);
|
||||
}
|
||||
|
||||
// Token: 0x0600013A RID: 314 RVA: 0x000138C4 File Offset: 0x00011AC4
|
||||
public object copy(object o)
|
||||
{
|
||||
string text = (string)o;
|
||||
return new string(text.ToCharArray());
|
||||
}
|
||||
|
||||
// Token: 0x0600013B RID: 315 RVA: 0x000138E8 File Offset: 0x00011AE8
|
||||
public object getIntermediateValue(object start, object end, double dPercentage)
|
||||
{
|
||||
string text = (string)start;
|
||||
string text2 = (string)end;
|
||||
int length = text.Length;
|
||||
int length2 = text2.Length;
|
||||
int num = Utility.interpolate(length, length2, dPercentage);
|
||||
char[] array = new char[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
char c = 'a';
|
||||
bool flag = i < length;
|
||||
if (flag)
|
||||
{
|
||||
c = text[i];
|
||||
}
|
||||
char c2 = 'a';
|
||||
bool flag2 = i < length2;
|
||||
if (flag2)
|
||||
{
|
||||
c2 = text2[i];
|
||||
}
|
||||
bool flag3 = c2 == ' ';
|
||||
char c3;
|
||||
if (flag3)
|
||||
{
|
||||
c3 = ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = Convert.ToInt32(c);
|
||||
int num3 = Convert.ToInt32(c2);
|
||||
int num4 = Utility.interpolate(num2, num3, dPercentage);
|
||||
c3 = Convert.ToChar(num4);
|
||||
}
|
||||
array[i] = c3;
|
||||
}
|
||||
return new string(array);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000012 RID: 18
|
||||
internal static class ReflectionHelper
|
||||
{
|
||||
// Token: 0x0600013D RID: 317 RVA: 0x000139D4 File Offset: 0x00011BD4
|
||||
public static object GetPropValue(this object obj, string propName)
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
string[] array = propName.Split('.', StringSplitOptions.None);
|
||||
#else
|
||||
string[] array = propName.Split(new char[] { '.' });
|
||||
#endif
|
||||
bool flag = array.Length == 1;
|
||||
object obj2;
|
||||
if (flag)
|
||||
{
|
||||
obj2 = obj.GetType().GetProperty(propName).GetValue(obj, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (string text in array)
|
||||
{
|
||||
bool flag2 = obj == null;
|
||||
if (flag2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Type type = obj.GetType();
|
||||
PropertyInfo property = type.GetProperty(text);
|
||||
bool flag3 = property == null;
|
||||
if (flag3)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
obj = property.GetValue(obj, null);
|
||||
}
|
||||
obj2 = obj;
|
||||
}
|
||||
return obj2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000013 RID: 19
|
||||
[DebuggerStepThrough]
|
||||
internal class Transition
|
||||
{
|
||||
// Token: 0x0600013E RID: 318 RVA: 0x00013A70 File Offset: 0x00011C70
|
||||
static Transition()
|
||||
{
|
||||
Transition.registerType(new ManagedType_Int());
|
||||
Transition.registerType(new ManagedType_Float());
|
||||
Transition.registerType(new ManagedType_Double());
|
||||
Transition.registerType(new ManagedType_Color());
|
||||
Transition.registerType(new ManagedType_String());
|
||||
}
|
||||
|
||||
// Token: 0x14000001 RID: 1
|
||||
// (add) Token: 0x0600013F RID: 319 RVA: 0x00013AC0 File Offset: 0x00011CC0
|
||||
// (remove) Token: 0x06000140 RID: 320 RVA: 0x00013AF8 File Offset: 0x00011CF8
|
||||
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
public event EventHandler<Transition.Args> TransitionCompletedEvent;
|
||||
|
||||
// Token: 0x06000141 RID: 321 RVA: 0x00013B30 File Offset: 0x00011D30
|
||||
public static void run(object target, string strPropertyName, object destinationValue, ITransitionType transitionMethod)
|
||||
{
|
||||
Transition transition = new Transition(transitionMethod);
|
||||
transition.add(target, strPropertyName, destinationValue);
|
||||
transition.run();
|
||||
}
|
||||
|
||||
// Token: 0x06000142 RID: 322 RVA: 0x00013B56 File Offset: 0x00011D56
|
||||
public static void run(object target, string strPropertyName, object initialValue, object destinationValue, ITransitionType transitionMethod)
|
||||
{
|
||||
Utility.setValue(target, strPropertyName, initialValue);
|
||||
Transition.run(target, strPropertyName, destinationValue, transitionMethod);
|
||||
}
|
||||
|
||||
// Token: 0x06000143 RID: 323 RVA: 0x00013B70 File Offset: 0x00011D70
|
||||
public static void runChain(params Transition[] transitions)
|
||||
{
|
||||
TransitionChain transitionChain = new TransitionChain(transitions);
|
||||
}
|
||||
|
||||
// Token: 0x06000144 RID: 324 RVA: 0x00013B85 File Offset: 0x00011D85
|
||||
public Transition(ITransitionType transitionMethod)
|
||||
{
|
||||
this.m_TransitionMethod = transitionMethod;
|
||||
}
|
||||
|
||||
// Token: 0x06000145 RID: 325 RVA: 0x00013BC0 File Offset: 0x00011DC0
|
||||
public void add(object target, string strPropertyName, object destinationValue)
|
||||
{
|
||||
Type type = target.GetType();
|
||||
PropertyInfo property = type.GetProperty(strPropertyName);
|
||||
bool flag = property == null;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Object: " + target.ToString() + " does not have the property: " + strPropertyName);
|
||||
}
|
||||
Type propertyType = property.PropertyType;
|
||||
bool flag2 = !Transition.m_mapManagedTypes.ContainsKey(propertyType);
|
||||
if (flag2)
|
||||
{
|
||||
throw new Exception("Transition does not handle properties of type: " + propertyType.ToString());
|
||||
}
|
||||
bool flag3 = !property.CanRead || !property.CanWrite;
|
||||
if (flag3)
|
||||
{
|
||||
throw new Exception("Property is not both gettable and settable: " + strPropertyName);
|
||||
}
|
||||
IManagedType managedType = Transition.m_mapManagedTypes[propertyType];
|
||||
Transition.TransitionedPropertyInfo transitionedPropertyInfo = new Transition.TransitionedPropertyInfo();
|
||||
transitionedPropertyInfo.endValue = destinationValue;
|
||||
transitionedPropertyInfo.target = target;
|
||||
transitionedPropertyInfo.propertyInfo = property;
|
||||
transitionedPropertyInfo.managedType = managedType;
|
||||
object @lock = this.m_Lock;
|
||||
lock (@lock)
|
||||
{
|
||||
this.m_listTransitionedProperties.Add(transitionedPropertyInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000146 RID: 326 RVA: 0x00013CDC File Offset: 0x00011EDC
|
||||
public void run()
|
||||
{
|
||||
foreach (Transition.TransitionedPropertyInfo transitionedPropertyInfo in this.m_listTransitionedProperties)
|
||||
{
|
||||
object value = transitionedPropertyInfo.propertyInfo.GetValue(transitionedPropertyInfo.target, null);
|
||||
transitionedPropertyInfo.startValue = transitionedPropertyInfo.managedType.copy(value);
|
||||
}
|
||||
this.m_Stopwatch.Reset();
|
||||
this.m_Stopwatch.Start();
|
||||
TransitionManager.getInstance().register(this);
|
||||
}
|
||||
|
||||
// Token: 0x17000020 RID: 32
|
||||
// (get) Token: 0x06000147 RID: 327 RVA: 0x00013D70 File Offset: 0x00011F70
|
||||
internal IList<Transition.TransitionedPropertyInfo> TransitionedProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_listTransitionedProperties;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000148 RID: 328 RVA: 0x00013D88 File Offset: 0x00011F88
|
||||
internal void removeProperty(Transition.TransitionedPropertyInfo info)
|
||||
{
|
||||
object @lock = this.m_Lock;
|
||||
lock (@lock)
|
||||
{
|
||||
this.m_listTransitionedProperties.Remove(info);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000149 RID: 329 RVA: 0x00013DD4 File Offset: 0x00011FD4
|
||||
internal void onTimer()
|
||||
{
|
||||
int num = (int)this.m_Stopwatch.ElapsedMilliseconds;
|
||||
double num2;
|
||||
bool flag;
|
||||
this.m_TransitionMethod.onTimer(num, out num2, out flag);
|
||||
IList<Transition.TransitionedPropertyInfo> list = new List<Transition.TransitionedPropertyInfo>();
|
||||
object @lock = this.m_Lock;
|
||||
lock (@lock)
|
||||
{
|
||||
foreach (Transition.TransitionedPropertyInfo transitionedPropertyInfo in this.m_listTransitionedProperties)
|
||||
{
|
||||
list.Add(transitionedPropertyInfo.copy());
|
||||
}
|
||||
}
|
||||
foreach (Transition.TransitionedPropertyInfo transitionedPropertyInfo2 in list)
|
||||
{
|
||||
object intermediateValue = transitionedPropertyInfo2.managedType.getIntermediateValue(transitionedPropertyInfo2.startValue, transitionedPropertyInfo2.endValue, num2);
|
||||
Transition.PropertyUpdateArgs propertyUpdateArgs = new Transition.PropertyUpdateArgs(transitionedPropertyInfo2.target, transitionedPropertyInfo2.propertyInfo, intermediateValue);
|
||||
this.setProperty(this, propertyUpdateArgs);
|
||||
}
|
||||
bool flag3 = flag;
|
||||
if (flag3)
|
||||
{
|
||||
this.m_Stopwatch.Stop();
|
||||
Utility.raiseEvent<Transition.Args>(this.TransitionCompletedEvent, this, new Transition.Args());
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600014A RID: 330 RVA: 0x00013F28 File Offset: 0x00012128
|
||||
private void setProperty(object sender, Transition.PropertyUpdateArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool flag = this.isDisposed(args.target);
|
||||
if (!flag)
|
||||
{
|
||||
ISynchronizeInvoke synchronizeInvoke = args.target as ISynchronizeInvoke;
|
||||
bool flag2 = synchronizeInvoke != null && synchronizeInvoke.InvokeRequired;
|
||||
if (flag2)
|
||||
{
|
||||
IAsyncResult asyncResult = synchronizeInvoke.BeginInvoke(new EventHandler<Transition.PropertyUpdateArgs>(this.setProperty), new object[] { sender, args });
|
||||
asyncResult.AsyncWaitHandle.WaitOne(50);
|
||||
}
|
||||
else
|
||||
{
|
||||
args.propertyInfo.SetValue(args.target, args.value, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600014B RID: 331 RVA: 0x00013FCC File Offset: 0x000121CC
|
||||
private bool isDisposed(object target)
|
||||
{
|
||||
Control control = target as Control;
|
||||
bool flag = control == null;
|
||||
bool flag2;
|
||||
if (flag)
|
||||
{
|
||||
flag2 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag3 = control.IsDisposed || control.Disposing;
|
||||
flag2 = flag3;
|
||||
}
|
||||
return flag2;
|
||||
}
|
||||
|
||||
// Token: 0x0600014C RID: 332 RVA: 0x00014010 File Offset: 0x00012210
|
||||
private static void registerType(IManagedType transitionType)
|
||||
{
|
||||
Type managedType = transitionType.getManagedType();
|
||||
Transition.m_mapManagedTypes[managedType] = transitionType;
|
||||
}
|
||||
|
||||
// Token: 0x040000FA RID: 250
|
||||
private static IDictionary<Type, IManagedType> m_mapManagedTypes = new Dictionary<Type, IManagedType>();
|
||||
|
||||
// Token: 0x040000FB RID: 251
|
||||
private ITransitionType m_TransitionMethod = null;
|
||||
|
||||
// Token: 0x040000FC RID: 252
|
||||
private IList<Transition.TransitionedPropertyInfo> m_listTransitionedProperties = new List<Transition.TransitionedPropertyInfo>();
|
||||
|
||||
// Token: 0x040000FD RID: 253
|
||||
private Stopwatch m_Stopwatch = new Stopwatch();
|
||||
|
||||
// Token: 0x040000FE RID: 254
|
||||
private object m_Lock = new object();
|
||||
|
||||
// Token: 0x02000045 RID: 69
|
||||
public class Args : EventArgs
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x02000046 RID: 70
|
||||
internal class TransitionedPropertyInfo
|
||||
{
|
||||
// Token: 0x06000282 RID: 642 RVA: 0x00018094 File Offset: 0x00016294
|
||||
public Transition.TransitionedPropertyInfo copy()
|
||||
{
|
||||
return new Transition.TransitionedPropertyInfo
|
||||
{
|
||||
startValue = this.startValue,
|
||||
endValue = this.endValue,
|
||||
target = this.target,
|
||||
propertyInfo = this.propertyInfo,
|
||||
managedType = this.managedType
|
||||
};
|
||||
}
|
||||
|
||||
// Token: 0x040001B4 RID: 436
|
||||
public object startValue;
|
||||
|
||||
// Token: 0x040001B5 RID: 437
|
||||
public object endValue;
|
||||
|
||||
// Token: 0x040001B6 RID: 438
|
||||
public object target;
|
||||
|
||||
// Token: 0x040001B7 RID: 439
|
||||
public PropertyInfo propertyInfo;
|
||||
|
||||
// Token: 0x040001B8 RID: 440
|
||||
public IManagedType managedType;
|
||||
}
|
||||
|
||||
// Token: 0x02000047 RID: 71
|
||||
private class PropertyUpdateArgs : EventArgs
|
||||
{
|
||||
// Token: 0x06000284 RID: 644 RVA: 0x000180F2 File Offset: 0x000162F2
|
||||
public PropertyUpdateArgs(object t, PropertyInfo pi, object v)
|
||||
{
|
||||
this.target = t;
|
||||
this.propertyInfo = pi;
|
||||
this.value = v;
|
||||
}
|
||||
|
||||
// Token: 0x040001B9 RID: 441
|
||||
public object target;
|
||||
|
||||
// Token: 0x040001BA RID: 442
|
||||
public PropertyInfo propertyInfo;
|
||||
|
||||
// Token: 0x040001BB RID: 443
|
||||
public object value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000014 RID: 20
|
||||
internal class TransitionChain
|
||||
{
|
||||
// Token: 0x0600014D RID: 333 RVA: 0x00014034 File Offset: 0x00012234
|
||||
public TransitionChain(params Transition[] transitions)
|
||||
{
|
||||
foreach (Transition transition in transitions)
|
||||
{
|
||||
this.m_listTransitions.AddLast(transition);
|
||||
}
|
||||
this.runNextTransition();
|
||||
}
|
||||
|
||||
// Token: 0x0600014E RID: 334 RVA: 0x00014080 File Offset: 0x00012280
|
||||
private void runNextTransition()
|
||||
{
|
||||
bool flag = this.m_listTransitions.Count == 0;
|
||||
if (!flag)
|
||||
{
|
||||
Transition value = this.m_listTransitions.First.Value;
|
||||
value.TransitionCompletedEvent += this.onTransitionCompleted;
|
||||
value.run();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600014F RID: 335 RVA: 0x000140D0 File Offset: 0x000122D0
|
||||
private void onTransitionCompleted(object sender, Transition.Args e)
|
||||
{
|
||||
Transition transition = (Transition)sender;
|
||||
transition.TransitionCompletedEvent -= this.onTransitionCompleted;
|
||||
this.m_listTransitions.RemoveFirst();
|
||||
this.runNextTransition();
|
||||
}
|
||||
|
||||
// Token: 0x040000FF RID: 255
|
||||
private LinkedList<Transition> m_listTransitions = new LinkedList<Transition>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000016 RID: 22
|
||||
internal class TransitionElement
|
||||
{
|
||||
// Token: 0x06000150 RID: 336 RVA: 0x0001410B File Offset: 0x0001230B
|
||||
public TransitionElement(double endTime, double endValue, InterpolationMethod interpolationMethod)
|
||||
{
|
||||
this.EndTime = endTime;
|
||||
this.EndValue = endValue;
|
||||
this.InterpolationMethod = interpolationMethod;
|
||||
}
|
||||
|
||||
// Token: 0x17000021 RID: 33
|
||||
// (get) Token: 0x06000151 RID: 337 RVA: 0x0001412D File Offset: 0x0001232D
|
||||
// (set) Token: 0x06000152 RID: 338 RVA: 0x00014135 File Offset: 0x00012335
|
||||
public double EndTime { get; set; }
|
||||
|
||||
// Token: 0x17000022 RID: 34
|
||||
// (get) Token: 0x06000153 RID: 339 RVA: 0x0001413E File Offset: 0x0001233E
|
||||
// (set) Token: 0x06000154 RID: 340 RVA: 0x00014146 File Offset: 0x00012346
|
||||
public double EndValue { get; set; }
|
||||
|
||||
// Token: 0x17000023 RID: 35
|
||||
// (get) Token: 0x06000155 RID: 341 RVA: 0x0001414F File Offset: 0x0001234F
|
||||
// (set) Token: 0x06000156 RID: 342 RVA: 0x00014157 File Offset: 0x00012357
|
||||
public InterpolationMethod InterpolationMethod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Timers;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000017 RID: 23
|
||||
internal class TransitionManager
|
||||
{
|
||||
// Token: 0x06000157 RID: 343 RVA: 0x00014160 File Offset: 0x00012360
|
||||
public static TransitionManager getInstance()
|
||||
{
|
||||
bool flag = TransitionManager.m_Instance == null;
|
||||
if (flag)
|
||||
{
|
||||
TransitionManager.m_Instance = new TransitionManager();
|
||||
}
|
||||
return TransitionManager.m_Instance;
|
||||
}
|
||||
|
||||
// Token: 0x06000158 RID: 344 RVA: 0x00014190 File Offset: 0x00012390
|
||||
public void register(Transition transition)
|
||||
{
|
||||
object @lock = this.m_Lock;
|
||||
lock (@lock)
|
||||
{
|
||||
this.removeDuplicates(transition);
|
||||
this.m_Transitions[transition] = true;
|
||||
transition.TransitionCompletedEvent += this.onTransitionCompleted;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000159 RID: 345 RVA: 0x000141F8 File Offset: 0x000123F8
|
||||
private void removeDuplicates(Transition transition)
|
||||
{
|
||||
foreach (KeyValuePair<Transition, bool> keyValuePair in this.m_Transitions)
|
||||
{
|
||||
this.removeDuplicates(transition, keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600015A RID: 346 RVA: 0x00014254 File Offset: 0x00012454
|
||||
private void removeDuplicates(Transition newTransition, Transition oldTransition)
|
||||
{
|
||||
IList<Transition.TransitionedPropertyInfo> transitionedProperties = newTransition.TransitionedProperties;
|
||||
IList<Transition.TransitionedPropertyInfo> transitionedProperties2 = oldTransition.TransitionedProperties;
|
||||
for (int i = transitionedProperties2.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Transition.TransitionedPropertyInfo transitionedPropertyInfo = transitionedProperties2[i];
|
||||
foreach (Transition.TransitionedPropertyInfo transitionedPropertyInfo2 in transitionedProperties)
|
||||
{
|
||||
bool flag = transitionedPropertyInfo.target == transitionedPropertyInfo2.target && transitionedPropertyInfo.propertyInfo == transitionedPropertyInfo2.propertyInfo;
|
||||
if (flag)
|
||||
{
|
||||
oldTransition.removeProperty(transitionedPropertyInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600015B RID: 347 RVA: 0x00014308 File Offset: 0x00012508
|
||||
private TransitionManager()
|
||||
{
|
||||
this.m_Timer = new Timer(15.0);
|
||||
this.m_Timer.Elapsed += this.onTimerElapsed;
|
||||
this.m_Timer.Enabled = true;
|
||||
}
|
||||
|
||||
// Token: 0x0600015C RID: 348 RVA: 0x00014374 File Offset: 0x00012574
|
||||
private void onTimerElapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
bool flag = this.m_Timer == null;
|
||||
if (!flag)
|
||||
{
|
||||
this.m_Timer.Enabled = false;
|
||||
object @lock = this.m_Lock;
|
||||
IList<Transition> list;
|
||||
lock (@lock)
|
||||
{
|
||||
list = new List<Transition>();
|
||||
foreach (KeyValuePair<Transition, bool> keyValuePair in this.m_Transitions)
|
||||
{
|
||||
list.Add(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
foreach (Transition transition in list)
|
||||
{
|
||||
transition.onTimer();
|
||||
}
|
||||
this.m_Timer.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600015D RID: 349 RVA: 0x00014478 File Offset: 0x00012678
|
||||
private void onTransitionCompleted(object sender, Transition.Args e)
|
||||
{
|
||||
Transition transition = (Transition)sender;
|
||||
transition.TransitionCompletedEvent -= this.onTransitionCompleted;
|
||||
object @lock = this.m_Lock;
|
||||
lock (@lock)
|
||||
{
|
||||
this.m_Transitions.Remove(transition);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000108 RID: 264
|
||||
private static TransitionManager m_Instance;
|
||||
|
||||
// Token: 0x04000109 RID: 265
|
||||
private IDictionary<Transition, bool> m_Transitions = new Dictionary<Transition, bool>();
|
||||
|
||||
// Token: 0x0400010A RID: 266
|
||||
private Timer m_Timer = null;
|
||||
|
||||
// Token: 0x0400010B RID: 267
|
||||
private object m_Lock = new object();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000018 RID: 24
|
||||
internal class TransitionType_Acceleration : ITransitionType
|
||||
{
|
||||
// Token: 0x0600015E RID: 350 RVA: 0x000144E0 File Offset: 0x000126E0
|
||||
public TransitionType_Acceleration(int iTransitionTime)
|
||||
{
|
||||
bool flag = iTransitionTime <= 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Transition time must be greater than zero.");
|
||||
}
|
||||
this.m_dTransitionTime = (double)iTransitionTime;
|
||||
}
|
||||
|
||||
// Token: 0x0600015F RID: 351 RVA: 0x00014524 File Offset: 0x00012724
|
||||
public void onTimer(int iTime, out double dPercentage, out bool bCompleted)
|
||||
{
|
||||
double num = (double)iTime / this.m_dTransitionTime;
|
||||
dPercentage = num * num;
|
||||
bool flag = num >= 1.0;
|
||||
if (flag)
|
||||
{
|
||||
dPercentage = 1.0;
|
||||
bCompleted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCompleted = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400010C RID: 268
|
||||
private double m_dTransitionTime = 0.0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000019 RID: 25
|
||||
internal class TransitionType_Bounce : TransitionType_UserDefined
|
||||
{
|
||||
// Token: 0x06000160 RID: 352 RVA: 0x0001456C File Offset: 0x0001276C
|
||||
public TransitionType_Bounce(int iTransitionTime)
|
||||
{
|
||||
base.setup(new List<TransitionElement>
|
||||
{
|
||||
new TransitionElement(50.0, 100.0, InterpolationMethod.Accleration),
|
||||
new TransitionElement(100.0, 0.0, InterpolationMethod.Deceleration)
|
||||
}, iTransitionTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200001A RID: 26
|
||||
internal class TransitionType_CriticalDamping : ITransitionType
|
||||
{
|
||||
// Token: 0x06000161 RID: 353 RVA: 0x000145D0 File Offset: 0x000127D0
|
||||
public TransitionType_CriticalDamping(int iTransitionTime)
|
||||
{
|
||||
bool flag = iTransitionTime <= 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Transition time must be greater than zero.");
|
||||
}
|
||||
this.m_dTransitionTime = (double)iTransitionTime;
|
||||
}
|
||||
|
||||
// Token: 0x06000162 RID: 354 RVA: 0x00014614 File Offset: 0x00012814
|
||||
public void onTimer(int iTime, out double dPercentage, out bool bCompleted)
|
||||
{
|
||||
double num = (double)iTime / this.m_dTransitionTime;
|
||||
dPercentage = (1.0 - Math.Exp(-1.0 * num * 5.0)) / 0.993262053;
|
||||
bool flag = num >= 1.0;
|
||||
if (flag)
|
||||
{
|
||||
dPercentage = 1.0;
|
||||
bCompleted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCompleted = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400010D RID: 269
|
||||
private double m_dTransitionTime = 0.0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200001B RID: 27
|
||||
internal class TransitionType_Deceleration : ITransitionType
|
||||
{
|
||||
// Token: 0x06000163 RID: 355 RVA: 0x00014688 File Offset: 0x00012888
|
||||
public TransitionType_Deceleration(int iTransitionTime)
|
||||
{
|
||||
bool flag = iTransitionTime <= 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Transition time must be greater than zero.");
|
||||
}
|
||||
this.m_dTransitionTime = (double)iTransitionTime;
|
||||
}
|
||||
|
||||
// Token: 0x06000164 RID: 356 RVA: 0x000146CC File Offset: 0x000128CC
|
||||
public void onTimer(int iTime, out double dPercentage, out bool bCompleted)
|
||||
{
|
||||
double num = (double)iTime / this.m_dTransitionTime;
|
||||
dPercentage = num * (2.0 - num);
|
||||
bool flag = num >= 1.0;
|
||||
if (flag)
|
||||
{
|
||||
dPercentage = 1.0;
|
||||
bCompleted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCompleted = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400010E RID: 270
|
||||
private double m_dTransitionTime = 0.0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200001C RID: 28
|
||||
internal class TransitionType_EaseInEaseOut : ITransitionType
|
||||
{
|
||||
// Token: 0x06000165 RID: 357 RVA: 0x00014720 File Offset: 0x00012920
|
||||
public TransitionType_EaseInEaseOut(int iTransitionTime)
|
||||
{
|
||||
bool flag = iTransitionTime <= 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Transition time must be greater than zero.");
|
||||
}
|
||||
this.m_dTransitionTime = (double)iTransitionTime;
|
||||
}
|
||||
|
||||
// Token: 0x06000166 RID: 358 RVA: 0x00014764 File Offset: 0x00012964
|
||||
public void onTimer(int iTime, out double dPercentage, out bool bCompleted)
|
||||
{
|
||||
double num = (double)iTime / this.m_dTransitionTime;
|
||||
dPercentage = Utility.convertLinearToEaseInEaseOut(num);
|
||||
bool flag = num >= 1.0;
|
||||
if (flag)
|
||||
{
|
||||
dPercentage = 1.0;
|
||||
bCompleted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCompleted = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400010F RID: 271
|
||||
private double m_dTransitionTime = 0.0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200001D RID: 29
|
||||
internal class TransitionType_Flash : TransitionType_UserDefined
|
||||
{
|
||||
// Token: 0x06000167 RID: 359 RVA: 0x000147B0 File Offset: 0x000129B0
|
||||
public TransitionType_Flash(int iNumberOfFlashes, int iFlashTime)
|
||||
{
|
||||
double num = 100.0 / (double)iNumberOfFlashes;
|
||||
IList<TransitionElement> list = new List<TransitionElement>();
|
||||
for (int i = 0; i < iNumberOfFlashes; i++)
|
||||
{
|
||||
double num2 = (double)i * num;
|
||||
double num3 = num2 + num;
|
||||
double num4 = (num2 + num3) / 2.0;
|
||||
list.Add(new TransitionElement(num4, 100.0, InterpolationMethod.EaseInEaseOut));
|
||||
list.Add(new TransitionElement(num3, 0.0, InterpolationMethod.EaseInEaseOut));
|
||||
}
|
||||
base.setup(list, iFlashTime * iNumberOfFlashes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200001E RID: 30
|
||||
internal class TransitionType_Linear : ITransitionType
|
||||
{
|
||||
// Token: 0x06000168 RID: 360 RVA: 0x00014844 File Offset: 0x00012A44
|
||||
public TransitionType_Linear(int iTransitionTime)
|
||||
{
|
||||
bool flag = iTransitionTime <= 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Transition time must be greater than zero.");
|
||||
}
|
||||
this.m_dTransitionTime = (double)iTransitionTime;
|
||||
}
|
||||
|
||||
// Token: 0x06000169 RID: 361 RVA: 0x00014888 File Offset: 0x00012A88
|
||||
public void onTimer(int iTime, out double dPercentage, out bool bCompleted)
|
||||
{
|
||||
dPercentage = (double)iTime / this.m_dTransitionTime;
|
||||
bool flag = dPercentage >= 1.0;
|
||||
if (flag)
|
||||
{
|
||||
dPercentage = 1.0;
|
||||
bCompleted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCompleted = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000110 RID: 272
|
||||
private double m_dTransitionTime = 0.0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x0200001F RID: 31
|
||||
internal class TransitionType_ThrowAndCatch : TransitionType_UserDefined
|
||||
{
|
||||
// Token: 0x0600016A RID: 362 RVA: 0x000148CC File Offset: 0x00012ACC
|
||||
public TransitionType_ThrowAndCatch(int iTransitionTime)
|
||||
{
|
||||
base.setup(new List<TransitionElement>
|
||||
{
|
||||
new TransitionElement(50.0, 100.0, InterpolationMethod.Deceleration),
|
||||
new TransitionElement(100.0, 0.0, InterpolationMethod.Accleration)
|
||||
}, iTransitionTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000020 RID: 32
|
||||
internal class TransitionType_UserDefined : ITransitionType
|
||||
{
|
||||
// Token: 0x0600016B RID: 363 RVA: 0x0001492E File Offset: 0x00012B2E
|
||||
public TransitionType_UserDefined()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600016C RID: 364 RVA: 0x00014955 File Offset: 0x00012B55
|
||||
public TransitionType_UserDefined(IList<TransitionElement> elements, int iTransitionTime)
|
||||
{
|
||||
this.setup(elements, iTransitionTime);
|
||||
}
|
||||
|
||||
// Token: 0x0600016D RID: 365 RVA: 0x00014988 File Offset: 0x00012B88
|
||||
public void setup(IList<TransitionElement> elements, int iTransitionTime)
|
||||
{
|
||||
this.m_Elements = elements;
|
||||
this.m_dTransitionTime = (double)iTransitionTime;
|
||||
bool flag = elements.Count == 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("The list of elements passed to the constructor of TransitionType_UserDefined had zero elements. It must have at least one element.");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600016E RID: 366 RVA: 0x000149C0 File Offset: 0x00012BC0
|
||||
public void onTimer(int iTime, out double dPercentage, out bool bCompleted)
|
||||
{
|
||||
double num = (double)iTime / this.m_dTransitionTime;
|
||||
double num2;
|
||||
double num3;
|
||||
double num4;
|
||||
double num5;
|
||||
InterpolationMethod interpolationMethod;
|
||||
this.getElementInfo(num, out num2, out num3, out num4, out num5, out interpolationMethod);
|
||||
double num6 = num3 - num2;
|
||||
double num7 = num - num2;
|
||||
double num8 = num7 / num6;
|
||||
double num9;
|
||||
switch (interpolationMethod)
|
||||
{
|
||||
case InterpolationMethod.Linear:
|
||||
num9 = num8;
|
||||
break;
|
||||
case InterpolationMethod.Accleration:
|
||||
num9 = Utility.convertLinearToAcceleration(num8);
|
||||
break;
|
||||
case InterpolationMethod.Deceleration:
|
||||
num9 = Utility.convertLinearToDeceleration(num8);
|
||||
break;
|
||||
case InterpolationMethod.EaseInEaseOut:
|
||||
num9 = Utility.convertLinearToEaseInEaseOut(num8);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Interpolation method not handled: " + interpolationMethod.ToString());
|
||||
}
|
||||
dPercentage = Utility.interpolate(num4, num5, num9);
|
||||
bool flag = (double)iTime >= this.m_dTransitionTime;
|
||||
if (flag)
|
||||
{
|
||||
bCompleted = true;
|
||||
dPercentage = num5;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCompleted = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600016F RID: 367 RVA: 0x00014A90 File Offset: 0x00012C90
|
||||
private void getElementInfo(double dTimeFraction, out double dStartTime, out double dEndTime, out double dStartValue, out double dEndValue, out InterpolationMethod eInterpolationMethod)
|
||||
{
|
||||
int count = this.m_Elements.Count;
|
||||
while (this.m_iCurrentElement < count)
|
||||
{
|
||||
TransitionElement transitionElement = this.m_Elements[this.m_iCurrentElement];
|
||||
double num = transitionElement.EndTime / 100.0;
|
||||
bool flag = dTimeFraction < num;
|
||||
if (flag)
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.m_iCurrentElement++;
|
||||
}
|
||||
bool flag2 = this.m_iCurrentElement == count;
|
||||
if (flag2)
|
||||
{
|
||||
this.m_iCurrentElement = count - 1;
|
||||
}
|
||||
dStartTime = 0.0;
|
||||
dStartValue = 0.0;
|
||||
bool flag3 = this.m_iCurrentElement > 0;
|
||||
if (flag3)
|
||||
{
|
||||
TransitionElement transitionElement2 = this.m_Elements[this.m_iCurrentElement - 1];
|
||||
dStartTime = transitionElement2.EndTime / 100.0;
|
||||
dStartValue = transitionElement2.EndValue / 100.0;
|
||||
}
|
||||
TransitionElement transitionElement3 = this.m_Elements[this.m_iCurrentElement];
|
||||
dEndTime = transitionElement3.EndTime / 100.0;
|
||||
dEndValue = transitionElement3.EndValue / 100.0;
|
||||
eInterpolationMethod = transitionElement3.InterpolationMethod;
|
||||
}
|
||||
|
||||
// Token: 0x04000111 RID: 273
|
||||
private IList<TransitionElement> m_Elements = null;
|
||||
|
||||
// Token: 0x04000112 RID: 274
|
||||
private double m_dTransitionTime = 0.0;
|
||||
|
||||
// Token: 0x04000113 RID: 275
|
||||
private int m_iCurrentElement = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Bunifu.Licensing.Views.Transitions
|
||||
{
|
||||
// Token: 0x02000021 RID: 33
|
||||
internal class Utility
|
||||
{
|
||||
// Token: 0x06000170 RID: 368 RVA: 0x00014BBC File Offset: 0x00012DBC
|
||||
public static object getValue(object target, string strPropertyName)
|
||||
{
|
||||
Type type = target.GetType();
|
||||
PropertyInfo property = type.GetProperty(strPropertyName);
|
||||
bool flag = property == null;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Object: " + target.ToString() + " does not have the property: " + strPropertyName);
|
||||
}
|
||||
return property.GetValue(target, null);
|
||||
}
|
||||
|
||||
// Token: 0x06000171 RID: 369 RVA: 0x00014C10 File Offset: 0x00012E10
|
||||
public static void setValue(object target, string strPropertyName, object value)
|
||||
{
|
||||
Type type = target.GetType();
|
||||
PropertyInfo property = type.GetProperty(strPropertyName);
|
||||
bool flag = property == null;
|
||||
if (flag)
|
||||
{
|
||||
throw new Exception("Object: " + target.ToString() + " does not have the property: " + strPropertyName);
|
||||
}
|
||||
property.SetValue(target, value, null);
|
||||
}
|
||||
|
||||
// Token: 0x06000172 RID: 370 RVA: 0x00014C60 File Offset: 0x00012E60
|
||||
public static double interpolate(double d1, double d2, double dPercentage)
|
||||
{
|
||||
double num = d2 - d1;
|
||||
double num2 = num * dPercentage;
|
||||
return d1 + num2;
|
||||
}
|
||||
|
||||
// Token: 0x06000173 RID: 371 RVA: 0x00014C80 File Offset: 0x00012E80
|
||||
public static int interpolate(int i1, int i2, double dPercentage)
|
||||
{
|
||||
return (int)Utility.interpolate((double)i1, (double)i2, dPercentage);
|
||||
}
|
||||
|
||||
// Token: 0x06000174 RID: 372 RVA: 0x00014CA0 File Offset: 0x00012EA0
|
||||
public static float interpolate(float f1, float f2, double dPercentage)
|
||||
{
|
||||
return (float)Utility.interpolate((double)f1, (double)f2, dPercentage);
|
||||
}
|
||||
|
||||
// Token: 0x06000175 RID: 373 RVA: 0x00014CC0 File Offset: 0x00012EC0
|
||||
public static double convertLinearToEaseInEaseOut(double dElapsed)
|
||||
{
|
||||
double num = ((dElapsed > 0.5) ? 0.5 : dElapsed);
|
||||
double num2 = ((dElapsed > 0.5) ? (dElapsed - 0.5) : 0.0);
|
||||
return 2.0 * num * num + 2.0 * num2 * (1.0 - num2);
|
||||
}
|
||||
|
||||
// Token: 0x06000176 RID: 374 RVA: 0x00014D38 File Offset: 0x00012F38
|
||||
public static double convertLinearToAcceleration(double dElapsed)
|
||||
{
|
||||
return dElapsed * dElapsed;
|
||||
}
|
||||
|
||||
// Token: 0x06000177 RID: 375 RVA: 0x00014D50 File Offset: 0x00012F50
|
||||
public static double convertLinearToDeceleration(double dElapsed)
|
||||
{
|
||||
return dElapsed * (2.0 - dElapsed);
|
||||
}
|
||||
|
||||
// Token: 0x06000178 RID: 376 RVA: 0x00014D70 File Offset: 0x00012F70
|
||||
public static void raiseEvent<T>(EventHandler<T> theEvent, object sender, T args) where T : EventArgs
|
||||
{
|
||||
bool flag = theEvent == null;
|
||||
if (!flag)
|
||||
{
|
||||
foreach (EventHandler<T> eventHandler in theEvent.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
ISynchronizeInvoke synchronizeInvoke = eventHandler.Target as ISynchronizeInvoke;
|
||||
bool flag2 = synchronizeInvoke == null || !synchronizeInvoke.InvokeRequired;
|
||||
if (flag2)
|
||||
{
|
||||
eventHandler(sender, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
synchronizeInvoke.BeginInvoke(eventHandler, new object[] { sender, args });
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user