//class ValidationException:Exception
        //{

        //}

        void reset_settings(object sender, RoutedEventArgs e)
        {
            //if (!Message.YesNo("Settings will be reset to their initial state. Proceed?"))
            //    return;
            //general.Reset();
            //general = Cliver.CisteraScreenCaptureService.Settings.General.GetResetInstance<Cliver.CisteraScreenCaptureService.Settings.GeneralSettings>();
            general = UiApiClient.GetServiceSettings(true);
            set();
        }
        SettingsWindow()
        {
            InitializeComponent();
            System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(this);

            Icon = AssemblyRoutines.GetAppIconImageSource();

            ContentRendered += delegate
            {
                //this.MinHeight = this.ActualHeight;
                //this.MaxHeight = this.ActualHeight;
                //this.MinWidth = this.ActualWidth;
            };

            WpfRoutines.AddFadeEffect(this, 300);

            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            //WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //DefaultServerIp.ValueDataType = typeof(IPAddress);

            general = UiApiClient.GetServiceSettings();
            if (general == null)
            {
                ok.IsEnabled    = false;
                reset.IsEnabled = false;
                Message.Error("The service is unavailable.");
                return;
            }
            set();

            if (!ProcessRoutines.ProcessHasElevatedPrivileges() && !ProcessRoutines.ProcessIsSystem() /*used for configuration during installing*/)
            {
                ok.IsEnabled    = false;
                reset.IsEnabled = false;
                if (Message.YesNo("Settings modification requires elevated privileges. Would you like to restart this application 'As Administrator'?"))
                {
                    ProcessRoutines.Restart(true);
                }
            }
        }