Winify
/trunk/Configuration/Configuration.cs |
@@ -10,6 +10,7 @@ |
{ |
private bool _launchOnBoot; |
private bool _ignoreSelfSignedCertificates; |
private Proxy _proxy = new Proxy(); |
|
public bool LaunchOnBoot |
{ |
@@ -33,6 +34,23 @@ |
} |
} |
|
public Proxy Proxy |
{ |
get => _proxy; |
set |
{ |
if (Equals(value, _proxy)) return; |
_proxy = value; |
OnPropertyChanged(); |
} |
} |
|
[UsedImplicitly] |
public Configuration() |
{ |
|
} |
|
public event PropertyChangedEventHandler PropertyChanged; |
|
[NotifyPropertyChangedInvocator] |
/trunk/Configuration/Configuration.csproj |
@@ -46,6 +46,7 @@ |
<Compile Include="Configuration.cs" /> |
<Compile Include="Properties\Annotations.cs" /> |
<Compile Include="Properties\AssemblyInfo.cs" /> |
<Compile Include="Proxy.cs" /> |
</ItemGroup> |
<ItemGroup> |
<None Include="Configuration.xsd"> |
/trunk/Configuration/Proxy.cs |
@@ -0,0 +1,84 @@ |
using System; |
using System.Collections.Generic; |
using System.ComponentModel; |
using System.Linq; |
using System.Runtime.CompilerServices; |
using System.Text; |
using System.Threading.Tasks; |
using Configuration.Annotations; |
|
namespace Configuration |
{ |
public class Proxy : INotifyPropertyChanged |
{ |
private string _url; |
private string _username; |
private string _password; |
private bool _enable; |
|
public bool Enable |
{ |
get => _enable; |
set |
{ |
if (value == _enable) return; |
_enable = value; |
OnPropertyChanged(); |
} |
} |
|
public string Url |
{ |
get => _url; |
set |
{ |
if (value == _url) return; |
_url = value; |
OnPropertyChanged(); |
} |
} |
|
public string Username |
{ |
get => _username; |
set |
{ |
if (value == _username) return; |
_username = value; |
OnPropertyChanged(); |
} |
} |
|
public string Password |
{ |
get => _password; |
set |
{ |
if (value == _password) return; |
_password = value; |
OnPropertyChanged(); |
} |
} |
|
[UsedImplicitly] |
public Proxy() |
{ |
|
} |
|
public event PropertyChangedEventHandler PropertyChanged; |
|
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
{ |
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
} |
|
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) |
{ |
if (EqualityComparer<T>.Default.Equals(field, value)) return false; |
field = value; |
OnPropertyChanged(propertyName); |
return true; |
} |
} |
} |