示例#1
0
 private void Scheduler_ExecuteScheduledEvent(object sender, EventArgs e)
 {
     try
     {
         var admin = new busCodeSnippet();
         admin.ClearAnonymousSnippets(App.Configuration.HoursToDeleteAnonymousSnippets, 9999999);
     }
     catch { }
 }
示例#2
0
        public ActionResult ClearAnonymousSnippets()
        {
            busCodeSnippet codeSnippet = CodePasteFactory.GetCodeSnippet();
            int            result      = codeSnippet.ClearAnonymousSnippets(App.Configuration.HoursToDeleteAnonymousSnippets,
                                                                            App.Configuration.MinViewBeforeDeleteAnonymousSnippets);

            if (result < 0)
            {
                ErrorDisplay.ShowError(codeSnippet.ErrorMessage);
            }
            else
            {
                ErrorDisplay.ShowMessage((result).ToString() + " old snippets have been cleared out.");
            }

            return(View("Index", ViewModel));
        }
示例#3
0
        protected void Application_Start()
        {
            RegisterRoutes(RouteTable.Routes);


            //.RewriteRoutesForTesting(RouteTable.Routes);

            //JSONSerializer.DefaultJsonParserType = SupportedJsonParserTypes.JavaScriptSerializer;

            // Create a log manager based on setting in config file
            LogManager.Create();

            // Clear out expired anonymous snippets whenever app starts
            busCodeSnippet Snippet = new busCodeSnippet();

            Snippet.ClearAnonymousSnippets(App.Configuration.DaysToDeleteAnonymousSnippets,
                                           App.Configuration.MinViewBeforeDeleteAnonymousSnippets);
        }
示例#4
0
        protected void Application_Start()
        {
            RegisterRoutes(RouteTable.Routes);


            //.RewriteRoutesForTesting(RouteTable.Routes);

            //JSONSerializer.DefaultJsonParserType = SupportedJsonParserTypes.JavaScriptSerializer;

            // Create a log manager based on setting in config file
            LogManager.Create();

            // Clear out expired anonymous snippets whenever app starts
            busCodeSnippet Snippet = new busCodeSnippet();

            Snippet.ClearAnonymousSnippets(App.Configuration.HoursToDeleteAnonymousSnippets,
                                           App.Configuration.MinViewBeforeDeleteAnonymousSnippets);

            // Clear Anonymous snippets
            scheduler = new Scheduler();
            scheduler.CheckFrequency         = 3600 * 1000;
            scheduler.ExecuteScheduledEvent += Scheduler_ExecuteScheduledEvent;
        }
示例#5
0
        protected void Application_Start()
        {
            RegisterRoutes(RouteTable.Routes);

            
            //.RewriteRoutesForTesting(RouteTable.Routes);

            //JSONSerializer.DefaultJsonParserType = SupportedJsonParserTypes.JavaScriptSerializer;

            // Create a log manager based on setting in config file
            LogManager.Create();

            // Clear out expired anonymous snippets whenever app starts
            busCodeSnippet Snippet = new busCodeSnippet();
            Snippet.ClearAnonymousSnippets(App.Configuration.DaysToDeleteAnonymousSnippets,
                                           App.Configuration.MinViewBeforeDeleteAnonymousSnippets);
        }