当前位置: 首页>>代码示例>>C#>>正文


C# Activity.GetSharedPreferences方法代码示例

本文整理汇总了C#中Android.App.Activity.GetSharedPreferences方法的典型用法代码示例。如果您正苦于以下问题:C# Activity.GetSharedPreferences方法的具体用法?C# Activity.GetSharedPreferences怎么用?C# Activity.GetSharedPreferences使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android.App.Activity的用法示例。


在下文中一共展示了Activity.GetSharedPreferences方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Options

		// Options are not as useful as under iOS since re-installing the
		// application deletes the file containing them.
		internal Options (Activity activity)
		{
			ISharedPreferences prefs = activity.GetSharedPreferences ("options", FileCreationMode.Private);
			EnableNetwork = prefs.GetBoolean ("remote", false);
			HostName = prefs.GetString ("hostName", "0.0.0.0");
			HostPort = prefs.GetInt ("hostPort", -1);
		}
开发者ID:TimeIncOSS,项目名称:Andr.Unit,代码行数:9,代码来源:Options.cs

示例2: Save

		public void Save (Activity activity)
		{
			ISharedPreferences prefs = activity.GetSharedPreferences ("options", FileCreationMode.Private);
			var edit = prefs.Edit ();
			edit.PutBoolean ("remote", EnableNetwork);
			edit.PutString ("hostName", HostName);
			edit.PutInt ("hostPort", HostPort);
			edit.Commit ();
		}
开发者ID:TimeIncOSS,项目名称:Andr.Unit,代码行数:9,代码来源:Options.cs

示例3: Save

 public void Save(Activity activity)
 {
     var prefs = activity.GetSharedPreferences("options", FileCreationMode.Private);
     var edit = prefs.Edit();
     edit.PutBoolean("remote", EnableNetwork);
     edit.PutString("hostName", HostName);
     edit.PutInt("hostPort", HostPort);
     edit.PutInt("nameDisplay", (int)NameDisplay);
     edit.PutBoolean("parallel", ParallelizeAssemblies);
     edit.Commit();
 }
开发者ID:jp-coughlin,项目名称:xamarin.xunit,代码行数:11,代码来源:RunnerOptions.cs

示例4: RunnerOptions

        // Options are not as useful as under iOS since re-installing the
        // application deletes the file containing them.
        internal RunnerOptions(Activity activity)
        {
            var prefs = activity.GetSharedPreferences("options", FileCreationMode.Private);
            EnableNetwork = prefs.GetBoolean("remote", false);
            HostName = prefs.GetString("hostName", "0.0.0.0");
            HostPort = prefs.GetInt("hostPort", -1);
            NameDisplay = (NameDisplay)prefs.GetInt("nameDisplay", 1);
            ParallelizeAssemblies = prefs.GetBoolean("parallel", false);

            current = this;
        }
开发者ID:jp-coughlin,项目名称:xamarin.xunit,代码行数:13,代码来源:RunnerOptions.cs

示例5: SavePreferences

 private static void SavePreferences(string api_key, Activity context)
 {
     var prefs = context.GetSharedPreferences("Challonger.preferences", FileCreationMode.Private);
     var editor = prefs.Edit();
     editor.PutString("api_key", api_key).Commit();
    
 }
开发者ID:coldlink,项目名称:challonger,代码行数:7,代码来源:MainActivityTab.cs


注:本文中的Android.App.Activity.GetSharedPreferences方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。