Exemple #1
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);
        }
Exemple #2
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));
        }