Exemplo n.º 1
0
        private void ShowCurrentSettings()
        {
            if (_dbSettings == null)
            {
                _dbSettings = new RemoteDBSettings();
            }

            NSDictionary settings = _dbSettings.GetConfigSettings();

            NSString config         = (NSString)settings.ValueForKey(GDiOS.GDAppConfigKeyConfig);
            NSNumber copyPasteOn    = (NSNumber)settings.ValueForKey(GDiOS.GDAppConfigKeyCopyPasteOn);
            NSNumber detailedLogsOn = (NSNumber)settings.ValueForKey(GDiOS.GDAppConfigKeyDetailedLogsOn);
            NSString userEmail      = (NSString)settings.ValueForKey(GDiOS.GDAppConfigKeyUserId);

            GDAppServer firstServer = (GDAppServer)settings.ValueForKey(GDiOS.GDAppConfigKeyServers);

            StringBuilder builder = new StringBuilder();

            if (firstServer != null)
            {
                if (!string.IsNullOrWhiteSpace(firstServer.Server))
                {
                    builder.AppendLine(String.Format("Server Host: {0}", firstServer.Server));
                }
                if (firstServer.Port != null)
                {
                    builder.AppendLine(String.Format("Server Port: {0}", firstServer.Port.Int32Value));
                }
                if (firstServer.Priority != null)
                {
                    builder.AppendLine(String.Format("Server Priority: {0}", firstServer.Priority.Int32Value));
                }
                if (config != null)
                {
                    builder.AppendLine(String.Format("Config: {0}", config));
                }
                if (copyPasteOn != null)
                {
                    builder.AppendLine(String.Format("Data Leakage Security Policy: {0}", copyPasteOn.Int32Value));
                }
                if (detailedLogsOn != null)
                {
                    builder.AppendLine(String.Format("Logging Level: {0}", detailedLogsOn.Int32Value));
                }
                if (userEmail != null)
                {
                    builder.AppendLine(String.Format("User Email: {0}", userEmail));
                }
            }

            UIAlertView alertView = new UIAlertView("App Config Change", builder.ToString(), null, "OK", null);

            alertView.Show();
        }
Exemplo n.º 2
0
        private bool StoreRemoteSettings(NSString serverHost, NSNumber port, NSNumber priority, NSString config, NSNumber cpOn, NSNumber dlOn, NSString email)
        {
            if (_dbSettings == null)
            {
                _dbSettings = new RemoteDBSettings();
            }

            int  portInt     = port == null ? 0 : port.Int32Value;
            int  priorityInt = priority == null ? 0 : priority.Int32Value;
            bool result      = _dbSettings.UpdateRemoteSettings(serverHost, portInt, priorityInt, config, cpOn.Int32Value, dlOn.Int32Value, email);

            return(result);
        }