Beispiel #1
0
        public MainWindow(SqlConnection con)
        {
            sql = con;
            log.Info("Main window creating...");
            data    = new ObservableCollection <int[]>();
            _server = new Server.HttpServer();
            _server.Start();

            if (Strafrunden.Resources.TransponderLookup.Sql == null)
            {
                Strafrunden.Resources.TransponderLookup.Sql = sql;
            }

            _tcp = new TCPServer(sql);
            _tcp.Start();


            log.Info("registering Handlers...");
            Handlers.RegisterResourceHandler(new StrafrundenPageHandler(sql));
            Handlers.RegisterResourceHandler(new FileResourceHandler("/strafrunden/main.css", "strafrunden.css", "text/css"));
            Handlers.RegisterResourceHandler(new FileResourceHandler("/strafrunden/favicon.ico", "favicon.ico", "image/x-icon"));

            log.Info("Creating timers...");
            timer = new Timer();
            log.Info("Initializing components...");
            InitializeComponent();
            log.Info("Creating timers...");
            timer.Enabled  = true;
            timer.Interval = 1000;
            timer.Tick    += Timer_Elapsed;
            log.Info("Main window created!");
        }
 public HttpHandler(Net.HttpListener l, HttpServer server)
 {
     listener = l;
     serv     = server;
 }