日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex,大家有需要的可以看看...

發布時間:2024/8/23 编程问答 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex,大家有需要的可以看看... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、第一次編譯并調整代碼
二、修正泛型無法生成CodeDOM代碼
后期我會用到這個工具, 如果有需要修改, 會及時修改和改進, 有興趣的可以參與進來。 http://codedomassistant.codeplex.com/


Generating CodeDom Code By Parsing C# or VB
使用C#或者VB生成CodeDom代碼



Introduction

I find writing CodeDom code kind of like writing assembly. It's like cutting the grass with a pair of scissors or unloading a truck load of sand with a spoon. Its long winded, it can be done, but it is tedious. However, there are advantages in using CodeDom.

Now, it would be nice if you could whip up a class in VB or C# and generate the CodeDom code. CodeDom Assistant does this with the help of SharpDevelop's NRefactory Library in conjunction with writing our own CodeDomProvider to generate C# CodeDom code. The code you get will construct a CodeDom compileunit, and it will definitely be ugly. But what can you expect from a machine?

Background

Code Generation can be done using various techniques. In essence, code generation saves time, and enables you to create code using established patterns.

In the world of .NET, one technique is to use CodeDom. It allows you create a document object model of the code. This can by either compiled into an assembly or used to generate code. Every .NET language should have an implementation of a CodeDomProvider to generate code. The problem is that CodeDom does not implement every syntax construct of every language. In essence, it is a subset, but there are enough operations to emulate most language constructs.

Parsing C# or VB is going to be the toughest part, but luckily one of SharpDevelop's little libraries is NRefactory. This has the machinerary required to parse C# or VB code. The key component for us is the CodeDomVisitor class. Sadly, it is only a partial implementation. They implement enough to run SharpDevelop's form generation. I am not saying I have completed the implementation, rather, I have filled most of the holes in the CodeDomVisitor.

The second part is implementing a CodeDomCodeProvider. This will take a CodeDom compile unit and generate C# code that will create a CodeDom compile unit.

License
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

About the old Version? Author

raygilbert
http://www.codeproject.com/Articles/20597/CodeDom-Assistant
http://www.codeplex.com/Download?ProjectName=codedomassistant&DownloadId=381289
http://download.codeplex.com/Download?ProjectName=codedomassistant&DownloadId=381290

About New Version Author
MysticBoy
http://www.mysticboy.cn

?

原文:

CodeDom Assistant CodeDom的強大工具, 有些BUG修正了下,發到CodePlex了
http://www.xjiter.com/forum.php?mod=viewthread&tid=86&fromuid=1

轉載于:https://www.cnblogs.com/Elia/archive/2012/05/21/2511443.html

總結

以上是生活随笔為你收集整理的CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex,大家有需要的可以看看...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。