Toasts – Blame information for rev 55

Subversion Repositories:
Rev:
Rev Author Line No. Line
55 office 1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Linq;
5 using System.Runtime.CompilerServices;
6 using System.Text;
7 using System.Threading.Tasks;
8 using Toasts.Annotations;
9  
10 namespace Toasts
11 {
12 public class Proxy : INotifyPropertyChanged
13 {
14 private string _url;
15 private string _username;
16 private string _password;
17 private bool _enable;
18  
19 public bool Enable
20 {
21 get => _enable;
22 set
23 {
24 if (value == _enable) return;
25 _enable = value;
26 OnPropertyChanged();
27 }
28 }
29  
30 public string Url
31 {
32 get => _url;
33 set
34 {
35 if (value == _url) return;
36 _url = value;
37 OnPropertyChanged();
38 }
39 }
40  
41 public string Username
42 {
43 get => _username;
44 set
45 {
46 if (value == _username) return;
47 _username = value;
48 OnPropertyChanged();
49 }
50 }
51  
52 public string Password
53 {
54 get => _password;
55 set
56 {
57 if (value == _password) return;
58 _password = value;
59 OnPropertyChanged();
60 }
61 }
62  
63 [UsedImplicitly]
64 public Proxy()
65 {
66  
67 }
68  
69 public Proxy(string url, string username, string password, bool enable) : this()
70 {
71 _url = url;
72 _username = username;
73 _password = password;
74 _enable = enable;
75 }
76  
77 public event PropertyChangedEventHandler PropertyChanged;
78  
79 protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
80 {
81 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
82 }
83  
84 protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
85 {
86 if (EqualityComparer<T>.Default.Equals(field, value)) return false;
87 field = value;
88 OnPropertyChanged(propertyName);
89 return true;
90 }
91 }
92 }