protected override void SetProxy(ProxyInfo proxyInfo) { if (proxyInfo != null) { SocksProxyTypes type = proxyInfo.Details.Details.GetStrongType <SocksProxyTypes>(); if (type == SocksProxyTypes.Socks5) { Context.Get <IMessageBox>().Information(Resources.ThisClientDoesntSupportSocks5Proxies); IsProxyChangeCancelled = true; return; } if (type != SocksProxyTypes.Socks4) { if (Context.Get <IMessageBox>().YesNoQuestion(Resources.TypeOfProxyIsNotDefinedDoYouWantToContinue) == MessageBoxResult.No) { IsProxyChangeCancelled = true; return; } } } base.SetProxy(proxyInfo); }
public void Add(string proxyUrl, SocksProxyTypes type) { if (!Exists(proxyUrl)) { hashtable.Add(proxyUrl, type); } }
public void Add(string proxyUrl, SocksProxyTypes type) { if (!Exists(proxyUrl)) { hashtable.Add(proxyUrl, type); } }
private static string GetDetails(SocksProxyTypes type) { switch (type) { case SocksProxyTypes.Socks4: return Resources.Socks4Details; case SocksProxyTypes.Socks5: return Resources.Socks5Details; case SocksProxyTypes.Unchecked: return Resources.UncheckedDetails; case SocksProxyTypes.ChangesContent: return Resources.ChangesContentDetails; case SocksProxyTypes.CannotVerify: return Resources.CannotVerifyDetails; default: throw new InvalidOperationException(Resources.UnsupportedSocksProxyType); } }
private static string GetDetails(SocksProxyTypes type) { switch (type) { case SocksProxyTypes.Socks4: return(Resources.Socks4Details); case SocksProxyTypes.Socks5: return(Resources.Socks5Details); case SocksProxyTypes.Unchecked: return(Resources.UncheckedDetails); case SocksProxyTypes.ChangesContent: return(Resources.ChangesContentDetails); case SocksProxyTypes.CannotVerify: return(Resources.CannotVerifyDetails); default: throw new InvalidOperationException(Resources.UnsupportedSocksProxyType); } }
public SocksProxyDetails(SocksProxyTypes type, IPAddress outgoingIPAddress) : base(type.ToString(), GetName(type), GetDetails(type), outgoingIPAddress) { }
public SocksProxyDetails(SocksProxyTypes type, IPAddress outgoingIPAddress) : base(type.ToString(), GetName(type), GetDetails(type), outgoingIPAddress) { }