예제 #1
0
                      List <Dictionary <string, bool> > > GetConfigItems(string identity)
        {
            var stringValues = new List <Dictionary <string, string> >();
            var numberValues = new List <Dictionary <string, double> >();
            var boolValues   = new List <Dictionary <string, bool> >();

            try
            {
                var items = _configManager.GetAppConfig(identity);
                foreach (var item in items.FullData)
                {
                    var dict = new Dictionary <string, string>();
                    foreach (var key in item.Keys)
                    {
                        var value = item[key];
                        dict.Add(key, value);
                    }
                    stringValues.Add(dict);
                }
            }
            catch (Exception ex)
            {
                _loggingService.LogError(typeof(ConfigManagerService), ex, "Error Converting Configuration Data");
            }

            return(new Tuple <List <Dictionary <string, string> >, List <Dictionary <string, double> >, List <Dictionary <string, bool> > >(stringValues, numberValues, boolValues));
        }
예제 #2
0
        public override View OnMAMCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.fragment_about, container, false);

            // Needed to make the links active
            TextView body1 = view.FindViewById <TextView>(Resource.Id.about_nav_body_1);

            body1.MovementMethod = LinkMovementMethod.Instance;
            TextView body2 = view.FindViewById <TextView>(Resource.Id.about_nav_body_2);

            body2.MovementMethod = LinkMovementMethod.Instance;
            TextView footer = view.FindViewById <TextView>(Resource.Id.about_nav_footer);

            footer.MovementMethod = LinkMovementMethod.Instance;

            TextView configText = view.FindViewById <TextView>(Resource.Id.about_nav_config_text);

            // Get and show the targeted application configuration
            IMAMAppConfigManager configManager = MAMComponents.Get <IMAMAppConfigManager>();
            IMAMAppConfig        appConfig     = configManager.GetAppConfig(AuthManager.User);

            if (appConfig == null)
            {
                configText.Text = GetString(Resource.String.err_unset);
            }
            else
            {
                StringBuilder builder = new StringBuilder();
                IList <IDictionary <string, string> > appConfigData = appConfig.FullData;
                foreach (IDictionary <string, string> dictionary in appConfigData)
                {
                    foreach (KeyValuePair <string, string> kvp in dictionary)
                    {
                        builder.AppendLine(string.Format("Key = {0}, Value = {1}", kvp.Key, kvp.Value));
                    }
                }

                configText.Text = GetString(Resource.String.about_nav_config_text, builder.ToString());
            }

            return(view);
        }
예제 #3
0
        /// <summary>
        /// Gets the current MAM app config for the application.
        /// </summary>
        /// <returns>The current MAM app config.</returns>
        public string GetCurrentAppConfig()
        {
            IMAMAppConfigManager configManager = MAMComponents.Get <IMAMAppConfigManager>();
            IMAMAppConfig        appConfig     = configManager.GetAppConfig(Authenticator.User);

            if (appConfig != null)
            {
                StringBuilder builder = new StringBuilder();
                IList <IDictionary <string, string> > appConfigData = appConfig.FullData;
                foreach (IDictionary <string, string> dictionary in appConfigData)
                {
                    foreach (KeyValuePair <string, string> kvp in dictionary)
                    {
                        builder.AppendLine(string.Format("Key = {0}, Value = {1}", kvp.Key, kvp.Value));
                    }
                }

                return(Application.Context.GetString(Resource.String.about_nav_config_text, builder.ToString()));
            }

            return(Application.Context.GetString(Resource.String.about_nav_config_text_missing));
        }