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


C# NSCoder.Encode方法代码示例

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


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

示例1: EncodeTo

 public void EncodeTo(NSCoder coder)
 {
     coder.Encode(StartPoint.X, "startPointX");
     coder.Encode(StartPoint.Y, "startPointY");
     coder.Encode(Endpoint.X, "endPointX");
     coder.Encode(Endpoint.Y, "endPointY");
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:7,代码来源:Oval.cs

示例2: EncodeTo

 public override void EncodeTo(NSCoder coder)
 {
     if (this.Title != null)
         coder.Encode(new NSString(this.Title), "Title");
     if (this.Subtitle != null)
         coder.Encode(new NSString(this.Subtitle), "Subtitle");
     coder.Encode(this.Coordinate.Latitude, "Latitude");
     coder.Encode(this.Coordinate.Longitude, "Longitude");
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:9,代码来源:BNRMapPoint.cs

示例3: EncodeState

 /// <summary>
 ///     Occurs on save element state.
 /// </summary>
 public void EncodeState(NSObject item, NSCoder state, IDataContext context = null)
 {
     Should.NotBeNull(item, "item");
     Should.NotBeNull(state, "state");
     var controller = item as UIViewController;
     if (controller != null && string.IsNullOrEmpty(controller.RestorationIdentifier))
         return;
     var view = item as UIView;
     if (view != null && string.IsNullOrEmpty(view.RestorationIdentifier))
         return;
     object navigationParameter = (item as UIViewController).GetNavigationParameter();
     if (navigationParameter != null)
     {
         using (Stream stream = _serializer.Serialize(navigationParameter))
             state.Encode(stream.ToArray(), ParameterStateKey);
     }
     var viewModel = item.GetDataContext() as IViewModel;
     if (viewModel != null)
     {
         state.Encode(new NSString(viewModel.GetType().AssemblyQualifiedName), VmTypeKey);
         PreserveViewModel(viewModel, item, state, context ?? DataContext.Empty);
     }
 }
开发者ID:windygu,项目名称:MugenMvvmToolkit,代码行数:26,代码来源:ApplicationStateManager.cs

示例4: EncodeTo

        public void EncodeTo(NSCoder coder)
        {
            if (this.MakeModel != null)
                coder.Encode(new NSString(this.MakeModel), "makeModel");

            if (this.DatePurchased != null)
                coder.Encode(this.DatePurchased, "datePurchased");

            coder.Encode(this.Condition, "condition");

            coder.Encode(this.OnSpecial, "onSpecial");

            coder.Encode(this.Price, "price");

            if (this.Photo != null)
                coder.Encode(this.Photo, "photo");
        }
开发者ID:yingfangdu,项目名称:BNR,代码行数:17,代码来源:Car.cs

示例5: EncodeTo

 public void EncodeTo(NSCoder coder)
 {
     if (this.Name != null)
         coder.Encode(new NSString(this.Name), "name");
     coder.Encode(this.ExpectedRaise, "expectedRaise");
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:6,代码来源:Person.cs

示例6: EncodeRestorableState

		public override void EncodeRestorableState (NSCoder coder)
		{
			base.EncodeRestorableState (coder);
			coder.Encode (Filter, ImageFilterKey);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:5,代码来源:FilterViewController.cs

示例7: EncodeTo

		public void EncodeTo (NSCoder encoder)
		{
			// Encode data
			encoder.Encode(new NSString(Name),"name");
			encoder.Encode(new NSString(ImageType),"imageType");
		}
开发者ID:RangoLee,项目名称:mac-samples,代码行数:6,代码来源:ImageInfo.cs

示例8: EncodeTo

		public void EncodeTo (NSCoder coder)
		{
			NSArray array = NSArray.FromNSObjects (items.ToArray());
			coder.Encode (array, ListEncodingItemsKey);
			coder.Encode((int)Color, ListEncodingColorKey);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:6,代码来源:List.cs

示例9: EncodeRestorableState

		public override void EncodeRestorableState (NSCoder coder)
		{
			base.EncodeRestorableState (coder);
			coder.Encode (Intensity, IntensityKey);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:5,代码来源:ModifyFilter.cs

示例10: EncodeRestorableState

		public override void EncodeRestorableState (NSCoder coder)
		{
			base.EncodeRestorableState (coder);
			// TODO: https://trello.com/c/TydBAJP0
			coder.Encode ((NSString)ImageIdentifier, kImageIdentifierKey);
			coder.Encode (DataSource, kDataSourceKey);
			coder.Encode (filters.Convert (), kImageFiltersKey);

			if (!string.IsNullOrEmpty (currentlyPresentedFilterTitle))
				coder.Encode ((NSString)currentlyPresentedFilterTitle, kFilterButtonKey);

			coder.Encode (activityViewController, kActivityViewControllerKey);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:13,代码来源:DetailViewController.cs

示例11: EncodeRestorableState

		public override void EncodeRestorableState (NSCoder coder)
		{
			base.EncodeRestorableState (coder);
			coder.Encode (BlurRadius, BlurRadiusKey);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:5,代码来源:BlurFilter.cs

示例12: WillEncodeRestorableState

 public override void WillEncodeRestorableState(UIApplication application, NSCoder coder)
 {
     if (_window.RootViewController != null)
         coder.Encode(_window.RootViewController, RootViewControllerKey);
 }
开发者ID:Fezzer,项目名称:MugenMvvmToolkit.Samples,代码行数:5,代码来源:AppDelegate.cs

示例13: EncodeRestorableState

		public override void EncodeRestorableState (NSCoder coder)
		{
			coder.Encode (Active, ActiveKey);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:4,代码来源:ImageFilter.cs

示例14: EncodeRestorableState

 public override void EncodeRestorableState(NSCoder coder)
 {
     base.EncodeRestorableState (coder);
     if (detailViewController != null)
         coder.Encode (detailViewController, DetailViewControllerKey);
 }
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:6,代码来源:CollectionViewController.cs

示例15: EncodeTo

		public void EncodeTo (NSCoder coder)
		{
			coder.Encode ((NSString)Text, ListItemEncodingTextKey);
			coder.Encode (new NSUuid(UID.ToByteArray ()), ListItemEncodingUUIDKey);
			coder.Encode (IsComplete, ListItemEncodingCompletedKey);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:6,代码来源:ListItem.cs


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