Exemple #1
0
        unsafe static void InitializePlatform(InitializationOptions *options)
        {
            // BaseDirectory may not be set in some Mono embedded environments
            // so try some reasonable fallbacks in these cases.
            string basePath = AppDomain.CurrentDomain.BaseDirectory;

            if (!string.IsNullOrEmpty(basePath))
            {
                basePath = Path.Combine(basePath, "..");
            }
            else
            {
                basePath = Assembly.GetExecutingAssembly().Location;
                if (!string.IsNullOrEmpty(basePath))
                {
                    basePath = Path.Combine(Path.GetDirectoryName(basePath), "..");
                }
                else
                {
                    // The executing assembly location may be null if loaded from
                    // memory so the final fallback is the current directory
                    basePath = Path.Combine(Environment.CurrentDirectory, "..");
                }
            }

            ResourcesPath  = Path.Combine(basePath, "Resources");
            FrameworksPath = Path.Combine(basePath, "Frameworks");
        }
Exemple #2
0
        static unsafe void InitializeCoreCLRBridge(InitializationOptions *options)
        {
            if (options->xamarin_objc_msgsend != IntPtr.Zero)
            {
                ObjectiveCMarshal.SetMessageSendCallback(ObjectiveCMarshal.MessageSendFunction.MsgSend, options->xamarin_objc_msgsend);
            }

            if (options->xamarin_objc_msgsend_super != IntPtr.Zero)
            {
                ObjectiveCMarshal.SetMessageSendCallback(ObjectiveCMarshal.MessageSendFunction.MsgSendSuper, options->xamarin_objc_msgsend_super);
            }

            if (options->xamarin_objc_msgsend_stret != IntPtr.Zero)
            {
                ObjectiveCMarshal.SetMessageSendCallback(ObjectiveCMarshal.MessageSendFunction.MsgSendStret, options->xamarin_objc_msgsend_stret);
            }

            if (options->xamarin_objc_msgsend_super_stret != IntPtr.Zero)
            {
                ObjectiveCMarshal.SetMessageSendCallback(ObjectiveCMarshal.MessageSendFunction.MsgSendSuperStret, options->xamarin_objc_msgsend_super_stret);
            }

            delegate * unmanaged <void> beginEndCallback            = (delegate * unmanaged <void>)options->reference_tracking_begin_end_callback;
            delegate * unmanaged <IntPtr, int> isReferencedCallback = (delegate * unmanaged <IntPtr, int>)options->reference_tracking_is_referenced_callback;
            delegate * unmanaged <IntPtr, void> trackedObjectEnteredFinalization = (delegate * unmanaged <IntPtr, void>)options->reference_tracking_tracked_object_entered_finalization;
            ObjectiveCMarshal.Initialize(beginEndCallback, isReferencedCallback, trackedObjectEnteredFinalization, UnhandledExceptionPropagationHandler);
        }
Exemple #3
0
        public static Arch Arch;         // default: = Arch.DEVICE;

        unsafe static void InitializePlatform(InitializationOptions *options)
        {
            if (options->IsSimulator)
            {
                Arch = Arch.SIMULATOR;
            }

            UIApplication.Initialize();
        }
Exemple #4
0
        unsafe static void InitializePlatform(InitializationOptions *options)
        {
#if !__MACCATALYST__ && !NET
            if (options->IsSimulator)
            {
                Arch = Arch.SIMULATOR;
            }
#endif

            UIApplication.Initialize();
        }