Exemple #1
0
        public static void Main(string[] args)
        {
            var configurator = new ArBatchJobConfig();
            var job          = configurator.GetXmlJob();
            var jobExecution = JobStarter.Start(job, new ArBatchUnityLoader());

            /*
             */

            Database.SetInitializer(new DropCreateDatabaseIfModelChanges <DbStuffzContext>());

            var con = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;

            Console.WriteLine("connection string");
            Console.WriteLine(con);

            /*
             * using (var db = )
             * {
             *  var in1 = new InModel {Name = "joe"};
             *
             *  db.Ins.Add(in1);
             *  db.SaveChanges();
             * }
             */
        }
 public static Task Main(string[] args)
 {
     #if DEBUG
     return(JobStarter.StartAsync <Startup, JobSettings>(true));
     #else
     return(JobStarter.StartAsync <Startup, JobSettings>(false));
     #endif
 }
Exemple #3
0
        /// <summary>
        /// Launches the job
        /// </summary>
        /// <param name="args">The arguments for the job execution</param>
        /// <returns></returns>
        public static int Main(string[] args)
        {
#if DEBUG
            var stopwatch = new Stopwatch();
            stopwatch.Start();
#endif
            JobExecution jobExecution = JobStarter.Start(@"Batch\MyFirstBatch.xml", new MyFirstBatchUnityLoader());
#if DEBUG
            stopwatch.Stop();
            Console.WriteLine(Environment.NewLine + "Done in {0}ms.",
                              stopwatch.ElapsedMilliseconds);
            Console.WriteLine("Press a key to end.");
            Console.ReadKey();
#endif
            return((int)(jobExecution.Status == BatchStatus.Completed ? JobStarter.Result.Success : JobStarter.Result.Failed));
        }
Exemple #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public async void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider container, ITelegramService telegramService, IOptions <TelegramOptions> telegramOptions)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Routing for SPA.

            app.Use(async(context, next) =>
            {
                await next();

                if (context.Response.StatusCode == 404 &&
                    !Path.HasExtension(context.Request.Path.Value) &&
                    !context.Request.Path.Value.StartsWith("/api/"))
                {
                    context.Request.Path = "/index.html";
                    await next();
                }
            });

            app.UseMvcWithDefaultRoute();
            app.UseStaticFiles();

            app.UseCors("AllowAllOrigin");
            app.UseMvc();

            app.UseSignalR(c =>
            {
                c.MapHub <NotificationHub>("/hub/notification");
                c.MapHub <InvitationHub>("/hub/invitation");
                c.MapHub <CalendarHub>("/hub/calendar");
                c.MapHub <TelegramHub>("/hub/telegram");
            });

            JobStarter.RegisterJobs(container);

            if (!string.IsNullOrEmpty(telegramOptions.Value.BotToken) && !string.IsNullOrEmpty(telegramOptions.Value.WebHookUrl))
            {
                await telegramService.SetWebHookAsync();
            }
        }
Exemple #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            App.ScreenHeight = (Resources.DisplayMetrics.HeightPixels / Resources.DisplayMetrics.Density);
            App.ScreenWidth  = (Resources.DisplayMetrics.WidthPixels / Resources.DisplayMetrics.Density);

            var accessibilityManager = (AccessibilityManager)GetSystemService(AccessibilityService);

            //NOTE: ref: https://stackoverflow.com/a/12362545 we only use touch exploration events for checking if talkback is enabled
            accessibilityManager.AddTouchExplorationStateChangeListener(this);
            Accessibility.SetAccessibility(accessibilityManager.IsTouchExplorationEnabled, false);

            base.OnCreate(savedInstanceState);

            Forms.SetFlags("CollectionView_Experimental");

            Forms.Init(this, savedInstanceState);
            Platform.Init(this, savedInstanceState);
            CachedImageRenderer.Init(true);
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
            CardsViewRenderer.Preserve();

            var locale = new Java.Util.Locale(CultureInfo.InvariantCulture.Name);

            Java.Util.Locale.Default = locale;

            var config = new Android.Content.Res.Configuration {
                Locale = locale
            };

            Android.App.Application.Context.Resources.Configuration.SetTo(config);

            JobStarter.SetupBackgroundUpdateJob(this);

            LoadApplication(new App());
        }
 private static Task Main()
 {
     return(JobStarter
            .StartAsync <Startup, RootstockJobSettings>(IsDebug));
 }