Exemplo n.º 1
0
        public static void Initialize()
        {
            if (platformService != null)
            {
                return;
            }
            object[] platforms = AddinManager.GetExtensionObjects("/MonoDevelop/Core/PlatformService");
            if (platforms.Length > 0)
            {
                platformService = (PlatformService)platforms [0];
            }
            else
            {
                platformService = new DefaultPlatformService();
                LoggingService.LogFatalError("A platform service implementation has not been found.");
            }
            PlatformService.Initialize();
            if (PlatformService.CanOpenTerminal)
            {
                Runtime.ProcessService.SetExternalConsoleHandler(PlatformService.StartConsoleProcess);
            }

            FileService.FileRemoved += NotifyFileRemoved;
            FileService.FileRenamed += NotifyFileRenamed;

            // Ensure we initialize the native toolkit on the UI thread immediately
            // so that we can safely access this property later in other threads
            GC.KeepAlive(NativeToolkit);

            FontService.Initialize();
        }