private void InitAdditionalProperties(HttpWebClientProtocol proxy) { if (proxyTypeHandlers == null) { proxyTypeHandlers = new Hashtable(); CustomHandler[] proxyProperties = Configuration.MasterConfig.ProxyProperties; if ((proxyProperties != null) && (proxyProperties.Length > 0)) { foreach (CustomHandler handler in proxyProperties) { string typeName = handler.TypeName; string str2 = handler.Handler; if (((typeName != null) && (typeName.Length != 0)) && ((str2 != null) && (str2.Length != 0))) { Type key = Type.GetType(typeName); if (key == null) { NewMainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, typeName)); } else { Type type = Type.GetType(str2); if (type == null) { NewMainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, str2)); } else { proxyTypeHandlers.Add(key, type); } } } } } } for (Type type3 = proxy.GetType(); type3 != typeof(object); type3 = type3.BaseType) { Type type4 = proxyTypeHandlers[type3] as Type; if (type4 != null) { this.AdditionalProperties = (IAdditionalProperties)Activator.CreateInstance(type4, new object[] { proxy }); break; } } }
private void InitAdditionalProperties(HttpWebClientProtocol proxy) { if (proxyTypeHandlers == null) { proxyTypeHandlers = new Hashtable(); CustomHandler[] handlerArray1 = Configuration.MasterConfig.ProxyProperties; if ((handlerArray1 != null) && (handlerArray1.Length > 0)) { foreach (CustomHandler handler1 in handlerArray1) { string text1 = handler1.TypeName; string text2 = handler1.Handler; if (((text1 != null) && (text1.Length != 0)) && ((text2 != null) && (text2.Length != 0))) { Type type1 = Type.GetType(text1); if (type1 == null) { MainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, text1)); } else { Type type2 = Type.GetType(text2); if (type2 == null) { MainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, text2)); } else { proxyTypeHandlers.Add(type1, type2); } } } } } } for (Type type3 = proxy.GetType(); type3 != typeof (object); type3 = type3.BaseType) { Type type4 = proxyTypeHandlers[type3] as Type; if (type4 != null) { AdditionalProperties = (IAdditionalProperties) Activator.CreateInstance(type4, new object[] {proxy}); return; } } }