Esempio n. 1
0
        private string GetResourceByTheme(string nodeName, string key)
        {
            try
            {
                string theme   = "DeepBlue";
                string culture = CultureManager.UICulture.Name;
                string path1   = "{0}{1}\\{2}\\{3}\\{4}".FormatString(PathHelper.GetRootPath(), "Addin", nodeName,
                                                                      "Resources\\Images", key);
                if (File.Exists(path1))
                {
                    return(path1);
                }

                string path2 = "{0}{1}\\{2}\\{3}\\{4}\\Images\\{5}".FormatString(PathHelper.GetRootPath(), "Addin", nodeName,
                                                                                 "Resources\\Themes", "DeepBlue", key);
                if (File.Exists(path2))
                {
                    return(path2);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
            return(string.Empty);
        }
Esempio n. 2
0
        private string GetPath(ComponentType ct, string resxName, string cultureName)
        {
            switch (ct)
            {
            case ComponentType.Addin:
            {
                object obj = null;
                if (string.IsNullOrEmpty(resxName))
                {
                    return("");
                }
                var arr = resxName.Split('_');

                string path = "{0}{1}\\{2}\\{3}\\{4}\\{5}\\{6}".FormatString(PathHelper.GetRootPath(), "Addin", arr[0], "Resources\\Themes", "DeepBlue", "Culture", cultureName);
                return(path);

                break;
            }

            case ComponentType.Host:
            {
                object obj = null;
                if (string.IsNullOrEmpty(resxName))
                {
                    return("");
                }

                string path = "{0}{1}\\{2}\\{3}\\{4}".FormatString(PathHelper.GetRootPath(), "Resources\\Themes", "DeepBlue", "Culture", cultureName);
                return(path);

                break;
            }

            case ComponentType.Setup:
            {
                object obj = null;
                if (string.IsNullOrEmpty(resxName))
                {
                    return("");
                }

                string path = "{0}{1}\\{2}\\{3}\\{4}".FormatString(PathHelper.GetRootPath(), "Resources\\Themes", "DeepBlue", "Culture", cultureName);
                return(path);

                break;
            }

            default:
                return("");
            }
        }