public Information(string titleKey, string displayTextKey) { IMvxTextProvider imvxTextProvider = (IMvxTextProvider)Mvx.get_IoCProvider().Resolve <IMvxTextProvider>(); this.Title = (object)imvxTextProvider.GetText((string)null, (string)null, titleKey); this.DisplayText = imvxTextProvider.GetText((string)null, (string)null, displayTextKey); }
public static void CheckProtectedAppsFeature(Context context) { IMvxTextProvider textProvider = (IMvxTextProvider)Mvx.get_IoCProvider().Resolve <IMvxTextProvider>(); string text1 = textProvider.GetText((string)null, (string)null, "ProtectedAppsCheckerTitle"); string text2 = textProvider.GetText((string)null, (string)null, "ProtectedAppsCheckerContent"); string text3 = textProvider.GetText((string)null, (string)null, "ProtectedAppsCheckerAccept"); string text4 = textProvider.GetText((string)null, (string)null, "ProtectedAppsCheckerCancel"); ISharedPreferences sharedPreferences = context.GetSharedPreferences("ProtectedApps", (FileCreationMode)0); if (sharedPreferences.GetBoolean("skipAppListMessage", false)) { return; } bool flag = false; ISharedPreferencesEditor editor = sharedPreferences.Edit(); using (List <Intent> .Enumerator enumerator = ProtectedAppsChecker.PowermanagerIntents.GetEnumerator()) { while (enumerator.MoveNext()) { Intent intent = enumerator.Current; if (context.get_PackageManager().ResolveActivity(intent, (PackageInfoFlags)65536) != null) { new AlertDialog.Builder(context).SetTitle(text1).SetMessage(text2).SetPositiveButton(text3, (EventHandler <DialogClickEventArgs>)((o, d) => { editor.PutBoolean("skipAppListMessage", true); editor.Apply(); try { context.StartActivity(intent); } catch (Exception ex) { ErrorHandler.Current.HandleError(ex); new AlertDialog.Builder(context).SetTitle(textProvider.GetText((string)null, (string)null, "ProtectedAppsErrorTitle")).SetMessage(textProvider.GetText((string)null, (string)null, "ProtectedAppsErrorContent")).SetCancelable(false).SetPositiveButton(textProvider.GetText((string)null, (string)null, "ProtectedAppsAcceptButtonText"), (EventHandler <DialogClickEventArgs>)((_param1, _param2) => {})).Show(); } })).SetNegativeButton(text4, (EventHandler <DialogClickEventArgs>)((o, d) => {})).SetCancelable(false).Show(); flag = true; break; } } } if (flag) { return; } editor.PutBoolean("skipAppListMessage", true); editor.Apply(); }
public static string ToShortSpeedText(this DistanceUnit self) { IMvxTextProvider textProvider = Mvx.Resolve <IMvxTextProvider>(); string textId = string.Empty; switch (self) { case DistanceUnit.Kilometer: textId = "KilometersShortSpeed"; break; case DistanceUnit.Meters: textId = "MetersShortSpeed"; break; case DistanceUnit.Miles: textId = "MilesShortSpeed"; break; } return(textProvider.GetText(Constants.GeneralNamespace, Constants.DefaultTextTypeKey, textId)); }
public static string GetText(this IMvxTextProvider textProvider, string key, params object[] format) { return(textProvider.GetText(null, null, key, format)); }