从字符串创建codeMemberMethod [英] Creating CodeMemberMethod from string

查看:496
本文介绍了从字符串创建codeMemberMethod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想产生一些$ C C使用codeDOM $。我想知道是否有什么办法可以从字符串创建codeMemberMethod。 我发现了一个方法,但它产生的组装,从字符串。我想生成字符串的一些方法。有什么办法?

I am trying to generate some code using CodeDom. I wanted to know if there is any way to create CodeMemberMethod from a string. I found a method, but it generates assembly from string. I wanted to generate some methods from string. Is there any way?

推荐答案

嗯,我找到了答案。希望这可以帮助别人:

Well, I found the answer. Hope it may help someone else:

我们可以使用 codeSnippetStatement 来包括将包括直接在源代码无需修改code片段。

We can use CodeSnippetStatement to include code fragments that will be included directly in source without modification.

除此之外,还有 codeSnippetCompileUnit 将编译code单位的字符串。

In addition to that, there is CodeSnippetCompileUnit that will compile code units from string literal.

这篇关于从字符串创建codeMemberMethod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆