At.FF.Krems.FullscreenBrowser.SilentWebserver.Initialize C# (CSharp) Method

Initialize() public method

Initializes the silent webserver.
public Initialize ( string url, int port ) : void
url string The url.
port int The port.
return void
        public void Initialize(string url, int port)
        {
            if (this.initializeCalled)
            {
                return;
            }

            this.initializeCalled = true;
            try
            {
                using (var currentUser = Registry.CurrentUser)
                {
                    using (var registryKey = currentUser.OpenSubKey("SOFTWARE\\Microsoft\\Internet Explorer\\PageSetup", true))
                    {
                        if (registryKey != null)
                        {
                            registryKey.SetValue("footer", string.Empty);
                            registryKey.SetValue("header", string.Empty);
                            registryKey.SetValue("margin_bottom", "0.590550");
                            registryKey.SetValue("margin_left", "0.393700");
                            registryKey.SetValue("margin_right", "0.393700");
                            registryKey.SetValue("margin_top", "0.393700");
                            registryKey.SetValue("Print_Background", "yes");
                            registryKey.SetValue("Shrink_To_Fit", "yes");
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Logger.Warn(exception);
            }

            var httpServer = Bootstrapper.GetInstance<IHttpServer>();
            httpServer.Init();
        }