コード例 #1
0
		private static void AddCommentsTo(CodeElement codeElement)
		{
			if (CodeElementsThatNeedDocComment.Contains(codeElement.Kind))
			{
				if (string.IsNullOrWhiteSpace(codeElement.GetDocComment()))
				{
					if (codeElement.IsInherited() || codeElement.OverridesSomething())
					{
						codeElement.SetDocComment(@"<DOC><inheritdoc/></DOC>");
					}
					else
					{
						switch (codeElement.Kind)
						{
							case vsCMElement.vsCMElementProperty: AddDocCommentToProperty(codeElement as CodeProperty); break;
							case vsCMElement.vsCMElementFunction: AddDocCommentToFunction(codeElement as CodeFunction); break;
							case vsCMElement.vsCMElementEnum: AddGhostDogCommand(codeElement); break;
							case vsCMElement.vsCMElementStruct: AddGhostDogCommand(codeElement); break;
							case vsCMElement.vsCMElementInterface: AddDocCommentToInterface(codeElement as CodeInterface); break;
							case vsCMElement.vsCMElementEvent: AddGhostDogCommand(codeElement); break;
							case vsCMElement.vsCMElementClass: AddDocCommentToClass(codeElement as CodeClass); break;
							case vsCMElement.vsCMElementVariable: AddGhostDogCommand(codeElement); break;
						}
					}
				}
			}

			if (CodeElementsWithChildren.Contains(codeElement.Kind))
			{
				foreach (CodeElement child in codeElement.Children)
				{
					AddCommentsTo(child);
				}
			}
		}
コード例 #2
0
        private static void AddCommentsTo(CodeElement codeElement)
        {
            if (CodeElementsThatNeedDocComment.Contains(codeElement.Kind))
            {
                if (string.IsNullOrWhiteSpace(codeElement.GetDocComment()))
                {
                    if (codeElement.IsInherited() || codeElement.OverridesSomething())
                    {
                        codeElement.SetDocComment(@"<DOC><inheritdoc/></DOC>");
                    }
                    else
                    {
                        switch (codeElement.Kind)
                        {
                        case vsCMElement.vsCMElementProperty: AddDocCommentToProperty(codeElement as CodeProperty); break;

                        case vsCMElement.vsCMElementFunction: AddDocCommentToFunction(codeElement as CodeFunction); break;

                        case vsCMElement.vsCMElementEnum: AddGhostDogCommand(codeElement); break;

                        case vsCMElement.vsCMElementStruct: AddGhostDogCommand(codeElement); break;

                        case vsCMElement.vsCMElementInterface: AddDocCommentToInterface(codeElement as CodeInterface); break;

                        case vsCMElement.vsCMElementEvent: AddGhostDogCommand(codeElement); break;

                        case vsCMElement.vsCMElementClass: AddDocCommentToClass(codeElement as CodeClass); break;

                        case vsCMElement.vsCMElementVariable: AddGhostDogCommand(codeElement); break;
                        }
                    }
                }
            }

            if (CodeElementsWithChildren.Contains(codeElement.Kind))
            {
                foreach (CodeElement child in codeElement.Children)
                {
                    AddCommentsTo(child);
                }
            }
        }