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


C# Bundle.GetBundle方法代码示例

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


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

示例1: OnCreate

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

            SetContentView (Resource.Layout.snake_layout);

            Button b1 = (Button)FindViewById (Resource.Id.button1);
            b1.SetX (200);
            b1.SetY (530);
            b1.SetHeight (60);
            b1.SetWidth (60);
            b1.Text = "Arriba";
            b1.Click += delegate {
                snake_view.keypress(Keycode.DpadUp);
            };

            Button b2 = (Button)FindViewById(Resource.Id.button2);
            b2.SetX(200);
            b2.SetY(610);
            b2.SetHeight (60);
            b2.SetWidth (60);
            b2.Text = "Abajo";
            b2.Click += delegate {
                snake_view.keypress(Keycode.DpadDown);
            };
            Button b3 = (Button)FindViewById(Resource.Id.button3);
            b3.SetX(100);
            b3.SetY(610);
            b3.Text = "Izq.";
            b3.SetHeight (60);
            b3.SetWidth (60);
            b3.Click += delegate {
                snake_view.keypress(Keycode.DpadLeft);
            };
            Button b4 = (Button)FindViewById(Resource.Id.button4);
            b4.SetX(300);
            b4.SetY(610);
            b4.Text = "Der.";
            b4.SetHeight (60);
            b4.SetWidth (60);
            b4.Click += delegate {
                snake_view.keypress(Keycode.DpadRight);
            };

            snake_view = (GameView)FindViewById(Resource.Id.snake);
            snake_view.SetTextView((TextView)FindViewById(Resource.Id.text));

            if (savedInstanceState == null) {

                snake_view.SetMode (GameMode.Ready);
            } else {

                Bundle map = savedInstanceState.GetBundle (ICICLE_KEY);

                if (map != null)
                    snake_view.RestoreState (map);
                else
                    snake_view.SetMode (GameMode.Paused);
            }
        }
开发者ID:Hackemate,项目名称:Snake,代码行数:60,代码来源:SnakeActivity.cs

示例2: OnActivityCreated

        /// <summary>
        ///  Tells the fragment that its activity has completed its own Activity.onCreate().
        /// </summary>
        /// <param name="savedInstanceState"></param>
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            if (savedInstanceState != null) { //Load pre-saved wizard context.. Coming in from a orientation change perhaps
                WizardFlow.LoadFlow(savedInstanceState);
                
                StateManager.ContextBundle = savedInstanceState.GetBundle(STATE_WIZARD_CONTEXT);
                StateManager.LoadStepContext(this);
            }
            else {
                StateManager.ContextBundle = new Bundle();    //Initialize wizard context
                //Persist hosting activity/fragment fields to wizard context enabling easy data transfer between wizard host and the steps
                StateManager.PersistStepContext(this);
            }
            
            Wizard = new Wizard(WizardFlow, StateManager, ChildFragmentManager);

            Wizard.StepChanged += OnWizardStepChanged;
            Wizard.WizardComplete += OnWizardComplete;
        }
开发者ID:cryptocoinx,项目名称:WizarDroid.Net,代码行数:25,代码来源:WizardFragment.cs

示例3: OnCreate

		// Called when Activity is first created. Turns off the title bar, sets up
		// the content views, and fires up the SnakeView.
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			SetContentView (Resource.Layout.snake_layout);

			snake_view = FindViewById<SnakeView> (Resource.Id.snake);
			snake_view.SetTextView (FindViewById<TextView> (Resource.Id.text));

			if (savedInstanceState == null) {
				// We were just launched -- set up a new game
				snake_view.SetMode (GameMode.Ready);
			} else {
				// We are being restored
				Bundle map = savedInstanceState.GetBundle (ICICLE_KEY);

				if (map != null)
					snake_view.RestoreState (map);
				else
					snake_view.SetMode (GameMode.Paused);
			}
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:24,代码来源:SnakeActivity.cs

示例4: RestoreViewModelsFromBundle

        private static void RestoreViewModelsFromBundle(IMvxJsonConverter serializer, Bundle savedInstanceState)
        {
            IMvxSavedStateConverter savedStateConverter;
            IMvxMultipleViewModelCache viewModelCache;
            IMvxViewModelLoader viewModelLoader;

            if (!Mvx.TryResolve(out savedStateConverter))
            {
                Mvx.Trace("Could not resolve IMvxSavedStateConverter, won't be able to convert saved state");
                return;
            }

            if (!Mvx.TryResolve(out viewModelCache))
            {
                Mvx.Trace("Could not resolve IMvxMultipleViewModelCache, won't be able to convert saved state");
                return;
            }

            if (!Mvx.TryResolve(out viewModelLoader))
            {
                Mvx.Trace("Could not resolve IMvxViewModelLoader, won't be able to load ViewModel for caching");
                return;
            }

            // Harder ressurection, just in case we were killed to death.
            var json = savedInstanceState.GetString(SavedFragmentTypesKey);
            if (string.IsNullOrEmpty(json)) return;

            var savedState = serializer.DeserializeObject<Dictionary<string, Type>>(json);
            foreach (var item in savedState)
            {
                var bundle = savedInstanceState.GetBundle(item.Key);
                if (bundle.IsEmpty) continue;

                var mvxBundle = savedStateConverter.Read(bundle);
                var request = MvxViewModelRequest.GetDefaultRequest(item.Value);

                // repopulate the ViewModel with the SavedState and cache it.
                var vm = viewModelLoader.LoadViewModel(request, mvxBundle);
                viewModelCache.Cache(vm, item.Key);
            }
        }
开发者ID:Ideine,项目名称:MvvmCross-AndroidSupport,代码行数:42,代码来源:MvxCachingFragmentActivity.cs

示例5: RestoreQuizState

        void RestoreQuizState(Bundle savedInstanceState)
        {
            if (null == savedInstanceState) {
                return;
            }
            EventHandler<View.LayoutChangeEventArgs> handler = null;
            handler += (sender, e) => {
                quizView.LayoutChange -= handler;
                var currentChild = quizView.GetChildAt(0);
                var viewGroup = currentChild as ViewGroup;
                if (viewGroup != null) {
                    var potentialQuizView = viewGroup.GetChildAt(0);
                    var absQuizView = potentialQuizView as AbsQuizView;
                    if (absQuizView != null) {
                        absQuizView.UserInput = savedInstanceState.GetBundle(KeyUserInput);
                    }
                }
            };
            quizView.LayoutChange += handler;
		}
开发者ID:raulma,项目名称:monodroid-samples,代码行数:20,代码来源:QuizFragment.cs

示例6: OnActivityCreated

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

			MRequestFocus = delegate {
				mList.FocusableViewAvailable (mList);
			};

			mHandler = new MyPreferenceFragmentHandler (this);
		
			if (mHavePrefs) {
				BindPreferences ();
			}

			mInitDone = true;

			if (savedInstanceState != null) {
				Bundle container = savedInstanceState.GetBundle (PREFERENCES_TAG);
				if (container != null) {
					PreferenceScreen preferenceScreen = PreferenceScreen;
					if (preferenceScreen != null) {
						preferenceScreen.RestoreHierarchyState (container);
					}
				}
			}
		}
开发者ID:DuckArne,项目名称:CSharp.SupportPreferencefragment,代码行数:26,代码来源:SupportPreferenceFragment.cs


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