示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SnmpApplicationFactory"/> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="store">The store.</param>
        /// <param name="membershipProvider">The membership provider.</param>
        /// <param name="factory">The factory.</param>
        public SnmpApplicationFactory(ILogger logger, ObjectStore store, IMembershipProvider membershipProvider, MessageHandlerFactory factory)
        {
            _logger = logger;

            //Always create a ComposedMembershipProvider, so we can add Memberships at runtime
            if (!(membershipProvider is ComposedMembershipProvider))
            {
                membershipProvider = new ComposedMembershipProvider(new IMembershipProvider[1] {
                    membershipProvider
                });
            }


            _membershipProvider = membershipProvider;
            _store   = store;
            _factory = factory;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SnmpApplication"/> class.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="store">The store.</param>
 /// <param name="provider">The provider.</param>
 /// <param name="factory">The factory.</param>
 public SnmpApplication(SnmpApplicationFactory owner, ILogger logger, ObjectStore store, IMembershipProvider provider, MessageHandlerFactory factory)
 {
     _owner    = owner;
     _provider = provider;
     _logger   = logger;
     _store    = store;
     _factory  = factory;
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SnmpApplicationFactory"/> class.
 /// </summary>
 /// <param name="store">The store.</param>
 /// <param name="membershipProvider">The membership provider.</param>
 /// <param name="factory">The factory.</param>
 public SnmpApplicationFactory(ObjectStore store, IMembershipProvider membershipProvider, MessageHandlerFactory factory)
     : this(null, store, membershipProvider, factory) // TODO: handle the null case in the future.
 {
 }