<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
    <section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
  </configSections>
  <unity>
    <namespace name="Lextm.SharpSnmpLib.Browser" />
    <namespace name="Lextm.SharpSnmpLib.Pipeline" />
    <namespace name="Lextm.SharpSnmpLib.Messaging" />
    <namespace name="Lextm.SharpSnmpLib.Security"/>
    <namespace name="Lextm.SharpSnmpLib.Mib" />
    <namespace name="Lextm.SharpSnmpLib" />
    <assembly name="SharpSnmpLib.Mib" />
    <assembly name="Browser" />
    <assembly name="SharpSnmpLib" />
    <aliases>
      <add alias="DockContent" type="WeifenLuo.WinFormsUI.Docking.DockContent, WeifenLuo.WinFormsUI.Docking" />
      <add alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
    </aliases>
    <containers>
      <container name="browser">
        <register type="UserRegistry">
          <lifetime type="singleton" />
          <constructor>
            <param name="users" dependencyType="User[]" />
          </constructor>
        </register>
        <!-- message handler settings-->
        <register type="MessageHandlerFactory" name="MessageFactory">
          <lifetime type="singleton" />
          <constructor>
            <param name="mappings">
              <array>
                <!--here we only have four-->
                <dependency name="TRAPV1" />
                <dependency name="TRAPV2" />
                <dependency name="INFORM" />
                <dependency name="ALL" />
              </array>
            </param>
          </constructor>
        </register>
        <register type="HandlerMapping" name="TRAPV1">
          <lifetime type="singleton" />
          <constructor>
            <param name="version" value="v1" />
            <param name="command" value="TRAPV1" />
            <param name="handler" dependencyType="IMessageHandler" dependencyName="TrapV1Handler" />
          </constructor>
        </register>
        <register type="HandlerMapping" name="TRAPV2">
          <lifetime type="singleton" />
          <constructor>
            <param name="version" value="v2,v3" />
            <param name="command" value="TRAPV2" />
            <param name="handler" dependencyType="IMessageHandler" dependencyName="TrapV2Handler" />
          </constructor>
        </register>
        <register type="HandlerMapping" name="INFORM">
          <lifetime type="singleton" />
          <constructor>
            <param name="version" value="v2,v3" />
            <param name="command" value="INFORM" />
            <param name="handler" dependencyType="IMessageHandler" dependencyName="InformHandler" />
          </constructor>
        </register>
        <register type="HandlerMapping" name="ALL">
          <lifetime type="singleton" />
          <constructor>
            <param name="version" value="*" />
            <param name="command" value="*" />
            <param name="handler" dependencyType="IMessageHandler" dependencyName="NullHandler" />
          </constructor>
        </register>
        <register type="IMessageHandler" mapTo="TrapV1MessageHandler" name="TrapV1Handler">
          <lifetime type="singleton" />
        </register>
        <register type="IMessageHandler" mapTo="TrapV2MessageHandler" name="TrapV2Handler">
          <lifetime type="singleton" />
        </register>
        <register type="IMessageHandler" mapTo="InformRequestMessageHandler" name="InformHandler">
          <lifetime type="singleton" />
        </register>
        <register type="IMessageHandler" mapTo="NullMessageHandler" name="NullHandler">
          <lifetime type="singleton" />
        </register>
        <!-- application factory and its parts -->
        <register type="SnmpApplicationFactory">
          <lifetime type="singleton" />
          <constructor>
            <!--<param name="logger" />-->
            <param name="store" dependencyType="ObjectStore" />
            <param name="membershipProvider" dependencyType="IMembershipProvider" dependencyName="Composed" />
            <param name="factory" dependencyType="MessageHandlerFactory" />
          </constructor>
        </register>
        <register type="ObjectStore">
          <lifetime type="singleton" />
        </register>
        <!-- this is the membership provider -->
        <register type="IMembershipProvider" mapTo="ComposedMembershipProvider" name="Composed">
          <lifetime type="singleton" />
          <constructor>
            <param name="providers">
              <array>
                <dependency name="v1" />
                <dependency name="v2" />
                <dependency name="v3" />
              </array>
            </param>
          </constructor>
        </register>
        <register type="IMembershipProvider" mapTo="Version1MembershipProvider" name="v1">
          <lifetime type="singleton" />
          <constructor>
            <param name="getCommunity" dependencyType="OctetString" dependencyName="get" />
            <param name="setCommunity" dependencyType="OctetString" dependencyName="set" />
          </constructor>
        </register>
        <register type="IMembershipProvider" mapTo="Version2MembershipProvider" name="v2">
          <lifetime type="singleton" />
          <constructor>
            <param name="getCommunity" dependencyType="OctetString" dependencyName="get" />
            <param name="setCommunity" dependencyType="OctetString" dependencyName="set" />
          </constructor>
        </register>
        <register type="IMembershipProvider" mapTo="Version3MembershipProvider" name="v3">
          <lifetime type="singleton" />
        </register>
        <register type="OctetString" name="get">
          <lifetime type="singleton" />
          <constructor>
            <param name="content" value="public" />
          </constructor>
        </register>
        <register type="OctetString" name="set">
          <lifetime type="singleton" />
          <constructor>
            <param name="content" value="public" />
          </constructor>
        </register>       
        <!-- Engine -->
        <register type="SnmpEngine">
          <lifetime type="singleton" />
          <constructor>
            <param name="factory" dependencyType="SnmpApplicationFactory" />
            <param name="listener" dependencyType="Listener" />
            <param name="group" dependencyType="EngineGroup" />
          </constructor>
        </register>
        <register type="Listener">
          <lifetime type="singleton" />
          <property name="Users" dependencyType="UserRegistry" />
        </register>
        <register type="IProfileRegistry" mapTo="ProfileRegistry" name="">
          <lifetime type="singleton" />
        </register>
        <register type="IObjectRegistry" mapTo="ReloadableObjectRegistry" name="">
          <lifetime type="singleton" />
          <constructor>
            <param name="path" value="modules" />
          </constructor>
        </register>
        <register type="DockContent" mapTo="OutputPanel" name="Output">
          <lifetime type="singleton" />
          <property name="Profiles" dependencyType="IProfileRegistry" />
        </register>
        <register type="DockContent" mapTo="AgentProfilePanel" name="AgentProfile">
          <lifetime type="singleton" />
          <property name="Profiles" dependencyType="IProfileRegistry" />
        </register>
        <register type="DockContent" mapTo="MibTreePanel" name="MibTree">
          <lifetime type="singleton" />
          <property name="Objects" dependencyType="IObjectRegistry" />
          <property name="Profiles" dependencyType="IProfileRegistry" />
        </register>
        <register type="DockContent" mapTo="NotificationPanel" name="Notification">
          <lifetime type="singleton" />
          <property name="Objects" dependencyType="IObjectRegistry" />
        </register>
        <register type="DockContent" mapTo="ModuleListPanel" name="ModuleList">
          <lifetime type="singleton" />
          <property name="Objects" dependencyType="IObjectRegistry" />
        </register>
      </container>
    </containers>
  </unity>
  <log4net>
    <!-- Define some output appenders -->
    <appender name="OutputPanelAppender" type="Lextm.SharpSnmpLib.OutputPanelAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%message%newline" />
      </layout>
    </appender>
    <!-- Setup the root category, add the appenders and set the default level -->
    <root>
      <level value="WARN" />
    </root>
    <!-- Specify the level for some specific categories -->
    <logger name="Lextm.SharpSnmpLib.Browser">
      <level value="ALL" />
      <appender-ref ref="OutputPanelAppender" />
    </logger>
    <logger name="Lextm.SharpSnmpLib.Mib">
      <level value="ALL" />
      <appender-ref ref="OutputPanelAppender" />
    </logger>
  </log4net>
  <startup>
    <supportedRuntime version="v2.0.50727" />
  </startup>
</configuration>