/// <inheritdoc/>
		public void Initialize(UltravioletContext owner, UltravioletFactory factory)
		{
			MonoMac.AppKit.NSApplication.Init();

			factory.RemoveFactoryMethod<SurfaceSourceFactory>();
			factory.RemoveFactoryMethod<SurfaceSaverFactory>();
			factory.RemoveFactoryMethod<IconLoaderFactory>();
			factory.RemoveFactoryMethod<ScreenDensityServiceFactory>();

			factory.SetFactoryMethod<SurfaceSourceFactory>((stream) => new OSXSurfaceSource(stream));
			factory.SetFactoryMethod<SurfaceSaverFactory>(() => new OSXSurfaceSaver());
			factory.SetFactoryMethod<IconLoaderFactory>(() => new OSXIconLoader());
			factory.SetFactoryMethod<ScreenDensityServiceFactory>((display) => new OSXScreenDensityService(display));
		}
        /// <inheritdoc/>
        public void Initialize(UltravioletContext owner, UltravioletFactory factory)
        {
            MonoMac.AppKit.NSApplication.Init();

            factory.RemoveFactoryMethod <SurfaceSourceFactory>();
            factory.RemoveFactoryMethod <SurfaceSaverFactory>();
            factory.RemoveFactoryMethod <IconLoaderFactory>();
            factory.RemoveFactoryMethod <ScreenDensityServiceFactory>();

            factory.SetFactoryMethod <SurfaceSourceFactory>((stream) => new OSXSurfaceSource(stream));
            factory.SetFactoryMethod <SurfaceSaverFactory>(() => new OSXSurfaceSaver());
            factory.SetFactoryMethod <IconLoaderFactory>(() => new OSXIconLoader());
            factory.SetFactoryMethod <ScreenDensityServiceFactory>((display) => new OSXScreenDensityService(display));
        }
Exemple #3
0
        /// <summary>
        /// Registers <see cref="dotTraceProfiler"/> as the profiler for the current Ultraviolet context.
        /// </summary>
        /// <param name="owner">The Ultraviolet context with which to register the profiler.</param>
        /// <param name="factory">The Ultraviolet factory for the Ultraviolet context.</param>
        /// <remarks>This method must be called during the application's initialization phase, before any
        /// of the static methods on <see cref="UltravioletProfiler"/> have been invoked.</remarks>
        public static void RegisterProfiler(UltravioletContext owner, UltravioletFactory factory)
        {
            Contract.Require(owner, nameof(owner));
            Contract.Require(factory, nameof(factory));

            factory.RemoveFactoryMethod <UltravioletProfilerFactory>();
            factory.SetFactoryMethod <UltravioletProfilerFactory>(uv => new dotTraceProfiler(uv));
        }
        /// <summary>
        /// Registers <see cref="dotTraceProfiler"/> as the profiler for the current Ultraviolet context.
        /// </summary>
        /// <param name="owner">The Ultraviolet context with which to register the profiler.</param>
        /// <param name="factory">The Ultraviolet factory for the Ultraviolet context.</param>
        /// <remarks>This method must be called during the application's initialization phase, before any 
        /// of the static methods on <see cref="UltravioletProfiler"/> have been invoked.</remarks>
        public static void RegisterProfiler(UltravioletContext owner, UltravioletFactory factory)
        {
            Contract.Require(owner, "owner");
            Contract.Require(factory, "factory");

            factory.RemoveFactoryMethod<UltravioletProfilerFactory>();
            factory.SetFactoryMethod<UltravioletProfilerFactory>(uv => new dotTraceProfiler(uv));
        }