/// <summary> /// Default constructor for the monitor control. /// </summary> /// <param name="settings">Current app settings</param> public MonitorControl(Settings settings) { Settings = settings; PackageList = new List <PackageDetails>(); WebService = new MobuWsClient(); WebService.Endpoint.Address = new EndpointAddress(Settings.WebServiceUrl); if (settings.WebServiceUrl.StartsWith("https")) { var binding = new BasicHttpsBinding(); binding.Security.Mode = BasicHttpsSecurityMode.Transport; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; WebService.Endpoint.Binding = binding; } else { var binding = new BasicHttpBinding(); WebService.Endpoint.Binding = binding; } var timeout = new TimeSpan(0, 0, 0, 0, Settings.WebServiceTimeout); WebService.Endpoint.Binding.OpenTimeout = timeout; WebService.Endpoint.Binding.CloseTimeout = timeout; WebService.Endpoint.Binding.SendTimeout = timeout; WebService.Endpoint.Binding.ReceiveTimeout = timeout; WebMonitor = new WebMonitor(this); PackageMonitor = new PackageMonitor(this, WebService); }
/// <summary> /// Default constructor for the upload form. /// </summary> /// <param name="webService">Reference to the web service instance used by the main form</param> public FrmUploadPackage(MobuWsClient webService) { InitializeComponent(); MaximumSize = new System.Drawing.Size(Width, 210); MinimumSize = new System.Drawing.Size(Width, 210); Size = new System.Drawing.Size(Width, 210); barUploadProgress.Value = 0; comboSize.SelectedIndex = 7; this.webService = webService; barUploadProgress.Refresh(); lblUploadMsg.Refresh(); }
/// <summary> /// Default constructor for package monitor. /// </summary> /// <param name="ctrMonitor">Reference to parent monitor control class.</param> public PackageMonitor(MonitorControl ctrMonitor, MobuWsClient webService) { this.monitorControl = ctrMonitor; WorkerSupportsCancellation = true; RunWorkerAsync(); }