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); }
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)); }
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)); }
public static Dictionary <TKey, TValue> ToDictionary <TKey, TValue>(this SerializableDictionary <TKey, TValue> d) { return(RTHelper.CreateDictionary(d.Keys, d.Values)); }
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); }
public static Dictionary <TKey, TValue> ToDictionary <TKey, TValue>(this KVPList <TKey, TValue> d) { return(RTHelper.CreateDictionary(d.Keys, d.Values)); }