Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void AddProfile(ProxyProfile profile)
 {
     _db.AllProxyProfiles.Add(profile);
 }
Esempio n. 4
0
 public ProxyProfile GetProfile(ProxyProfile profile)
 {
     return(_db.AllProxyProfiles.Where(x => x.Name == profile.Name).FirstOrDefault());
 }
Esempio n. 5
0
 public void RemoveProfile(ProxyProfile profile)
 {
     _db.AllProxyProfiles.Remove(
         _db.AllProxyProfiles.Where(x => x.Name == profile.Name).FirstOrDefault()
         );
 }