Ejemplo n.º 1
0
 /// <summary>
 /// Initialises and shows the WebPos browser window, setting its position and size, and loading the web application.
 /// </summary>
 /// <param name="left">The required position of the left-hand side of the browser window, in pixels.</param>
 /// <param name="top">The required position of the top of the browser window, in pixels.</param>
 /// <param name="width">The required width of the browser window, in pixels.</param>
 /// <param name="height">The required height of the browser window, in pixels.</param>
 /// <param name="url">The address to load the CloudPOS web application.</param>
 public void InitPosWindow(int left, int top, int width, int height, string url)
 {
     _ui.SetPosition(left, top);
     _ui.SetClientSize(width, height);
     _ui.Navigate(url);
     _ui.Show();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// InitPosWindow must be called first to initiate a CloudPOS session running
 /// in the browser.
 /// </summary>
 /// <remarks>
 /// <para>
 /// <b>InitPosWindow</b> takes a populated Configuration object to define which
 /// URL to connect to, how to identify the device, where to put the browser
 /// window, etc.
 /// </para>
 /// <para>
 /// You might think that this could have been incorporated into the API
 /// Constructor; however the client (POS) needs to hook into the Ready event
 /// of the newly created CloudPos object, before calling this method.
 /// </para>
 /// </remarks>
 /// <param name="config">A <c>Configuration</c> object, containing position and size of the browser window.</param>
 public void InitPosWindow(Configuration config)
 {
     try
     {
         _config = config;
         string url = config.Url;
         if (_config.Secret == null || _config.Secret.ToLower() != "ignore")
         {
             RefreshPosToken();
             url = config.GetBrowserUrl(_posToken.AccessToken);
         }
         _ui.SetPosition(config.ClientRect.Left, config.ClientRect.Top);
         _ui.SetClientSize(config.ClientRect.Width, config.ClientRect.Height);
         _ui.Navigate(url);
     }
     catch (ApplicationException)
     {
         throw;
     }
 }