示例#1
0
        public StackCfg AddFormatCfgs(FmtDict fmtCfgs)
        {
            foreach (var kvp in fmtCfgs)
            {
                FormatCfg f = null;
                if (!FormatDict.TryGetValue(kvp.Key, out f))
                {
                    f = new FormatCfg();
                }
                FormatDict[kvp.Key] = f.MergeOverWith(kvp.Value);
            }

            return(this);
        }
示例#2
0
        public FileCfg GetProtoFileCfg(string fileExtension)
        {
            FormatCfg fmtCfg = FormatCfg.Default();

            fmtCfg = fmtCfg.MergeOverWith(DefaultFormatCfg);

            FormatDict.TryGetValue(fileExtension, out var fromFileExt);
            if (fromFileExt != null)
            {
                fmtCfg = fmtCfg.MergeOverWith(fromFileExt);
            }

            var fileCfg = new FileCfg()
            {
                FormatCfg = fmtCfg
            };

            fileCfg.AddDefines(InitialDefines);
            return(fileCfg);
        }