public EditorDescription Help(string[] arguments) { if (arguments.Length > 1) { ClipEditor = (from e in Editors where e.EditorName.Equals(arguments[1], StringComparison.CurrentCultureIgnoreCase) select e).FirstOrDefault(); if (ClipEditor == null) { EditorDescription foundEditors = new EditorDescription(); foreach (IClipEditor ci in (from e in Editors where e.EditorName.ToLower().Contains(arguments[1].ToLower()) || arguments[1].ToLower().Contains(e.EditorName.ToLower()) || e.LongDescription.Contains(arguments[1].ToLower()) select e)) { foundEditors.Append(EditorDescription.Category.Emphasized, ci.EditorName); foundEditors.AppendLine(EditorDescription.Category.PlainText, String.Concat(" - ", ci.ShortDescription)); } return(foundEditors); } return(ClipEditor.LongDescription); } var allEditors = new EditorDescription(); allEditors.AppendLine(EditorDescription.Category.Warning, Disclaimer); foreach (IClipEditor ce in Editors) { allEditors.Append(EditorDescription.Category.Emphasized, ce.EditorName); allEditors.AppendLine(EditorDescription.Category.PlainText, String.Concat(" - ", ce.ShortDescription)); } allEditors.AppendLine("---------------------"); allEditors.AppendLine("User Defined"); allEditors.AppendLine("---------------------"); UserFunctionsList ufl = new UserFunctionsList(); ufl.DescribeFunctions(allEditors); return(allEditors); }
public void DescribeFunctions(EditorDescription output) { foreach (UserFunction udf in this.OrderBy(u => u.Name)) { output.Append(EditorDescription.Category.Emphasized, udf.Name); output.AppendLine(EditorDescription.Category.PlainText, String.Concat( " - ", string.IsNullOrEmpty(udf.Description) ? "No description available" : udf.Description ) ); } }
private void DescribeParameters(EditorDescription d) { var em = EditorDescription.Category.Emphasized; var ww = EditorDescription.Category.Warning; foreach (Parameter p in ParameterList) { d.Append(em, p.ParameterName.Replace(" ", "").Trim()); d.Append(String.Concat(" - ", p.Expecting, ".")); if (!p.Required && p.DefaultValue != null) { d.Append(ww, String.Concat(" Defaults to \"", ClipUnEscape(p.DefaultValue), "\"")); } d.AppendLine(String.Empty); } }