Beispiel #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.UseAuthentication();

            HelperAction.Configure(app.ApplicationServices.GetRequiredService <IHttpContextAccessor>());


            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();
            app.UseCors(options => options.AllowAnyOrigin());
            app.UseSession();
            app.UseStaticFiles();

            //app.UseExceptionHandler(new ExceptionHandlerOptions
            //{
            //    ExceptionHandler = new JsonExceptionMiddleware().Invoke
            //});

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Login}/{action=Index}/{id?}");
            });
        }
Beispiel #2
0
        public bool HelperJob(HelperAction action, string filePath, string destinationPath = null,
                              string newFileName = "")
        {
            try
            {
                if (destinationPath == null)
                {
                    destinationPath = PendingImagesPath;
                }
                if (action == HelperAction.Copy)
                {
                    File.Copy(filePath.ToUri().LocalPath, Path.Combine(destinationPath,
                                                                       filePath.GetFileName()));
                }
                else
                {
                    File.Move(filePath, Path.Combine(destinationPath,
                                                     newFileName == "" ? filePath.GetFileName() : newFileName));
                }

                return(true);
            }
            catch (Exception ex)
            {
                LoggingHelper.Save(ex);
                return(false);
            }
        }
Beispiel #3
0
    IEnumerator DisableHelperTimed(float time, HelperAction action)
    {
        helpers[(int)action].helper.GetComponent <Animator>().SetTrigger("Exit");
        yield return(new WaitForSeconds(time));

        actionsToComplete.Remove(action);
        helpers[(int)action].parent = null;
    }
Beispiel #4
0
 public void EnableHelper(HelperAction action, Vector3 anchor, Transform parent)
 {
     if (helpers[(int)action].parent != parent)
     {
         actionsToComplete.Add(action);
         helpers[(int)action].helper.GetComponent <Animator>().SetTrigger("Enter");
         helpers[(int)action].helper.transform.position = anchor;
         helpers[(int)action].parent       = parent;
         helpers[(int)action].parentOffset = helpers[(int)action].helper.transform.position - parent.transform.position;
     }
 }
Beispiel #5
0
 public void DisableHelper(HelperAction action)
 {
     helpers[(int)action].helper.GetComponent <Animator>().SetTrigger("Exit");
     actionsToComplete.Remove(action);
     helpers[(int)action].parent = null;
 }
Beispiel #6
0
 public void DisableHelper(float time, HelperAction action)
 {
     StartCoroutine(DisableHelperTimed(time, action));
 }