Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Application"/> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <exception cref="System.InvalidOperationException">Application must be run on main application process.</exception>
        protected Application(ApplicationContext settings)
            : base(settings)
        {
            if (HtmlUiRuntime.ApplicationType != ApplicationType.Application)
            {
                throw new InvalidOperationException("Application must be run on main application process.");
            }

            SynchronizationContext.SetSynchronizationContext(new HtmlUiSynchronizationContext());

            InitializeInvokeQueue();

            ContentProvider           = new FileAssemblyContentProvider();
            ControllerProvider        = new AssemblyControllerProvider();
            RequestHostname           = "localhost";
            NativeRequestPort         = 16556;
            D3D11Enabled              = settings.D3D11Enabled;
            RemoteDebuggingPort       = settings.RemoteDebuggingPort ?? 0;
            CommandLineArgsEnabled    = settings.CommandLineArgsEnabled;
            ChromeViewsEnabled        = settings.ChromeViewsEnabled;
            IncludeHtmUiScriptMapping = settings.IncludeHtmUiScriptMapping;
            LogSeverity = settings.LogSeverity;

            MimeTypes    = GetDefaultMimeTypes();
            SyncMaxDepth = 10;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMainApplication"/> class.
        /// </summary>
        /// <exception cref="System.InvalidOperationException">You can only have one instance of Application at any given time.</exception>
        protected BaseMainApplication()
            : base()
        {
            if (HtmlUiRuntime.ApplicationType != ApplicationType.MainApplication)
            {
                throw new InvalidOperationException("Application must be run on main application process.");
            }

            SynchronizationContext.SetSynchronizationContext(new HtmlUiSynchronizationContext());

            InitializeInvokeQueue();

            ContentProvider    = new FileAssemblyContentProvider();
            ControllerProvider = new AssemblyControllerProvider();
            RequestHostname    = "localhost";
            NativeRequestPort  = 16556;

            MimeTypes    = GetDefaultMimeTypes();
            SyncMaxDepth = 10;
        }