Esempio n. 1
0
        private void ToggleRemoteAccess()
        {
            var remoteAccessEnabled = WebSocketDataGetter.RemoteAccessEnabled(_settings);
            var newValue            = remoteAccessEnabled
                ? WebSocketDataGetter.HttpServerAddress.Default <string>()
                : "http://*";

            _settings.Add(WebSocketDataGetter.HttpServerAddress.Name, newValue);
            _restarter($"Applying web overlay remote access settings ({newValue})");
        }
Esempio n. 2
0
        public object GetUiSettings()
        {
            if (_webOverlaySettings == null || _webOverlaySettings.IsDisposed)
            {
                var filesLocation = WebSocketDataGetter.HttpContentRoot(_saver);
                var webUrl        = WebSocketDataGetter.BaseAddress(_settings);
                _webOverlaySettings = new WebOverlaySettings(_settings, OverlayConfiguration);
                _webOverlaySettings.ResetSettings      += (_, __) => ResetSettings();
                _webOverlaySettings.OpenWebUrl         += (_, __) => ProcessExt.OpenUrl(webUrl);
                _webOverlaySettings.OpenFilesFolder    += (_, __) => Process.Start("explorer.exe", filesLocation);
                _webOverlaySettings.FilesLocation       = filesLocation;
                _webOverlaySettings.WebUrl              = webUrl;
                _webOverlaySettings.RemoteAccessEnabled = WebSocketDataGetter.RemoteAccessEnabled(_settings);
                _webOverlaySettings.ToggleRemoteAccess += (_, __) => ToggleRemoteAccess();
            }

            return(_webOverlaySettings);
        }