GhostDoc 源码分析。


核心代码在  

Weigelt.GhostDoc.Addin

Weigelt.DhostDoc.Configufation

 

入口点在:

 command = this.m_dteApplication.Commands.Item("Weigelt.GhostDoc.AddIn.DocumentThis", -1);

绑定了快捷点。绑定位置在:AssignHotkeyDialog。CreateKeyboardBindings

 

这个command的激活位置在: 

AddIn.cs: 

 this.m_objDocumentThisCommandImplementation.Execute(this.m_dteApplication);

private DocumentThisCommandImplementation m_objDocumentThisCommandImplementation; 

 

所以整个关键在:DocumentThisCommandImplementation

 

获取当前代码片段:

CodeElement: element = selection.ActivePoint.get_CodeElement(vsCMElement.vsCMElementFunction);

 

this.DocumentFunction(selection, (CodeFunction) element, unknown);

 

codeFunction.DocComment = DocCommentBuilder.GetDocComment(rule, args); 

 

备注的关键在:

DocCommentBuilder

 

我C 你 nn 个X。终于找到了词法分析的地方了。

 

1. 在 DocumentThisCommandImplementation。DocumentFunction

解析得到:  Label_0085: 得到

                MethodRuleArgs args2 = new MethodRuleArgs(this.m_objConfiguration, typeName, MemberModifiers.None, this.GetFullTypeName(codeFunction.Type), codeFunction.Name, argsArray, existingDocumentationXml, processedDocComment, codeLanguage);

 

关键就是这个args。里面构造函数: 

            this.m_objReturnTypeName = new TypeName(returnTypeName);

            this.m_objMethodName = new Weigelt.GhostDoc.MethodName(configuration, methodName);

            this.m_lstParameters = new ParameterRuleArgsList(configuration, parameters);

 名字解析在:MethodName

 

 this.m_objWords = new MethodNameWords(base.Configuration, base.ActualName);

 

又继承了Word.

 

到此。分析完成。 

 

 

 

 

 

转载于:https://www.cnblogs.com/zc22/archive/2010/04/21/1716763.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值