public static IList <RibbonMenu> GetRibbonMenus(string langCode, bool forceUpdate = false) { if (!RibbonMenus.ContainsKey(langCode)) { RibbonMenus.GetOrAdd(langCode, new List <RibbonMenu>()); } if (!RibbonMenus[langCode].Any() || forceUpdate) { RibbonMenus.AddOrUpdate(langCode, _commands.GetRibbonMenus(langCode)); } return(RibbonMenus[langCode]); }
/// <summary> /// To start English version of it on Application start /// </summary> /// <param name="langCode">1 for EN</param> public static void Initialize(string langCode) { Tables = new Dictionary <EntitiesAlias, TableReference>(); RibbonMenus.GetOrAdd(langCode, new List <RibbonMenu>()); IdRefLangNames.GetOrAdd(langCode, new ConcurrentDictionary <int, IList <IdRefLangName> >()); PageInfos.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <PageInfo> >()); Operations.GetOrAdd(langCode, new ConcurrentDictionary <LookupEnums, IList <Operation> >()); DisplayMessages.GetOrAdd(langCode, new ConcurrentDictionary <string, DisplayMessage>()); ColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ViewModels.ColumnSetting> >()); GridColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ViewModels.ColumnSetting> >()); ValidationRegExpressions.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ValidationRegEx> >()); MasterTables.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, object>()); ConditionalOperators.GetOrAdd(langCode, new List <ConditionalOperator>()); SysSettings.GetOrAdd(langCode, new SysSetting()); BusinessConfiguration.GetOrAdd(langCode, new BusinessConfiguration()); }
/// <summary> /// To start English version of it on Application start /// </summary> /// <param name="langCode">1 for EN</param> public static void Initialize(string langCode) { RibbonMenus.GetOrAdd(langCode, new List <RibbonMenu>()); IdRefLangNames.GetOrAdd(langCode, new ConcurrentDictionary <int, IList <IdRefLangName> >()); PageInfos.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <PageInfo> >()); Operations.GetOrAdd(langCode, new ConcurrentDictionary <LookupEnums, IList <Operation> >()); DisplayMessages.GetOrAdd(langCode, new ConcurrentDictionary <string, DisplayMessage>()); ColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ColumnSetting> >()); GridColumnSettings.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ColumnSetting> >()); ValidationRegExpressions.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, IList <ValidationRegEx> >()); MasterTables.GetOrAdd(langCode, new ConcurrentDictionary <EntitiesAlias, object>()); ConditionalOperators.GetOrAdd(langCode, new List <ConditionalOperator>()); BusinessConfiguration.GetOrAdd(langCode, new BusinessConfiguration()); List <Task> tasks = new List <Task>(); tasks.Add(Task.Factory.StartNew(() => { GetRibbonMenus(langCode); GetTables(); InitializerOperations(langCode); GetSystemSettings(langCode); })); if (tasks.Count > 0) { Task.WaitAll(tasks.ToArray()); } #region Nav Cache Commented Code ////string username = M4PBusinessContext.ComponentSettings.NavAPIUserName; ////string password = M4PBusinessContext.ComponentSettings.NavAPIPassword; ////string serviceURL = M4PBusinessContext.ComponentSettings.NavAPIUrl; ////NAVOrderItemResponse.GetOrAdd(langCode, new NAVOrderItemResponse()); ////DimensionValues.GetOrAdd(langCode, new NavSalesOrderDimensionResponse()); ////GetNavSalesOrderDimensionValues(langCode, username, password, serviceURL); ////CachedNavSalesOrder.GetOrAdd(langCode, new NavSalesOrderPostedInvoiceResponse()); ////GetCachedNavSalesOrderValues(langCode, username, password, serviceURL); ////CachedNavPurchaseOrder.GetOrAdd(langCode, new NavPurchaseOrderPostedInvoiceResponse()); ////GetCachedNavPurchaseOrderValues(langCode, username, password, serviceURL); ////CachedNavSalesLine.GetOrAdd(langCode, new NavSalesOrderItemResponse()); ////GetCachedNavSalesOrderItemValues(langCode, username, password, serviceURL); ////CachedNavPurchaseLine.GetOrAdd(langCode, new NavPurchaseOrderItemResponse()); ////GetCachedNavPurchaseOrderItemValues(langCode, username, password, serviceURL); #endregion Nav Cache Commented Code }