Beispiel #1
0
        internal static T GetNativeObject <T>(object obj, string objName)
            where T : class
        {
            if (typeof(T) != typeof(UIViewController) && obj == null)
            {
                return(null);
            }

            return(TargetFactory.GetNativeObject(obj, objName, typeof(T)) as T);
        }
Beispiel #2
0
        internal static T GetNativeObject <T>(object obj, string objName, bool allowNull)
            where T : class
        {
            if (allowNull && obj == null)
            {
                return(null);
            }

            obj = TargetFactory.GetNativeObject(obj, objName, typeof(T), typeof(ISealedElement));
            var seal = obj as ISealedElement;

            if (seal != null)
            {
                return(seal.Element as T);
            }
            return(obj as T);
        }