Ejemplo n.º 1
0
        /// <summary>
        /// Adds the specified app info to the PanelClasConfig collection.  If the
        /// entry already exists, replaces it if replaceIfExists is true
        /// </summary>
        /// <param name="appId">the application id</param>
        /// <param name="appName">user friendly app name</param>
        /// <param name="appDescription">a brief description</param>
        /// <param name="replaceIfExists">set to true if existing entry should be replaced</param>
        /// <returns></returns>
        public PanelClassConfig Add(String appId, String appName, String appDescription, bool replaceIfExists = false)
        {
            var panelClassConfig = Find(appId);

            if (panelClassConfig == null)
            {
                panelClassConfig = new PanelClassConfig();
                PanelClassConfigs.Add(panelClassConfig);
            }
            else if (replaceIfExists)
            {
                PanelClassConfigs.Remove(panelClassConfig);
                panelClassConfig = new PanelClassConfig();
                PanelClassConfigs.Add(panelClassConfig);
            }
            else
            {
                return(panelClassConfig);
            }

            panelClassConfig.AppId          = appId;
            panelClassConfig.AppName        = appName;
            panelClassConfig.AppDescription = appDescription;

            return(panelClassConfig);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the panelClassConfig entry to the collection.   If the
        /// entry already exists, replaces it if replaceIfExists is true
        /// </summary>
        /// <param name="panelClassConfig">the entry to add</param>
        /// <param name="replaceIfExists">set to true if existing entry should be replaced</param>
        public void Add(PanelClassConfig panelClassConfig, bool replaceIfExists = false)
        {
            var existingEntry = Find(panelClassConfig.AppId);

            if (existingEntry == null)
            {
                PanelClassConfigs.Add(panelClassConfig);
            }
            else if (replaceIfExists)
            {
                PanelClassConfigs.Remove(existingEntry);
                PanelClassConfigs.Add(panelClassConfig);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets the specified config name as the default config name
        /// for the app.
        /// </summary>
        /// <param name="configName">name of the config</param>
        /// <returns>true on success</returns>
        public static bool SetDefaultPanelConfig(String configName)
        {
            bool retVal = true;

            if (String.IsNullOrEmpty(configName))
            {
                return(false);
            }

            PanelClassConfig panelClassConfig = null;

            if (_culturePanelClassConfigMapTable.TryGetValue(CultureInfo.DefaultThreadCurrentUICulture.Name, out panelClassConfig) ||
                _culturePanelClassConfigMapTable.TryGetValue(CultureInfo.DefaultThreadCurrentUICulture.TwoLetterISOLanguageName, out panelClassConfig) ||
                _culturePanelClassConfigMapTable.TryGetValue(DefaultCulture, out panelClassConfig))
            {
                retVal = panelClassConfig.SetDefaultClassConfigMap(configName);
            }

            return(retVal);
        }