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


C# ISharedPreferences.GetInt方法代码示例

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


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

示例1: OnCreate

        public override void OnCreate()
        {
            base.OnCreate();

            Instance = this;

            // Load preferences
            Preferences = GetSharedPreferences(SettingsFilename, FileCreationMode.Private);
            // Default offline mode
            D3Context.Instance.FetchMode = (Preferences.GetBoolean(SettingsOnlinemode, false) ? FetchMode.Online : FetchMode.OnlineIfMissing);

            // Checks if some migration operations are needed
            var upToDateVersion = Preferences.GetInt(UpToDateVersion, 1);
            if (upToDateVersion < 20)
            {
                new MigrationTo20().DoMigration();
            }

            // Always start D3Api with cache available
            var dataProvider = new CacheableDataProvider(new HttpRequestDataProvider())
            {
                FetchMode = D3Context.Instance.FetchMode
            };
            D3Api.DataProvider = dataProvider;

            // Set english locale by default
            D3Api.Locale = CultureInfo.CurrentCulture.TwoLetterISOLanguageName;
        }
开发者ID:djtms,项目名称:D3-Android-by-ZTn,代码行数:28,代码来源:D3Calc.cs

示例2: OnActivityCreated

        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            var context = Activity;
            var dm = context.Resources.DisplayMetrics;
            // mResourceProxy = new ResourceProxyImpl(getActivity().getApplicationContext());

            _prefs = context.GetSharedPreferences(OpenStreetMapConstants.PrefsName, FileCreationMode.Private);

            _compassOverlay = new CompassOverlay(context, new InternalCompassOrientationProvider(context),
                _mapView);
            _myLocationOverlay = new MyLocationNewOverlay(context, new GpsMyLocationProvider(context),
                _mapView);

            _minimapOverlay = new MinimapOverlay(Activity, _mapView.TileRequestCompleteHandler)
            {
                Width = dm.WidthPixels/5,
                Height = dm.HeightPixels/5
            };

            _scaleBarOverlay = new ScaleBarOverlay(context);
            _scaleBarOverlay.SetCentred(true);
            _scaleBarOverlay.SetScaleBarOffset(dm.WidthPixels/2, 10);

            _rotationGestureOverlay = new RotationGestureOverlay(context, _mapView) {Enabled = false};

            _mapView.SetBuiltInZoomControls(true);
            _mapView.SetMultiTouchControls(true);
            _mapView.Overlays.Add(_myLocationOverlay);
            _mapView.Overlays.Add(_compassOverlay);
            _mapView.Overlays.Add(_minimapOverlay);
            _mapView.Overlays.Add(_scaleBarOverlay);
            _mapView.Overlays.Add(_rotationGestureOverlay);

            _mapView.Controller.SetZoom(_prefs.GetInt(OpenStreetMapConstants.PrefsZoomLevel, 1));
            _mapView.ScrollTo(_prefs.GetInt(OpenStreetMapConstants.PrefsScrollX, 0),
                _prefs.GetInt(OpenStreetMapConstants.PrefsScrollY, 0));

            _myLocationOverlay.EnableMyLocation();
            _compassOverlay.EnableCompass();

            HasOptionsMenu = true;
        }
开发者ID:JohnPilczak,项目名称:OsmdroidXamarin,代码行数:44,代码来源:MapFragment.cs

示例3: Create

 public static AppPreferences Create(ISharedPreferences prefs)
 {
     return new AndroidAppPreferences(prefs)
     {
         FirtsTimeRunning = prefs.GetBoolean(AppPreferences.FirstTimeKey, true),
         Ip = prefs.GetString(AppPreferences.IpKey, ""),
         Port = prefs.GetInt(AppPreferences.PortKey, 0),
         UseSounds = prefs.GetBoolean(AppPreferences.UseSoundsKey, true),
         UseCache = prefs.GetBoolean(AppPreferences.UseCacheKey, true)
     };
 }
开发者ID:samiy-xx,项目名称:KeySndr.Clients,代码行数:11,代码来源:AndroidAppPreferences.cs

示例4: OnSharedPreferenceChanged

        public void OnSharedPreferenceChanged(ISharedPreferences sharedPreferences, string key)
        {
            switch (key)
            {
                case PreferenceKeys.Timeout:
                    Runner.Instance.Options.Timeout = sharedPreferences.GetInt(key, Runner.Instance.Options.Timeout);
                    break;
                case PreferenceKeys.SaveNamespaces:
                    if (!sharedPreferences.GetBoolean(key, false))
                        resetSavedNamespaces();

                    break;
                case PreferenceKeys.MultiLineEditing:
                    CSharpToGoApplication.Options.MultiLineEditing = sharedPreferences.GetBoolean(key, CSharpToGoApplication.Options.MultiLineEditing);

                    break;
                case PreferenceKeys.DoubleEnter:
                    CSharpToGoApplication.Options.DoubleEnterToExecute = sharedPreferences.GetBoolean(key, CSharpToGoApplication.Options.DoubleEnterToExecute);

                    break;
            }
        }
开发者ID:jorik041,项目名称:CSharpToGo,代码行数:22,代码来源:SharedPreferenceChangeListener.cs

示例5: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            userID = Intent.GetStringExtra ("id") ?? "-1";
            mainPrefs = GetSharedPreferences("loginPrefs",FileCreationMode.Private);
            mainEditor = mainPrefs.Edit ();
            serviceNumer = mainPrefs.GetInt ("service_size", -1);
            SetContentView (Resource.Layout.Main);

            tabHost = FindViewById<TabHost> (Android.Resource.Id.TabHost);
            tabHost.Setup ();

            for (int i = 1; i <= 2; i++) {

                TabHost.TabSpec tabSpec;
                tabSpec = tabHost.NewTabSpec("Tab " + i);
                tabSpec.SetIndicator("Tab " + i);
                tabSpec.SetContent(new FakeContent(this));
                tabHost.AddTab(tabSpec);
            }
            tabHost.SetOnTabChangedListener(this);
            viewPager = FindViewById<ViewPager> (Resource.Id.view);
            var adaptor = new ServiceBeaconAdapter (SupportFragmentManager);
            adaptor.addFragmentView ((i, v, b) => {
                var view = i.Inflate (Resource.Layout.Page, v, false);
                var myText = view.FindViewById<TextView> (Resource.Id.textView1);
                myText.Text = myText.Text + "1";
                return view;
            });
            adaptor.addFragmentView((i,v,b) =>
            {
                var view = i.Inflate(Resource.Layout.Page,v,false);
                var myText = view.FindViewById<TextView> (Resource.Id.textView1);
                myText.Text = myText.Text + "2";
                return view;
                });
            viewPager.Adapter = adaptor;//new ServiceBeaconAdapter (SupportFragmentManager);
            viewPager.SetOnPageChangeListener(this);

            beaconStatusLabel = FindViewById<TextView> (Resource.Id.beaconStatusLabel);

            beaconMgr.Bind (this);

            //myProcessedBeacons = new JavaDictionary<string,string>();
            monitorNotifier.EnterRegionComplete += EnteredRegion;
            monitorNotifier.ExitRegionComplete += ExitedRegion;

            rangeNotifier.DidRangeBeaconsInRegionComplete += HandleBeaconsInRegion;
        }
开发者ID:slitaiem,项目名称:great-subversion,代码行数:50,代码来源:MainActivity.cs


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