// 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?}"); }); }
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); } }
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; }
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; } }
public void DisableHelper(HelperAction action) { helpers[(int)action].helper.GetComponent <Animator>().SetTrigger("Exit"); actionsToComplete.Remove(action); helpers[(int)action].parent = null; }
public void DisableHelper(float time, HelperAction action) { StartCoroutine(DisableHelperTimed(time, action)); }