Esempio n. 1
0
 private static ColorDuo GetColorDuo(ref ColorDuo cd, string c1, string c2)
 {
     if (cd == null)
     {
         cd = new ColorDuo(RTHelper.HexToColor(c1), RTHelper.HexToColor(c2));
     }
     return(cd);
 }
Esempio n. 2
0
        public void ShouldAcceptParentTypeForInheritedMembers()
        {
            var mb = RTHelper.GetMemberAccessor(typeof(TestB), "PropInt");
            var a1 = CreateTestObject();
            int v1 = (int)mb.GetValue(a1);

            Assert.That(v1, Is.EqualTo(48));
        }
Esempio n. 3
0
        public void ShouldAcceptChildTypeForInheritedMembers()
        {
            var mb = RTHelper.GetMemberAccessor(typeof(TestA), "PropInt");
            var b1 = new TestB
            {
                PropInt = 48
            };
            int v1 = (int)mb.GetValue(b1);

            Assert.That(v1, Is.EqualTo(48));
        }
Esempio n. 4
0
 public static Dictionary <TKey, TValue> ToDictionary <TKey, TValue>(this SerializableDictionary <TKey, TValue> d)
 {
     return(RTHelper.CreateDictionary(d.Keys, d.Values));
 }
Esempio n. 5
0
 public static Texture2D GetHelpIcon(MessageType type)
 {
     getHelpIcon = RTHelper.LazyValue(() => getHelpIcon, value => getHelpIcon = value, () =>
                                      typeof(EditorGUIUtility).GetMethod("GetHelpIcon", BF.Static | BF.NonPublic));
     return(getHelpIcon.Invoke(null, new object[] { type }) as Texture2D);
 }
Esempio n. 6
0
 public static Dictionary <TKey, TValue> ToDictionary <TKey, TValue>(this KVPList <TKey, TValue> d)
 {
     return(RTHelper.CreateDictionary(d.Keys, d.Values));
 }