예제 #1
0
        internal static string GetBlockConfigFilePath(BlockConfigKey key)
        {
            if (!IsCustomizing && key.Type == BlockConfigType.Customization) { throw new InvalidProgramException("当前不在客户化状态中,无法找到客户化文件:" + key.GetDescription()); }

            var sb = new StringBuilder();
            if (key.IsDefaultView())
            {
                sb.Append("MetaModel/Block/Default/");
                sb.Append(key.EntityType.FullName);
            }
            else
            {
                sb.Append("MetaModel/Block/Extend/");
                sb.Append(key.EntityType.FullName);
                sb.Append(" ");
                sb.Append(key.ExtendView);
            }

            sb.Append(".xml");

            var versionPath = sb.ToString();

            //暂时只支持一个主干版本和一个客户化版本:common, customer
            var pathes = RafyEnvironment.BranchProvider.MapAllPathes(versionPath, true);

            if (key.Type == BlockConfigType.Customization) { return pathes[1]; }

            return pathes[0];
        }
예제 #2
0
        internal static string GetBlockConfigFilePath(BlockConfigKey key)
        {
            if (!IsCustomizing && key.Type == BlockConfigType.Customization)
            {
                throw new InvalidProgramException("当前不在客户化状态中,无法找到客户化文件:" + key.GetDescription());
            }

            var sb = new StringBuilder();

            if (key.IsDefaultView())
            {
                sb.Append("MetaModel/Block/Default/");
                sb.Append(key.EntityType.FullName);
            }
            else
            {
                sb.Append("MetaModel/Block/Extend/");
                sb.Append(key.EntityType.FullName);
                sb.Append(" ");
                sb.Append(key.ExtendView);
            }

            sb.Append(".xml");

            var versionPath = sb.ToString();

            //暂时只支持一个主干版本和一个客户化版本:common, customer
            var pathes = RafyEnvironment.BranchProvider.MapAllPathes(versionPath, true);

            if (key.Type == BlockConfigType.Customization)
            {
                return(pathes[1]);
            }

            return(pathes[0]);
        }