public void EditProfile(ProxyProfile profile) { int index; index = _db.AllProxyProfiles.IndexOf( _db.AllProxyProfiles.Where(x => x.Name == profile.Name).FirstOrDefault() ); _db.AllProxyProfiles.RemoveAt(index); _db.AllProxyProfiles.Insert(index, profile); }
public bool IsActive(ProxyProfile profile) { RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true); var reg = registry.GetValue("ProxyEnable"); if (reg.ToString() == "0") { return(false); } reg = registry.GetValue("ProxyServer"); if (reg.ToString() == (profile.ProxyAddress + ":" + profile.Port)) { return(true); } return(false); }
public void AddProfile(ProxyProfile profile) { _db.AllProxyProfiles.Add(profile); }
public ProxyProfile GetProfile(ProxyProfile profile) { return(_db.AllProxyProfiles.Where(x => x.Name == profile.Name).FirstOrDefault()); }
public void RemoveProfile(ProxyProfile profile) { _db.AllProxyProfiles.Remove( _db.AllProxyProfiles.Where(x => x.Name == profile.Name).FirstOrDefault() ); }