Opc.Ua.BindingFactory.Add C# (CSharp) Method

Add() public method

Adds a binding type to the factory.
public Add ( string uriScheme, Type bindingType ) : void
uriScheme string The URI scheme.
bindingType System.Type Type of the binding.
return void
        public virtual void Add(string uriScheme, Type bindingType)
        { 
            m_bindings[uriScheme] = bindingType;
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Creates a binding table from the bindings specified in the application configuration.
        /// </summary>
        public static BindingFactory Create(ApplicationConfiguration configuration, ServiceMessageContext context)
        {
            if (configuration == null || configuration.TransportConfigurations == null || configuration.TransportConfigurations.Count == 0)
            {
                return(new BindingFactory(context.NamespaceUris, context.Factory));
            }

            BindingFactory table = new BindingFactory(context.NamespaceUris, context.Factory);

            foreach (TransportConfiguration entry in configuration.TransportConfigurations)
            {
                if (entry.TypeName == Utils.UaTcpBindingDefault)
                {
                    continue;
                }

                Type type = Type.GetType(entry.TypeName);

                if (type == null)
                {
                    throw ServiceResultException.Create(StatusCodes.BadConfigurationError, "Could not find binding type '{0}'.", entry.TypeName);
                }

                table.Add(entry.UriScheme, type);
            }

            return(table);
        }
All Usage Examples Of Opc.Ua.BindingFactory::Add