核心代码在  

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.

 

到此。分析完成。 

 

 

 

 

 

相关文章:

  • 2021-12-31
  • 2021-05-17
  • 2021-07-26
  • 2022-01-14
  • 2022-01-21
  • 2021-11-18
  • 2021-05-27
  • 2022-12-23
猜你喜欢
  • 2021-04-12
  • 2021-05-20
  • 2021-09-10
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案