public void Add(ProtocolElement protocolElement) { BaseAdd(protocolElement); }
// ValidateType // // Validate and Get the Type that is sent in // // Note: Because ProtocolElement is outside of our assembly we need to do // that here, and because of that we need to hardcode the property // names!! // private Type ValidateAndGetType( ProtocolElement element, string typeName, Type assignableType, string elementPropertyName ) { Type handlerType; try { handlerType = Type.GetType(typeName, true /*throwOnError*/); } catch (Exception e) { PropertyInformation propInfo = null; string source = String.Empty; int lineNum = 0; if (element != null && null != element.ElementInformation) { propInfo = element.ElementInformation.Properties[elementPropertyName]; if (null != propInfo) { source = propInfo.Source; lineNum = propInfo.LineNumber; } } throw new ConfigurationErrorsException( e.Message, e, source, lineNum); } ConfigUtil.CheckAssignableType( assignableType, handlerType, element, elementPropertyName); return handlerType; }
public void Install(SecurityIdentifier identity) { if (options.ListenerAdapterChecked) { var sm = new WebAdmin.ServerManager(); var wasConfiguration = sm.GetApplicationHostConfiguration(); var section = wasConfiguration.GetSection(ListenerAdapterPath); var listenerAdaptersCollection = section.GetCollection(); var element = listenerAdaptersCollection.CreateElement(); element.GetAttribute("name").Value = Scheme; element.GetAttribute("identity").Value = identity.Value; listenerAdaptersCollection.Add(element); sm.CommitChanges(); wasConfiguration = null; sm = null; } if (options.ProtocolHandlerChecked) { var rootWebConfig = GetRootWebConfiguration(); var section = (ProtocolsSection)rootWebConfig.GetSection(ProtocolsPath); var element = new ProtocolElement(Scheme); element.ProcessHandlerType = typeof(UdpProcessProtocolHandler).AssemblyQualifiedName; element.AppDomainHandlerType = typeof(UdpAppDomainProtocolHandler).AssemblyQualifiedName; element.Validate = false; section.Protocols.Add(element); rootWebConfig.Save(); } }
public void Remove(ProtocolElement protocolElement) { BaseRemove(GetElementKey(protocolElement)); }
public void Remove(ProtocolElement protocolElement) { base.BaseRemove(this.GetElementKey(protocolElement)); }
public static void Install(UdpInstallerOptions options) { if (options.ListenerAdapterChecked) { WebAdmin.ServerManager sm = new WebAdmin.ServerManager(); WebAdmin.Configuration wasConfiguration = sm.GetApplicationHostConfiguration(); WebAdmin.ConfigurationSection section = wasConfiguration.GetSection(ListenerAdapterPath); WebAdmin.ConfigurationElementCollection listenerAdaptersCollection = section.GetCollection(); WebAdmin.ConfigurationElement element = listenerAdaptersCollection.CreateElement(); element.GetAttribute("name").Value = UdpConstants.Scheme; element.GetAttribute("identity").Value = WindowsIdentity.GetCurrent().User.Value; listenerAdaptersCollection.Add(element); sm.CommitChanges(); wasConfiguration = null; sm = null; } if (options.ProtocolHandlerChecked) { Configuration rootWebConfig = GetRootWebConfiguration(); ProtocolsSection section = (ProtocolsSection)rootWebConfig.GetSection(ProtocolsPath); ProtocolElement element = new ProtocolElement(UdpConstants.Scheme); element.ProcessHandlerType = typeof(UdpProcessProtocolHandler).AssemblyQualifiedName; element.AppDomainHandlerType = typeof(UdpAppDomainProtocolHandler).AssemblyQualifiedName; element.Validate = false; section.Protocols.Add(element); rootWebConfig.Save(); } }
public void Add(ProtocolElement protocolElement) { }
public void Remove(ProtocolElement protocolElement) { }
public void Remove( ProtocolElement protocolElement ) { BaseRemove( GetElementKey( protocolElement ) ); }
public void Add( ProtocolElement protocolElement ) { BaseAdd( protocolElement ); }