本文整理汇总了C#中Passbook.Generator.PassGeneratorRequest.LoadTemplate方法的典型用法代码示例。如果您正苦于以下问题:C# PassGeneratorRequest.LoadTemplate方法的具体用法?C# PassGeneratorRequest.LoadTemplate怎么用?C# PassGeneratorRequest.LoadTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Passbook.Generator.PassGeneratorRequest
的用法示例。
在下文中一共展示了PassGeneratorRequest.LoadTemplate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPass
public override Passbook.Generator.PassGeneratorRequest GetPass(string serialNumber)
{
PassGeneratorRequest request = new PassGeneratorRequest();
request.PassTypeIdentifier = PassTypeIdentifier;
request.SerialNumber = Guid.NewGuid().ToString("D");
TemplateModel parameters = new TemplateModel();
parameters.AddField("origin", FieldAttribute.Label, "San Francisco");
parameters.AddField("origin", FieldAttribute.Value, "SFO");
parameters.AddField("destination", FieldAttribute.Label, "London Heathrow");
parameters.AddField("destination", FieldAttribute.Value, "LHR");
parameters.AddField("seat", FieldAttribute.Value, "7A");
parameters.AddField("boarding-gate", FieldAttribute.Value, "F12");
parameters.AddField("passenger-name", FieldAttribute.Value, "John Appleseed");
request.AddBarCode("M1APPLESEED/JMR EZQ7O92 GVALHRBA 00723319C002F00009100", BarcodeType.PKBarcodeFormatPDF417, "iso-8859-1");
request.LoadTemplate("BoardingPass", parameters);
return request;
}
示例2: GetPass
public override Passbook.Generator.PassGeneratorRequest GetPass(string serialNumber)
{
PassGeneratorRequest request = new PassGeneratorRequest();
request.PassTypeIdentifier = PassTypeIdentifier;
request.SerialNumber = Guid.NewGuid().ToString("D");
TemplateModel parameters = new TemplateModel();
request.AddBarCode("01927847623423234234", BarcodeType.PKBarcodeFormatPDF417, "UTF-8", "01927847623423234234");
request.LoadTemplate("Coupon", parameters);
return request;
}
示例3: GetPass
public override Passbook.Generator.PassGeneratorRequest GetPass(string serialNumber)
{
PassGeneratorRequest request = new PassGeneratorRequest();
request.PassTypeIdentifier = PassTypeIdentifier;
request.SerialNumber = Guid.NewGuid().ToString("D");
TemplateModel parameters = new TemplateModel();
parameters.AddField("event", FieldAttribute.Value, "Jeff Wayne's War of the Worlds");
DateTime eventDate = DateTime.Now.AddDays(1);
parameters.AddField("doors-open", FieldAttribute.Value, new DateTime(eventDate.Year, eventDate.Month, eventDate.Day, 20, 30, 00));
parameters.AddField("seating-section", FieldAttribute.Value, 10);
request.AddBarCode("01927847623423234234", BarcodeType.PKBarcodeFormatPDF417, "iso-8859-1", "01927847623423234234");
request.LoadTemplate("Event", parameters);
return request;
}