本文整理汇总了C#中Parcel类的典型用法代码示例。如果您正苦于以下问题:C# Parcel类的具体用法?C# Parcel怎么用?C# Parcel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Parcel类属于命名空间,在下文中一共展示了Parcel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Player
protected Player (Parcel inObj)
{
FirstName = inObj.ReadString ();
LastInitial = inObj.ReadString ();
// TODO: something strange
Avatar = (Avatar)Enum.GetValues (typeof(Avatar)).GetValue (inObj.ReadInt ());
}
示例2: WriteToParcel
/// <summary>
/// IParcelable member
/// </summary>
/// <param name="dest"></param>
/// <param name="flags"></param>
public void WriteToParcel(Parcel dest, [GeneratedEnum] ParcelableWriteFlags flags)
{
dest.WriteString(this.DateOfIssue.ToString());
dest.WriteString(this.Id.ToString());
dest.WriteString(this.AdditionalInfo);
dest.WriteString(this.PhoneNumber);
}
示例3: Receipt
public Receipt(Parcel parcelable)
{
Type receipType = JsonConvert.DeserializeObject<Type>(parcelable.ReadString());
var receiptString = parcelable.ReadString();
receipt = JsonConvert.DeserializeObject(receiptString, receipType) as ITransactionResult;
}
示例4: ToParcel
public byte[] ToParcel()
{
var p = new Parcel();
p.AddLengthString16(PackageName);
p.AddLengthString16(ProcessName);
p.AddLengthString16(TaskAffinity);
p.AddLengthInt32(uid);
p.AddLengthInt32(flags);
p.AddLengthString16(SourceDir);
p.AddLengthString16(PublicSourceDir);
p.AddLengthString16(DataDir);
p.AddLengthInt32(Enabled ? 1 : 0);
p.AddLengthInt32(TargetSdkVersion);
p.AddLengthString16(Intent);
p.AllocateBuffer();
p.WriteString16(PackageName);
p.WriteString16(ProcessName);
p.WriteString16(TaskAffinity);
p.WriteInt32(uid);
p.WriteInt32(flags);
p.WriteString16(SourceDir);
p.WriteString16(PublicSourceDir);
p.WriteString16(DataDir);
p.WriteInt32(Enabled ? 1 : 0);
p.WriteInt32(TargetSdkVersion);
p.WriteString16(Intent);
return p.Buffer;
}
示例5: WriteToParcel
public void WriteToParcel (Parcel dest, ParcelableWriteFlags flags)
{
dest.WriteInt(this.Id_libro);
dest.WriteString(this.Nombre);
dest.WriteString(this.Autor);
dest.WriteInt(this.Total_pag);
dest.WriteString(this.Descripcion);
}
示例6: CardToken
public CardToken(Parcel parcel)
{
CardLastFour = parcel.ReadString();
ExpiryDate = parcel.ReadString();
Token = parcel.ReadString();
CardType = (CardBase.CardType)parcel.ReadInt();
ConsumerToken = parcel.ReadString();
}
示例7: ResetCycle
public void ResetCycle(Parcel thisParcel, Plant plant){
ResetParcel(thisParcel);
GameObject newPlant = Instantiate(GameModel.Instance.plantPrefab) as GameObject;
thisParcel.mesh = GameModel.Instance.seedling;
newPlant.transform.SetParent(thisParcel.transform, false);
newPlant.GetComponent<PlantPrefab>().plant = plant;
}
示例8: MetaData
public MetaData(Parcel inParcel)
{
//There is a string in the parcel
if (inParcel.ReadInt() > 0)
{
Metadata = JsonConvert.DeserializeObject<Dictionary<string, string>>(inParcel.ReadString());
}
}
示例9: cls_Libro
Java.Lang.Object IParcelableCreator.CreateFromParcel(Parcel source)
{
int id = source.ReadInt ();
string nombre = source.ReadString();
string autor = source.ReadString();
int total_pag = source.ReadInt ();
string descripcion = source.ReadString();
return new cls_Libro(id,nombre,autor,total_pag,descripcion);
}
示例10: WriteToParcel
public void WriteToParcel (Parcel dest, ParcelableWriteFlags flags)
{
dest.WriteDouble (_User.Height);
dest.WriteDouble (_User.Weight);
dest.WriteDouble (_User.CigPerDay);
dest.WriteDouble (_User.HrsSleep);
dest.WriteString (_User.Sex.ToString ());
dest.WriteString (_User.BirthDate.ToString ());
}
示例11: Handle
public override string Handle(Parcel parcel)
{
if (parcel.IsInsured)
{
return "DELUXE: " +
"Take special care of package at a whooping price.";
}
return NextHandler.Handle(parcel);
}
示例12: Handle
public override string Handle(Parcel parcel)
{
if (parcel.Value >= 50m && !parcel.IsInsured)
{
return "NORMAL: " +
"Deliver package at a reasonable price";
}
return NextHandler.Handle(parcel);
}
示例13: Handle
public override string Handle(Parcel parcel)
{
if (parcel.Value < 50m && !parcel.IsInsured)
{
return "BUDGET: " +
"Assault package at a discount price";
}
return NextHandler.Handle(parcel);
}
示例14: Category
protected Category (Parcel inObj)
{
Name = inObj.ReadString ();
Id = inObj.ReadString ();
//TODO
// Theme = (Theme)System.Enum.GetValues ()inObj.ReadInt ();
Quizzes = new List<Quiz> ();
inObj.ReadTypedList (Quizzes, Quiz.InitializeCreator ());
Scores = inObj.CreateIntArray ();
Solved = ParcelableHelper.ReadBoolean (inObj);
}
示例15: SendsTheBoxedOrderByMail
public void SendsTheBoxedOrderByMail()
{
var order = new Order { Address = "bbv Software Serivces AG; Luzern" };
order.Positions.Add(new Position { Item = "Visual Studio", Amount = 3 });
order.Positions.Add(new Position { Item = "ReSharper", Amount = 2 });
var parcel = new Parcel();
A.CallTo(() => this.boxingService.Box(order)).Returns(parcel);
this.testee.Deliver(order);
A.CallTo(() => this.mailService.Deliver(order.Address, parcel)).MustHaveHappened();
}