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


C# Bundle.PutSerializable方法代码示例

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


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

示例1: newInstance

		/**
     * Return an instance of DateFragment with its bundle filled with the
     * constructor arguments. The values in the bundle are retrieved in
     * {@link #onCreateView()} below to properly initialize the DatePicker.
     *
     * @param theme
     * @param year
     * @param month
     * @param day
     * @param minDate
     * @param maxDate
     * @return an instance of DateFragment
     */
		public static DateFragment newInstance(int Theme, int Year, int Month,int Day, Date MinDate, Date MaxDate)
		{
			DateFragment dateFragment = new DateFragment();

			Bundle b = new Bundle();
			b.PutInt("theme", Theme);
			b.PutInt("year", Year);
			b.PutInt("month", Month);
			b.PutInt("day", Day);
			b.PutSerializable("minDate", MinDate);
			b.PutSerializable("maxDate", MaxDate);
			dateFragment.Arguments=b;

			return dateFragment;
		}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:28,代码来源:DateFragment.cs

示例2: NewInstance

		/**
     * <p>Return a new instance of {@code SlideDateTimeDialogFragment} with its bundle
     * filled with the incoming arguments.</p>
     *
     * <p>Called by {@link SlideDateTimePicker#show()}.</p>
     *
     * @param listener
     * @param initialDate
     * @param minDate
     * @param maxDate
     * @param isClientSpecified24HourTime
     * @param is24HourTime
     * @param theme
     * @param indicatorColor
     * @return
     */
		public static SlideDateTimeDialogFragment NewInstance(SlideDateTimeListener Listener,Date InitialDate, Date MinDate, Date MaxDate, bool IsClientSpecified24HourTime,bool Is24HourTime, int Theme, int IndicatorColor)
		{
			_listener = Listener;

			// Create a new instance of SlideDateTimeDialogFragment
			SlideDateTimeDialogFragment dialogFragment = new SlideDateTimeDialogFragment();

			// Store the arguments and attach the bundle to the fragment
			Bundle bundle = new Bundle();
			bundle.PutSerializable("initialDate", InitialDate);
			bundle.PutSerializable("minDate", MinDate);
			bundle.PutSerializable("maxDate", MaxDate);
			bundle.PutBoolean("isClientSpecified24HourTime", IsClientSpecified24HourTime);
			bundle.PutBoolean("is24HourTime", Is24HourTime);
			bundle.PutInt("theme", Theme);
			bundle.PutInt("indicatorColor", IndicatorColor);
			dialogFragment.Arguments=bundle;

			// Return the fragment with its bundle
			return dialogFragment;
		}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:37,代码来源:SlideDateTimeDialogFragment.cs

示例3: MyButton_OnClick

        public void MyButton_OnClick(View view)
        {
            ((Button)view).Text = "clicked!";

            Bundle b = new Bundle ();
            var p = Parcel.Obtain ();
            b.PutSerializable ("dummy", new MySerializable ());
            b.PutParcelable ("dummy2", new MyParcelable ());
            p.WriteBundle (b);
            p.SetDataPosition (0);
            var b2 = p.ReadBundle ();
            Console.WriteLine (b2);
            var p2 = b.GetParcelable ("dummy2");
            Console.WriteLine (p2);
        }
开发者ID:JesseChang,项目名称:monodroid-samples,代码行数:15,代码来源:MainActivity.cs

示例4: MyButton_OnClick

        public void MyButton_OnClick(View view)
        {
            ((Button)view).Text = "clicked!";

            Console.WriteLine ("Activity1.MyButton_OnClick: Writing into Bundle...");

            Bundle b = new Bundle ();
            var p = Parcel.Obtain ();
            b.PutSerializable ("dummy", new MySerializable ("foo"));
            b.PutParcelable ("dummy2", new MyParcelable ("bar"));
            p.WriteBundle (b);
            p.SetDataPosition (0);

            Console.WriteLine ("Activity1.MyButton_OnClick: Reading from Parcel...");
            var b2 = p.ReadBundle ();
            Console.WriteLine ("Read Bundle: {0}", b2);
            var s  = b.GetSerializable ("dummy");
            Console.WriteLine ("Read Serializable: {0}", s);
            var p2 = b.GetParcelable ("dummy2");
            Console.WriteLine ("Read Parcelable: {0}", p2);
        }
开发者ID:vkheleli,项目名称:monodroid-samples-master,代码行数:21,代码来源:MainActivity.cs

示例5: OnSaveInstanceState

 protected override void OnSaveInstanceState (Bundle outState)
 {
     localManger.SaveInstanceState ();
     outState.PutSerializable ("mapData", MapData);
     outState.PutInt (Constants.CurrentTab, (int)tabHost.CurrentTab);
     base.OnSaveInstanceState (outState);
 }
开发者ID:harouny,项目名称:prebuilt-apps,代码行数:7,代码来源:AssignmentTabActivity.cs

示例6: OnSaveInstanceState

		protected override void OnSaveInstanceState (Bundle outState)
		{
			outState.PutSerializable (Constants.DetectedActivities, new SerializableDetectedActivities (mDetectedActivities));
			base.OnSaveInstanceState (outState);
		}
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:5,代码来源:MainActivity.cs

示例7: InitOverlay

        private void InitOverlay()
        {
            //位置
            LatLng hotelLatLng = new LatLng(_hotelEntity.Latitude, _hotelEntity.Longitude);
            OverlayOptions hotelOverlayOptions = new MarkerOptions()
                .InvokeIcon(_hotelBitmap)
                .InvokePosition(hotelLatLng)
                .InvokeZIndex(9);
            Marker hotelMarker = _mBaiduMap.AddOverlay(hotelOverlayOptions).JavaCast<Marker>();
            Bundle bundle = new Bundle();
            bundle.PutSerializable("info", _hotelEntity);
            hotelMarker.ExtraInfo = bundle;

            #region 当前位置




            LatLng locationLatLng = new LatLng(CurrentData.Latitude, CurrentData.Longitude);
            OverlayOptions locationOverlayOptions = new MarkerOptions()
                .InvokeIcon(_localtionBitmap)
                .InvokePosition(locationLatLng)
                .InvokeZIndex(9);
            Marker locationMarker = _mBaiduMap.AddOverlay(locationOverlayOptions).JavaCast<Marker>(); ;

            //设置居中
            MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory.NewLatLng(locationLatLng);
            //改变地图状态
            _mBaiduMap.SetMapStatus(mMapStatusUpdate);

            #endregion 当前位置


        }
开发者ID:MicahelWang,项目名称:XamarinSamples,代码行数:34,代码来源:DetailsActivity.cs

示例8: OnSaveInstanceState

 protected override void OnSaveInstanceState(Bundle outState)
 {
     base.OnSaveInstanceState(outState);
     this.SaveState();
     outState.PutSerializable(NotesDbAdapter.KeyRowId, this.rowId);
 }
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:6,代码来源:NoteEdit.cs


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