本文整理汇总了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");
}
示例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");
}
示例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);
}
}
示例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");
}
示例5: EncodeTo
public void EncodeTo(NSCoder coder)
{
if (this.Name != null)
coder.Encode(new NSString(this.Name), "name");
coder.Encode(this.ExpectedRaise, "expectedRaise");
}
示例6: EncodeRestorableState
public override void EncodeRestorableState (NSCoder coder)
{
base.EncodeRestorableState (coder);
coder.Encode (Filter, ImageFilterKey);
}
示例7: EncodeTo
public void EncodeTo (NSCoder encoder)
{
// Encode data
encoder.Encode(new NSString(Name),"name");
encoder.Encode(new NSString(ImageType),"imageType");
}
示例8: EncodeTo
public void EncodeTo (NSCoder coder)
{
NSArray array = NSArray.FromNSObjects (items.ToArray());
coder.Encode (array, ListEncodingItemsKey);
coder.Encode((int)Color, ListEncodingColorKey);
}
示例9: EncodeRestorableState
public override void EncodeRestorableState (NSCoder coder)
{
base.EncodeRestorableState (coder);
coder.Encode (Intensity, IntensityKey);
}
示例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);
}
示例11: EncodeRestorableState
public override void EncodeRestorableState (NSCoder coder)
{
base.EncodeRestorableState (coder);
coder.Encode (BlurRadius, BlurRadiusKey);
}
示例12: WillEncodeRestorableState
public override void WillEncodeRestorableState(UIApplication application, NSCoder coder)
{
if (_window.RootViewController != null)
coder.Encode(_window.RootViewController, RootViewControllerKey);
}
示例13: EncodeRestorableState
public override void EncodeRestorableState (NSCoder coder)
{
coder.Encode (Active, ActiveKey);
}
示例14: EncodeRestorableState
public override void EncodeRestorableState(NSCoder coder)
{
base.EncodeRestorableState (coder);
if (detailViewController != null)
coder.Encode (detailViewController, DetailViewControllerKey);
}
示例15: EncodeTo
public void EncodeTo (NSCoder coder)
{
coder.Encode ((NSString)Text, ListItemEncodingTextKey);
coder.Encode (new NSUuid(UID.ToByteArray ()), ListItemEncodingUUIDKey);
coder.Encode (IsComplete, ListItemEncodingCompletedKey);
}