RegisterType() 공개 메소드

Registers the type.
public RegisterType ( Type type, string itemNamePrefix ) : void
type System.Type The type to register.
itemNamePrefix string The item name prefix.
리턴 void
예제 #1
0
        public void CustomAgnosticTests()
        {
            var cif = new ConfigurationItemFactory();
            cif.RegisterType(typeof(CustomRendererAgnostic), string.Empty);

            Layout l = new SimpleLayout("${customAgnostic}", cif);

            l.Initialize(null);
            Assert.True(l.IsThreadAgnostic);
        }
예제 #2
0
        public void CustomNotAgnosticTests()
        {
            var cif = new ConfigurationItemFactory();
            cif.RegisterType(typeof(CustomRendererNonAgnostic), string.Empty);
            var cfg = new LoggingConfiguration(cif);
            Layout l = new SimpleLayout("${customNotAgnostic}", cfg);

            l.Initialize(cfg);
            Assert.IsFalse(l.IsThreadAgnostic);
        }