Пример #1
0
        static bool TryConvertMatrix <T>(object prop, out T result)
        {
            result = default(T);

            if (prop.GetType() == typeof(string) && typeof(T) == typeof(Matrix))
            {
                Matrix matrix = ParsingUtils.ParseCATransform3D((string)prop);
                result = (T)((object)matrix);
                return(true);
            }

            return(false);
        }
Пример #2
0
        bool TryConvertFont <T>(object prop, out T result)
        {
            result = default(T);

            if (prop.GetType() == typeof(string) && typeof(T) == typeof(Font))
            {
                Font font = ParsingUtils.ParseUIFont((string)prop);
                result = (T)((object)font);

                return(true);
            }

            return(false);
        }
Пример #3
0
        static bool TryConvertColor <T>(object prop, out T result)
        {
            result = default(T);

            if (typeof(T) == typeof(Color))
            {
#if __IOS__
                Color color = ParsingUtils.ParseUIColor((string)prop);
                result = (T)((object)color);
                return(true);
#else
                uint  intColor = (uint)((float)prop);
                Color color    = Color.FromUint(intColor);
                result = (T)((object)color);
                return(true);
#endif
            }

            return(false);
        }