當前位置: 首頁>>代碼示例>>C#>>正文


C# PassGeneratorRequest.LoadTemplate方法代碼示例

本文整理匯總了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;
        }
開發者ID:joe-keane,項目名稱:dotnet-passbook,代碼行數:25,代碼來源:BoardingPassProvider.cs

示例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;
        }
開發者ID:joe-keane,項目名稱:dotnet-passbook,代碼行數:15,代碼來源:CouponPassProvider.cs

示例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;
        }
開發者ID:joe-keane,項目名稱:dotnet-passbook,代碼行數:22,代碼來源:EventPassProvider.cs


注:本文中的Passbook.Generator.PassGeneratorRequest.LoadTemplate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。