Example #1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            GamervineLogListener gll = new GamervineLogListener();

            SqlLogProcessor.Listen(gll);
            Debug.Listeners.Add(gll);

            Debug.WriteLine("Application_Start firing at " + DateTime.Now.ToString());

            //_url = HttpContext.Current.Request.Url.AbsoluteUri.Replace(HttpContext.Current.Request.Url.AbsolutePath, string.Empty);

            //RegisterCacheEntry(new DataService());
            //RegisterCacheEntry(new PostService());

            try
            {
                Type t = typeof(Gamervine.Service.GamervineService);
                _serviceAppDomain = AppDomain.CreateDomain("GamervineService", null, Path.Combine(this.Context.Request.PhysicalApplicationPath, "bin"), string.Empty, false);
                _serviceAppDomain.CreateInstanceAndUnwrap(t.Assembly.FullName, t.FullName);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception occurred in Application_Start:" + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }
Example #2
0
        public GamervineService()
        {
            GamervineLogListener gll = new GamervineLogListener();

            SqlLogProcessor.Listen(gll);
            Debug.Listeners.Add(gll);

            _dataTimer.Elapsed += new System.Timers.ElapsedEventHandler(dataTimer_Elapsed);
            _postTimer.Elapsed += new System.Timers.ElapsedEventHandler(postTimer_Elapsed);

            //_dataTimer.Interval = _dataService.Interval * 1000;
            //_postTimer.Interval = _postService.Interval * 1000;
            _dataTimer.Interval = 600000;
            //_dataTimer.Interval = 10000;
            //_postTimer.Interval = 1800000;
            _postTimer.Interval = 60000;

            _dataTimer.Enabled = true;
            _postTimer.Enabled = true;
        }