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

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

Connection à partir de wpf

File size: 1.4 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                if (serverURI != null)
37                {
38                    PwgConfigProxy.PwgServeurUri = serverURI;
39                }
40            }
41            catch (PwgProxyException ex)
42            {
43                throw new PwgServiceException("Setup : a error is raised whn setting up PwgConfigProxy.", ex);
44            }
45        }
46    }
47}
Note: See TracBrowser for help on using the repository browser.