时间紧张,先记一笔,后续优化与完善。
一、简介
GhostDoc是Visual Studio的一个收费插件,可为以开发人员动自成生XML格式的注释文档。
二、下载
须要的友人可以去这里下载,填个Email地址就能够下了:GhostDoc下载地址
三、装安
下载装安完成后,可以在Visual Studio的工具菜单下找到GhostDoc的身影。
三、用使
在用使的时候,主要是停止置设,置设好了用调快捷键就能够了。
面下附上,注释的原始文件。
文件注释:
<#@ template language="C#" #>
// ***********************************************************************
// Assembly : <#= Context.AssemblyName #>
// Author : <#= Context.GetGlobalProperty("UserName") #>
// Created : <#= Context.DestinationFileCreationDateTime.ToString("MM-dd-yyyy") #>
//
// Last Modified By : <#= Context.GetGlobalProperty("UserName") #>
// Last Modified On : <#= Context.DestinationFileModificationDateTime.ToString("MM-dd-yyyy") #>
// ***********************************************************************
// <copyright file="<#= System.IO.Path.GetFileName(Context.DestinationFile) #>" company="<#= Context.GetGlobalProperty("CompanyName") #>">
// Copyright (c) <#= Context.GetGlobalProperty("CompanyName") #>. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
类注释:
<#@ template language="C#" #>
<# CodeElement codeElement = Context.CurrentCodeElement; #>
/// <summary>
///<# GenerateSummaryText(); #>
/// </summary>
<# if(codeElement.HasTypeParameters)
{
for(int i = 0; i < codeElement.TypeParameters.Length; i++)
{
TypeParameter typeParameter = codeElement.TypeParameters[i];
#>
/// <typeparam name="<#= typeParameter.Name #>"><# GenerateTypeParamText(typeParameter, i); #></typeparam>
<# }
}
#>
<#= Context.GetNonGeneratedTags() #>
<# GenerateRemarksText(); #>
<#+
private void GenerateSummaryText()
{
if(Context.HasExistingTagText("summary"))
{
this.WriteLine(Context.GetExistingTagText("summary"));
}
else
{
this.WriteLine("Class " + Context.CurrentCodeElement.Name + Context.ExecMacro("$(End)"));
}
}
private void GenerateTypeParamText(TypeParameter typeParameter, int index)
{
if(Context.HasExistingTagText("typeparam", index))
{
this.Write(Context.GetExistingTagText("typeparam", index));
}
else
{
string typeParameterName = typeParameter.Name;
if(typeParameterName != null)
{
if(typeParameterName.Length == 1)
{
this.Write("");
}
else
{
this.Write("The type of " + Context.ExecMacro(typeParameterName, "$(TheAndAll)") + ".");
}
}
}
}
private void GenerateRemarksText()
{
if(Context.HasExistingTagText("remarks"))
{ #>
/// <remarks><#= Context.GetExistingTagText("remarks") #></remarks>
<#+ }
else if (!string.IsNullOrEmpty(Context.GetGlobalProperty("DefaultBlankRemarksText")))
{
// Should you require a default comment, set it in
// Options -> Global Properties -> DefaultBlankRemarksText
#>
/// <remarks><#= Context.GetGlobalProperty("DefaultBlankRemarksText") #></remarks>
<#+ }
}
#>
时间好比一条小溪,它能招引我们奔向生活的海洋;时间如同一叶扁舟,它将帮助我们驶向理想的彼岸;时间犹如一支画笔,它会指点我们描绘人生的画卷。
接口注释
<#@ template language="C#" #>
<# CodeElement codeElement = Context.CurrentCodeElement; #>
/// <summary>
///<# GenerateSummaryText(); #>
/// </summary>
<# if(codeElement.HasTypeParameters)
{
for(int i = 0; i < codeElement.TypeParameters.Length; i++)
{
TypeParameter typeParameter = codeElement.TypeParameters[i];
#>
/// <typeparam name="<#= typeParameter.Name #>"><# GenerateTypeParamText(typeParameter, i); #></typeparam>
<# }
}
#>
<#= Context.GetNonGeneratedTags() #>
<# GenerateRemarksText(); #>
<#+
private void GenerateSummaryText()
{
if(Context.HasExistingTagText("summary"))
{
this.WriteLine(Context.GetExistingTagText("summary"));
}
else
{
this.WriteLine("Interface " + Context.CurrentCodeElement.Name + Context.ExecMacro("$(End)"));
}
}
private void GenerateTypeParamText(TypeParameter typeParameter, int index)
{
if(Context.HasExistingTagText("typeparam", index))
{
this.Write(Context.GetExistingTagText("typeparam", index));
}
else
{
string typeParameterName = typeParameter.Name;
if(typeParameterName != null)
{
if(typeParameterName.Length == 1)
{
this.Write("");
}
else
{
this.Write("The type of " + Context.ExecMacro(typeParameterName, "$(TheAndAll)") + ".");
}
}
}
}
private void GenerateRemarksText()
{
if(Context.HasExistingTagText("remarks"))
{ #>
/// <remarks><#= Context.GetExistingTagText("remarks") #></remarks>
<#+ }
else if (!string.IsNullOrEmpty(Context.GetGlobalProperty("DefaultBlankRemarksText")))
{
// Should you require a default comment, set it in
// Options -> Global Properties -> DefaultBlankRemarksText
#>
/// <remarks><#= Context.GetGlobalProperty("DefaultBlankRemarksText") #></remarks>
<#+ }
}
#>
文章结束给大家分享下程序员的一些笑话语录: 打赌
飞机上,一位工程师和一位程序员坐在一起。程序员问工程师是否乐意和他一起玩一种有趣的游戏。工程师想睡觉,于是他很有礼貌地拒绝了,转身要睡觉。程序员坚持要玩并解释说这是一个非常有趣的游戏:"我问你一个问题,如果你不知道答案,我付你5美元。然后你问我一个问题,如果我答不上来,我付你5美元。"然而,工程师又很有礼貌地拒绝了,又要去睡觉。 程序员这时有些着急了,他说:"好吧,如果你不知道答案,你付5美元;如果我不知道答案,我付50美元。"果然,这的确起了作用,工程师答应了。程序员就问:"从地球到月球有多远?"工程师一句话也没有说,给了程序员5美元。 现在轮到工程师了,他问程序员:"什么上山时有三条腿,下山却有四条腿?"程序员很吃惊地看着工程师,拿出他的便携式电脑,查找里面的资料,过了半个小时,他叫醒工程师并给了工程师50美元。工程师很礼貌地接过钱又要去睡觉。程序员有些恼怒,问:"那么答案是什么呢?"工程师什么也没有说,掏出钱包,拿出5美元给程序员,转身就去睡觉了。