2 /* -----------------------------------------------------------------------
3 * <copyright file="PithosSettings.cs" company="GRNet">
5 * Copyright 2011-2012 GRNET S.A. All rights reserved.
7 * Redistribution and use in source and binary forms, with or
8 * without modification, are permitted provided that the following
11 * 1. Redistributions of source code must retain the above
12 * copyright notice, this list of conditions and the following
15 * 2. Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer in the documentation and/or other materials
18 * provided with the distribution.
21 * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
22 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
28 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
34 * The views and conclusions contained in the software and
35 * documentation are those of the authors and should not be
36 * interpreted as representing official policies, either expressed
37 * or implied, of GRNET S.A.
39 * -----------------------------------------------------------------------
42 using System.ComponentModel.Composition;
43 using System.Configuration;
45 using Pithos.Client.WPF.Properties;
46 using Pithos.Interfaces;
48 namespace Pithos.Client.WPF.Configuration
51 using System.Collections.Generic;
55 [Export(typeof(IPithosSettings))]
57 public class PithosSettings : IPithosSettings
59 private readonly Settings _settings = Settings.Default;
61 public PithosSettings()
66 public bool UseDefaultProxy
68 get { return _settings.UseDefaultProxy; }
69 set { _settings.UseDefaultProxy = value; }
72 public bool UseManualProxy
74 get { return _settings.UseManualProxy; }
75 set { _settings.UseManualProxy = value; }
78 public bool UseNoProxy
80 get { return _settings.UseNoProxy; }
81 set { _settings.UseNoProxy = value; }
84 public string PithosPath
86 get { return _settings.PithosPath; }
87 set { _settings.PithosPath = value; }
90 /* public string PithosSite
92 get { return _settings.PithosSite; }
95 public string PithosLoginUrl
97 get { return _settings.PithosLoginUrl; }
100 public string IconsPath
102 get { return _settings.IconPath; }
103 set { _settings.IconPath = value; }
106 public string UserName
108 get { return _settings.UserName; }
109 set { _settings.UserName = value; }
114 get { return _settings.ApiKey; }
115 set { _settings.ApiKey = value; }
118 public AccountsCollection Accounts
122 if (_settings.Accounts==null)
123 _settings.Accounts=new AccountsCollection();
124 return _settings.Accounts;
126 set { _settings.Accounts = value; }
129 public string ProxyServer
131 get { return _settings.ProxyServer; }
132 set { _settings.ProxyServer = value; }
137 get { return _settings.ProxyPort; }
138 set { _settings.ProxyPort = value; }
141 public string ProxyUsername
143 get { return _settings.ProxyUsername; }
144 set { _settings.ProxyUsername = value; }
148 public string ProxyPassword
150 get { return _settings.ProxyPassword; }
151 set { _settings.ProxyPassword = value; }
154 public string ProxyDomain
156 get { return _settings.ProxyDomain; }
157 set { _settings.ProxyDomain = value; }
160 public bool ProxyAuthentication
163 get { return _settings.ProxyAuthentication; }
164 set { _settings.ProxyAuthentication = value; }
169 public bool ExtensionsActivated
172 get { return _settings.ExtensionsActivated; }
173 set { _settings.ExtensionsActivated = value; }
176 public bool ShowDesktopNotifications
178 get { return _settings.ShowDesktopNotifications; }
179 set { _settings.ShowDesktopNotifications = value; }
183 public int PollingInterval
185 get { return _settings.PollingInterval; }
189 throw new ArgumentOutOfRangeException();
190 _settings.PollingInterval = value;
194 public bool StartOnSystemStartup
196 get { return _settings.StartOnSystemStartup; }
199 _settings.StartOnSystemStartup = value;
203 public byte HashingParallelism
205 get { return _settings.HashingParallelism; }
206 set { _settings.HashingParallelism = value; }
212 Proxy.SetFromSettings(this);