/// <summary> /// Gets the Documentation as Text /// </summary> /// <param name="type">Type of the documentation</param> /// <returns>Formated documentation</returns> public string GetDocumentation(DocumentationType type, int maxLength) { if (type == DocumentationType.Description) { return(GetDocumentationDescription().GetDocumentation(maxLength)); } else if (type == DocumentationType.Tags) { return(GetTagDocumentationParameters().GetDocumentation(maxLength, true)); } else if (type == DocumentationType.Attributes) { return(GetAttributesDocumentationParameters().GetDocumentation(maxLength, false)); } else if (type == DocumentationType.StatusCodes) { Documentation codes = GetDocumentationStatusCodes(); Documentation prolog = this.GetStatusCodeProlog(codes.Title, codes.SubTitle); Documentation modes = this.GetStatusModes(codes.Title, codes.SubTitle); codes.Title = string.Empty; codes.SubTitle = string.Empty; prolog.Title = string.Empty; modes.Title = string.Empty; modes.SubTitle = string.Empty; string part1 = prolog.GetDocumentation(maxLength, false); string part2 = codes.GetDocumentation(maxLength, false); string part3 = modes.GetDocumentation(maxLength, false); return(part1 + Documentation.NL + part2 + Documentation.NL + part3); } else { return(""); } }
public static void WriteDoc(DocumentationType type, int id) { var name = type.GetName(); WriteHeader($"{id}. {name}", 1, id); typeof(ObjectWriter).GetMethod($"Write{name}").Invoke(null, null); }
public ActionResult DeleteConfirmed(int id) { DocumentationType documentationType = db.DocumentationTypes.Find(id); db.DocumentationTypes.Remove(documentationType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] DocumentationType documentationType) { if (ModelState.IsValid) { db.Entry(documentationType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(documentationType)); }
public ActionResult Create([Bind(Include = "Id,Name")] DocumentationType documentationType) { if (ModelState.IsValid) { db.DocumentationTypes.Add(documentationType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(documentationType)); }
// GET: DocumentationTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DocumentationType documentationType = db.DocumentationTypes.Find(id); if (documentationType == null) { return(HttpNotFound()); } return(View(documentationType)); }
static DocumentationType[] getTypes(string input) { var strings = input.Split(','); var types = new DocumentationType[strings.Length]; for (int i = 0; i < types.Length; i++) { types[i] = (DocumentationType)Enum.Parse(typeof(DocumentationType), strings[i].Trim(), true); } if (types.Contains(DocumentationType.ALL)) { types = new DocumentationType[] { DocumentationType.ACTORS, DocumentationType.PARTICLES, DocumentationType.WEAPONS, DocumentationType.WALLS, DocumentationType.TERRAIN, DocumentationType.MAPS, DocumentationType.SPELLS, DocumentationType.SOUNDS } } ; return(types); } }
public static XElement BuildDocumentation(DocumentationType documentation) { PageDocument.StatusColor color; switch (documentation) { case DocumentationType.Full: color = PageDocument.StatusColor.Green; break; case DocumentationType.Partial: color = PageDocument.StatusColor.Yellow; break; default: color = PageDocument.StatusColor.Grey; break; } return PageDocument.BuildStatus(documentation.ToString(), color, true); }
public static XElement BuildDocumentation(DocumentationType documentation) { PageDocument.StatusColor color; switch (documentation) { case DocumentationType.Full: color = PageDocument.StatusColor.Green; break; case DocumentationType.Partial: color = PageDocument.StatusColor.Yellow; break; default: color = PageDocument.StatusColor.Grey; break; } return(PageDocument.BuildStatus(documentation.ToString(), color, true)); }
public static string GetName(this DocumentationType type) { var name = type.ToString(); return(name.Substring(0, 1) + name[1..].ToLower());
/// <summary> /// Returns the passed documentation type for this member or null if it is not defined. /// </summary> /// <param name="documentationType">The documentation type.</param> /// <param name="documentationCollection">A documentation collection to resolve see-tags.</param> /// <returns>The documentation as string or null if not found.</returns> public string Get(DocumentationType documentationType, DocumentationCollection documentationCollection) { if (!contentByType.TryGetValue(documentationType.ToString().ToLower(), out var doc)) { return(null); } if (documentationCollection == null) { return(doc); } var referenced = new Dictionary <string, string>(); string Resolve(Func <string> getContent, Action <string> setContent) { var value = getContent(); var found = new List <string>(); while (true) { var match = RegexSeeCref.Match(value); if (!match.Success) { break; } var referencedId = match.Groups["id"].Value; if (!referenced.TryGetValue(referencedId, out var referencedDoc)) { referencedDoc = documentationCollection.ForName(referencedId)?.Get(DocumentationType.Summary, null) ?? string.Empty; referenced[referencedId] = referencedDoc; found.Add(referencedId); } value = value.Replace(match.Value, $"Reference({referencedId})"); } setContent(value); foreach (var item in found) { Resolve(() => referenced[item], content => referenced[item] = content); } return(value); } var sb = new StringBuilder(); sb.Append(Resolve(() => doc, content => { })); foreach (var reference in referenced) { sb.AppendLine(); sb.AppendLine(); sb.AppendLine($"START Reference({reference.Key})"); sb.AppendLine($"{reference.Value}"); sb.AppendLine($"END Reference({reference.Key})"); } return(sb.ToString()); }
public BursaDocumentationAttribute(DocumentationType doc_type, string text) { DocumentationType = doc_type; Text = text; }