/// <summary> /// Returns a list of DocItem items of a certain type /// </summary> public List <DocItem> GetByType(DocItemType ItemType) { List <DocItem> Result = new List <DocItem>(); if (Items != null) { Result.AddRange(Items.Where(item => item.ItemType == ItemType)); } return(Result); }
internal DocItem(DocItemType itemType, Type declaringType, string name, string fullname, string definition, string copyString = "", string documentation = "", string example = "", string richTextDefinition = null, string preview = null, string richTextPreview = null) { ItemType = itemType; Name = name; FullName = fullname; DeclaringType = declaringType; DefinitionString = definition; CopyString = copyString; DocumentationString = documentation; Example = example; RichTextDefinitionString = richTextDefinition ?? definition; PreviewString = preview ?? DefinitionString; RichTextPreviewString = richTextPreview ?? preview ?? RichTextDefinitionString ?? DocumentationString; }
/// <summary> /// Returns a list of items, scanning the internal flat list of items, of a specified type /// </summary> public List <DocItem> GetAll(DocItemType ItemType) { List <DocItem> Result = new List <DocItem>(); foreach (var Item in this.FlatList) { if (Item.ItemType == ItemType) { Result.Add(Item); } } return(Result); }
/* construction */ /// <summary> /// Constructor /// </summary> internal DocItem(Parser Parser, DocLet DocLet, DocItemType ItemType) { this.Parser = Parser; this.DocLet = DocLet; this.ItemType = ItemType; if (DocLet != null) { this.FilePath = DocLet.FilePath; this.FirstLineIndex = DocLet.FirstLineIndex; this.LastLineIndex = DocLet.LastLineIndex; Parse(); ParseAfter(); } this.DocLet = null; }
internal DocItem(DocItemType itemType) : this(itemType, null, "", "", "") { }
/// <summary> /// True if an item is a top item, i.e. namespace, class, enum or interface /// </summary> public bool IsTopItem(DocItemType ItemType) { bool Result = ItemType == DocItemType.Namespace || ItemType == DocItemType.Class || ItemType == DocItemType.Enum || ItemType == DocItemType.Interface; return(Result); }