コード例 #1
0
        public static void Run(string url, Guid cashboxId, HttpCommunicationType communicationType, string accessToken, string receiptExampleDirectory)
        {
            _cashBoxId = cashboxId;
            var retryOptions = new RetryPolicyOptions {
                ClientTimeout = TimeSpan.FromSeconds(90), DelayBetweenRetries = TimeSpan.FromSeconds(5), Retries = 3
            };

            _pos = HttpPosFactory.CreatePosAsync(new HttpPosClientOptions
            {
                Url = new Uri(url),
                CommunicationType        = communicationType,
                CashboxId                = cashboxId,
                AccessToken              = accessToken,
                RetryPolicyOptions       = retryOptions,
                UseUnversionedLegacyUrls = true
            }).Result;
            _examples = LoadExamples(receiptExampleDirectory, cashboxId);

            ExecuteEcho("Test");

            while (true)
            {
                Menu();
            }
        }
コード例 #2
0
        public static async Task RunAsync(string url, Guid cashboxId, HttpCommunicationType communicationType, string accessToken, string receiptExampleDirectory)
        {
            _cashBoxId = cashboxId;
            var retryOptions = new RetryPolicyOptions {
                ClientTimeout = TimeSpan.FromSeconds(90), DelayBetweenRetries = TimeSpan.FromSeconds(5), Retries = 3
            };

            _pos = await HttpPosFactory.CreatePosAsync(new HttpPosClientOptions
            {
                Url = new Uri(url),
                CommunicationType  = communicationType,
                CashboxId          = cashboxId,
                AccessToken        = accessToken,
                RetryPolicyOptions = retryOptions
            });

            _examples = LoadExamples(receiptExampleDirectory, cashboxId);

            await ExecuteEchoAsync("Test");

            while (true)
            {
                await MenuAsync();
            }
        }
コード例 #3
0
 private async Task <IPOS> GetPOSAsync()
 {
     if (FindViewById <RadioButton>(Resource.Id.radioGrpc).Checked)
     {
         return(await GrpcPosFactory.CreatePosAsync(new GrpcClientOptions
         {
             Url = new Uri(QUEUE_URL_GRPC)
         }));
     }
     else
     {
         return(await HttpPosFactory.CreatePosAsync(new HttpPosClientOptions
         {
             Url = new Uri(QUEUE_URL_REST)
         }));
     }
 }
コード例 #4
0
 protected override ifPOS.v1.IPOS CreateClient() => HttpPosFactory.CreatePosAsync(new HttpPosClientOptions {
     Url = new Uri(_url)
 }).Result;
コード例 #5
0
 protected override ifPOS.v0.IPOS CreateClient() => HttpPosFactory.CreatePosAsync(new HttpPosClientOptions {
     Url = new Uri(_url), UseUnversionedLegacyUrls = true, CommunicationType = HttpCommunicationType.Json
 }).Result;