source: extensions/PiwigoLib/PiwigoLib/Service/PwgSetupService.cs @ 7150

Last change on this file since 7150 was 7150, checked in by bayral, 14 years ago

Piwigolib is now modify for mask the implementation of proxy.
Add start version of piwigo WPF

File size: 1.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using Com.Piwigo.Lib.DTO;
6using Com.Piwigo.Lib.Proxy;
7using Com.Piwigo.Lib.Proxy.Response;
8using Com.Piwigo.Lib.DTO.Helper;
9using Com.Piwigo.Lib.IService;
10
11namespace Com.Piwigo.Lib.Service
12{
13
14    internal sealed class PwgSetupService : IPwgSetupService
15    {
16        /// <summary>
17        /// Setting up proxy parameters
18        /// </summary>
19        /// <param name="PwgUserAgent"></param>
20        /// <param name="PwgTimeOutInSecond"></param>
21        /// <param name="serverURI"></param>
22        /// <returns></returns>
23        public void Setup(String PwgUserAgent, Int16? PwgTimeOutInSecond, Uri serverURI)
24        {
25            try
26            {
27                if (PwgUserAgent != null)
28                {
29                    PwgConfigProxy.PwgUserAgent = PwgUserAgent;
30                }
31
32                if (PwgTimeOutInSecond.HasValue)
33                {
34                    PwgConfigProxy.PwgTimeOutInSecond = PwgTimeOutInSecond.Value;
35                }
36
37                PwgConfigProxy.PwgServeurUri = serverURI;
38            }
39            catch (PwgProxyException ex)
40            {
41                throw new PwgServiceException("Setup : a error is raised whn setting up PwgConfigProxy.", ex);
42            }
43        }
44    }
45}
Note: See TracBrowser for help on using the repository browser.