コード例 #1
0
ファイル: TemplateEditor.cs プロジェクト: ErrorMee/Mobius
        string BuildContent(OutputParam outputParam)
        {
            var contents = new StringBuilder(template.Format);

            contents = contents.Replace(template.NamespaceParam.Key, template.NamespaceParam.Value);
            contents = contents.Replace(TemplateKey.Class, outputParam.ClassName);
            contents = contents.Replace(template.SuperClassNameParam.Key, template.SuperClassNameParam.Value);

            foreach (var param in template.ParamList.Where(param => param.IsValid()))
            {
                contents = contents.Replace(param.Key, param.Value);
            }

            return(contents.ToString());
        }
コード例 #2
0
ファイル: TemplateEditor.cs プロジェクト: ErrorMee/Mobius
 string BuildFilePath(OutputParam outputParam)
 {
     return($"{template.OutputPath}/{outputParam.FileName}.cs");
 }