// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // 注册菜单 MenuRegister.Register(); //注入自己的HttpContext //services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); //services.AddMvc().AddSessionStateTempDataProvider(); //添加Configuration到静态变量 Utils.AddUtils(Configuration); services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. //options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.AddMyHttpContextAccessor(); services.AddDistributedMemoryCache(); //添加Session 服务 services.AddSession(options => { options.IdleTimeout = TimeSpan.FromSeconds(120); options.Cookie.HttpOnly = true; }); //部分系统配置 services.Configure <SystemSetting>(Configuration.GetSection("SystemSetting")); services .AddMvc() .SetCompatibilityVersion(CompatibilityVersion.Version_2_1) .AddJsonOptions(JsonOptionsConfig.ConfigJsonOptions); //防止汉字被自动编码 services.Configure <WebEncoderOptions>(options => { options.TextEncoderSettings = new TextEncoderSettings(UnicodeRanges.All); }); //记录错误 services.AddMvc(options => { options.Filters.Add <HttpGlobalExceptionFilter>(); }); services.AddSenparcGlobalServices(Configuration) //Senparc.CO2NET 全局注册 .AddSenparcWeixinServices(Configuration); //Senparc.Weixin 注册(如果使用Senparc.Weixin SDK则添加) //注册Cookie认证服务 services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(); // 设置表单内容限制 services.Configure <FormOptions>(formOptions => { formOptions.ValueLengthLimit = int.MaxValue; // 表单内容大小限制,默认4194304,单位byte formOptions.MultipartBodyLengthLimit = int.MaxValue; // 如果是multipart,默认134217728 }); }
public MyMenu(UserContext userContext, FormRegister formRegister, MenuRegister menuRegister, SystemPermissionManager permissionManager) { this.userContext = userContext; this.formRegister = formRegister; this.menuRegister = menuRegister; this.permissionManager = permissionManager; }
public MyForms( DependencyInjectionContainer container, UserContext userContext, FormRegister formRegister, MenuRegister menuRegister, SystemPermissionManager permissionManager) { this.container = container; this.userContext = userContext; this.formRegister = formRegister; this.menuRegister = menuRegister; this.permissionManager = permissionManager; }
/// <summary> /// /// </summary> /// <param name="app"></param> /// <param name="folderPath"></param> /// <returns></returns> public static IApplicationBuilder WeeRegisterPackages(this IApplicationBuilder app, string folderPath = "") { if (string.IsNullOrWhiteSpace(folderPath)) { folderPath = PlatformServices.Default.Application.ApplicationBasePath; } var instance = new StaticFilesRegister(app, folderPath); instance.Invoke <IWeePackage>(); var menuInstance = new MenuRegister(app, folderPath); menuInstance.Invoke <Controller>(); return(app); }
void ReleaseDesignerOutlets() { if (ActionBar != null) { ActionBar.Dispose(); ActionBar = null; } if (AddressOK != null) { AddressOK.Dispose(); AddressOK = null; } if (BottomConstraint != null) { BottomConstraint.Dispose(); BottomConstraint = null; } if (BottomSeparator != null) { BottomSeparator.Dispose(); BottomSeparator = null; } if (DistanceFilters != null) { DistanceFilters.Dispose(); DistanceFilters = null; } if (DistanceFiltersOpenClose != null) { DistanceFiltersOpenClose.Dispose(); DistanceFiltersOpenClose = null; } if (DistanceLimit != null) { DistanceLimit.Dispose(); DistanceLimit = null; } if (DistanceLimitInput != null) { DistanceLimitInput.Dispose(); DistanceLimitInput = null; } if (DistanceSourceAddress != null) { DistanceSourceAddress.Dispose(); DistanceSourceAddress = null; } if (DistanceSourceAddressLabel != null) { DistanceSourceAddressLabel.Dispose(); DistanceSourceAddressLabel = null; } if (DistanceSourceAddressText != null) { DistanceSourceAddressText.Dispose(); DistanceSourceAddressText = null; } if (DistanceSourceCurrent != null) { DistanceSourceCurrent.Dispose(); DistanceSourceCurrent = null; } if (DistanceSourceCurrentLabel != null) { DistanceSourceCurrentLabel.Dispose(); DistanceSourceCurrentLabel = null; } if (DistanceUnitText != null) { DistanceUnitText.Dispose(); DistanceUnitText = null; } if (FilterLayout != null) { FilterLayout.Dispose(); FilterLayout = null; } if (ListType != null) { ListType.Dispose(); ListType = null; } if (ListView != null) { ListView.Dispose(); ListView = null; } if (ListViewMap != null) { ListViewMap.Dispose(); ListViewMap = null; } if (LoaderCircle != null) { LoaderCircle.Dispose(); LoaderCircle = null; } if (LoaderCircleLeftConstraint != null) { LoaderCircleLeftConstraint.Dispose(); LoaderCircleLeftConstraint = null; } if (LoadNext != null) { LoadNext.Dispose(); LoadNext = null; } if (LoadPrevious != null) { LoadPrevious.Dispose(); LoadPrevious = null; } if (MapSatellite != null) { MapSatellite.Dispose(); MapSatellite = null; } if (MapStreet != null) { MapStreet.Dispose(); MapStreet = null; } if (MapView != null) { MapView.Dispose(); MapView = null; } if (MenuAbout != null) { MenuAbout.Dispose(); MenuAbout = null; } if (MenuChatList != null) { MenuChatList.Dispose(); MenuChatList = null; } if (MenuChatListBg != null) { MenuChatListBg.Dispose(); MenuChatListBg = null; } if (MenuChatListBgCorner != null) { MenuChatListBgCorner.Dispose(); MenuChatListBgCorner = null; } if (MenuContainer != null) { MenuContainer.Dispose(); MenuContainer = null; } if (MenuHelpCenter != null) { MenuHelpCenter.Dispose(); MenuHelpCenter = null; } if (MenuIcon != null) { MenuIcon.Dispose(); MenuIcon = null; } if (MenuLayer != null) { MenuLayer.Dispose(); MenuLayer = null; } if (MenuLocation != null) { MenuLocation.Dispose(); MenuLocation = null; } if (MenuLogIn != null) { MenuLogIn.Dispose(); MenuLogIn = null; } if (MenuLogOut != null) { MenuLogOut.Dispose(); MenuLogOut = null; } if (MenuRegister != null) { MenuRegister.Dispose(); MenuRegister = null; } if (MenuSettings != null) { MenuSettings.Dispose(); MenuSettings = null; } if (NoResult != null) { NoResult.Dispose(); NoResult = null; } if (OpenFilters != null) { OpenFilters.Dispose(); OpenFilters = null; } if (OpenSearch != null) { OpenSearch.Dispose(); OpenSearch = null; } if (OrderBy != null) { OrderBy.Dispose(); OrderBy = null; } if (RefreshDistance != null) { RefreshDistance.Dispose(); RefreshDistance = null; } if (ResultSet != null) { ResultSet.Dispose(); ResultSet = null; } if (RippleMain != null) { RippleMain.Dispose(); RippleMain = null; } if (RippleRefreshDistance != null) { RippleRefreshDistance.Dispose(); RippleRefreshDistance = null; } if (RoundBottom != null) { RoundBottom.Dispose(); RoundBottom = null; } if (SearchIn != null) { SearchIn.Dispose(); SearchIn = null; } if (SearchLayout != null) { SearchLayout.Dispose(); SearchLayout = null; } if (SearchTerm != null) { SearchTerm.Dispose(); SearchTerm = null; } if (Snackbar != null) { Snackbar.Dispose(); Snackbar = null; } if (SnackBottomConstraint != null) { SnackBottomConstraint.Dispose(); SnackBottomConstraint = null; } if (SnackTopConstraint != null) { SnackTopConstraint.Dispose(); SnackTopConstraint = null; } if (SortBy_LastActiveDate != null) { SortBy_LastActiveDate.Dispose(); SortBy_LastActiveDate = null; } if (SortBy_RegisterDate != null) { SortBy_RegisterDate.Dispose(); SortBy_RegisterDate = null; } if (SortBy_ResponseRate != null) { SortBy_ResponseRate.Dispose(); SortBy_ResponseRate = null; } if (SortByCaption != null) { SortByCaption.Dispose(); SortByCaption = null; } if (StatusBar != null) { StatusBar.Dispose(); StatusBar = null; } if (StatusImage != null) { StatusImage.Dispose(); StatusImage = null; } if (StatusText != null) { StatusText.Dispose(); StatusText = null; } if (UseGeoContainer != null) { UseGeoContainer.Dispose(); UseGeoContainer = null; } if (UseGeoNo != null) { UseGeoNo.Dispose(); UseGeoNo = null; } if (UseGeoNoLabel != null) { UseGeoNoLabel.Dispose(); UseGeoNoLabel = null; } if (UseGeoYes != null) { UseGeoYes.Dispose(); UseGeoYes = null; } if (UseGeoYesLabel != null) { UseGeoYesLabel.Dispose(); UseGeoYesLabel = null; } if (UserSearchList != null) { UserSearchList.Dispose(); UserSearchList = null; } }