Beispiel #1
0
 private void setLog4Net()
 {
     Fluently.With(LogManager.GetRepository() as Hierarchy)
     .Do(repo => repo.Root.AddAppender(
             Fluently.With(new RollingFileAppender())
             .Do(appender => appender.File               = "logfile.txt")
             .Do(appender => appender.AppendToFile       = true)
             .Do(appender => appender.StaticLogFileName  = true)
             .Do(appender => appender.MaxSizeRollBackups = 10)
             .Do(appender => appender.MaximumFileSize    = "10MB")
             .Do(appender => appender.RollingStyle       = RollingFileAppender.RollingMode.Size)
             .Do(appender => appender.Layout             =
                     Fluently.With(new PatternLayout())
                     .Do(layout => layout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline")
                     .Do(layout => layout.ActivateOptions())
                     .Done())
             .Do(appender => appender.ActivateOptions())
             .Done()))
     .Do(repo => repo.Root.AddAppender(
             Fluently.With(new MemoryAppender())
             .Do(memory => memory.ActivateOptions())
             .Done()))
     .Do(repo => repo.Root.Level = Level.Info)
     .Do(repo => repo.Configured = true)
     .Done();
 }
Beispiel #2
0
 static void Main(string[] args)
 {
     Fluently.With(new jwtApp())
     .Do(app => app.Layout = new Layout {
         LayoutName = "layout1"
     })
     .Do(app => app.Layout = new Layout {
         LayoutName = "layout2", Extend = "layout1"
     })
     .Do(app => app.Navigation = new Navigation {
         NavigationName = "nav1", HasLayout = "layout1", Widget = "Student"
     })
     .Do(app => app.Navigation = Fluently.With(new Navigation {
         NavigationName = "nav2", HasLayout = "layout2"
     })
                                 .Do(nav => nav.View = new View {
         ViewName = "box1", WidgetName = "Student"
     })
                                 .Do(nav => nav.View = new View {
         ViewName = "box2", WidgetName = "Department"
     })
                                 .Done())
     .Done()
     .Execute();
     Console.ReadKey();
 }
Beispiel #3
0
 public static void RegisterComponent()
 {
     Fluently.With(new jwtApp())
     .Do(app => app.Navigation = new Navigation {
         NavigationName = "nav1", WidgetName = "DbWeather"
     })
     .Done()
     .Execute();
 }