private DocumentHistory[] GetHistory(Guid docId, PrintServiceClient cl)
        {
            int count = 1;

            while (true)
            {
                try
                {
                    return(cl.GetDocumentHistory(docId));
                }
                catch (System.ServiceModel.EndpointNotFoundException)
                {
                    textBox1.Text = $"Сервер стал недоступен. Попытка подключения{++count}";
                    return(null);
                }
                catch (System.Net.Sockets.SocketException)
                {
                    textBox1.Text = "Разрыв соединения";
                    return(null);
                }
                catch (TimeoutException)
                {
                    //ignore
                    textBox1.Text = $"Попытка {++count}";
                }
            }
        }
        public WaitPrintResultcs(string docName, Guid id, PrintServiceClient client)
        {
            InitializeComponent();
            Model = new WaitPrintResultcsModel(docName);
            dataBindingSource.DataSource = Model;
            Text = docName;

            _idDoc       = id;
            this._client = client;

            ViewWait();
        }
Exemplo n.º 3
0
 public static CheckBase SetDeviceId(string deviceName, CheckBase doc, PrintServiceClient client)
 {
     doc.DeviceId = client.GetDeviceIdByDeviceName(deviceName);
     return(doc);
 }
Exemplo n.º 4
0
        public static PrintServiceClient GetClient(string address, int port)
        {
            var client = new PrintServiceClient(GetBinding(), new EndpointAddress(string.Format("http://{0}:{1}/PrintService/", address, port)));

            return(client);
        }