string RenderPropertyAccessors(DocBase member) { if (!(member is ClientPropertyDoc)) { return(""); } var clientPropertyDoc = (ClientPropertyDoc)member; var propertyAccessorsStringBuilder = new StringBuilder(); if (!String.IsNullOrWhiteSpace(clientPropertyDoc.GetterName)) { propertyAccessorsStringBuilder.Append( _renderer.RenderNewParagraph() + _renderer.RenderText("Getter name:", italic: true) + " " + _renderer.RenderText(clientPropertyDoc.GetterName + "()")); } if (!String.IsNullOrWhiteSpace(clientPropertyDoc.SetterName)) { propertyAccessorsStringBuilder.Append( _renderer.RenderLineBreak() + _renderer.RenderText("Setter name:", italic: true) + " " + _renderer.RenderText(clientPropertyDoc.SetterName + "(value)")); } return(propertyAccessorsStringBuilder.ToString()); }
private string BuildMethodSignature(DocBase docBase) { if(!(docBase is MethodDoc)) return docBase.Name; var methodDoc = (MethodDoc)docBase; var methodNameWithSignature = methodDoc.Name + "("; if(methodDoc.Params.Count() > 0) { foreach(var param in methodDoc.Params) methodNameWithSignature += param.Name + ", "; methodNameWithSignature = methodNameWithSignature.Substring(0, methodNameWithSignature.Length - 2); } methodNameWithSignature += ")"; return methodNameWithSignature; }
string RenderEventMethods(DocBase member) { if (!(member is ClientEventDoc)) { return(""); } var eventDoc = (ClientEventDoc)member; var eventMethodsStringBuilder = new StringBuilder(); eventMethodsStringBuilder.Append(_renderer.RenderNewParagraph() + _renderer.RenderText("Add event handler method:", italic: true) + " " + _renderer.RenderText(eventDoc.AddMethodName + "(handler)")); eventMethodsStringBuilder.Append(_renderer.RenderLineBreak() + _renderer.RenderText("Remove event handler method:", italic: true) + " " + _renderer.RenderText(eventDoc.RemoveMethodName + "(handler)")); if (!String.IsNullOrWhiteSpace(eventDoc.RaiseMethodName)) { eventMethodsStringBuilder.Append(_renderer.RenderLineBreak() + _renderer.RenderText("Raise event method:", italic: true) + " " + _renderer.RenderText(eventDoc.RaiseMethodName + "()")); } eventMethodsStringBuilder.Append(_renderer.RenderNewParagraph()); return(eventMethodsStringBuilder.ToString()); }
private string BuildMethodSignature(DocBase docBase) { if (!(docBase is MethodDoc)) { return(docBase.Name); } var methodDoc = (MethodDoc)docBase; var methodNameWithSignature = methodDoc.Name + "("; if (methodDoc.Params.Count() > 0) { foreach (var param in methodDoc.Params) { methodNameWithSignature += param.Name + ", "; } methodNameWithSignature = methodNameWithSignature.Substring(0, methodNameWithSignature.Length - 2); } methodNameWithSignature += ")"; return(methodNameWithSignature); }
string RenderMethodParams(DocBase member) { if (!(member is MethodDoc)) { return(""); } var methodDoc = (MethodDoc)member; var paramsStringBuilder = new StringBuilder(); if (methodDoc.Params.Count() > 0) { paramsStringBuilder.Append(_renderer.RenderNewParagraph()); paramsStringBuilder.Append(_renderer.RenderText("Params:", italic: true)); foreach (var item in FormatMethodParams(methodDoc)) { paramsStringBuilder.Append(_renderer.RenderNewParagraph() + item); } } return(paramsStringBuilder.ToString()); }
string RenderPropertyAccessors(DocBase member) { if(!(member is ClientPropertyDoc)) return ""; var clientPropertyDoc = (ClientPropertyDoc)member; var propertyAccessorsStringBuilder = new StringBuilder(); if(!String.IsNullOrWhiteSpace(clientPropertyDoc.GetterName)) propertyAccessorsStringBuilder.Append( _renderer.RenderNewParagraph() + _renderer.RenderText("Getter name:", italic: true) + " " + _renderer.RenderText(clientPropertyDoc.GetterName + "()")); if(!String.IsNullOrWhiteSpace(clientPropertyDoc.SetterName)) propertyAccessorsStringBuilder.Append( _renderer.RenderLineBreak() + _renderer.RenderText("Setter name:", italic: true) + " " + _renderer.RenderText(clientPropertyDoc.SetterName + "(value)")); return propertyAccessorsStringBuilder.ToString(); }
string RenderMethodParams(DocBase member) { if(!(member is MethodDoc)) return ""; var methodDoc = (MethodDoc)member; var paramsStringBuilder = new StringBuilder(); if(methodDoc.Params.Count() > 0) { paramsStringBuilder.Append(_renderer.RenderNewParagraph()); paramsStringBuilder.Append(_renderer.RenderText("Params:", italic: true)); foreach(var item in FormatMethodParams(methodDoc)) paramsStringBuilder.Append(_renderer.RenderNewParagraph() + item); } return paramsStringBuilder.ToString(); }
string RenderEventMethods(DocBase member) { if(!(member is ClientEventDoc)) return ""; var eventDoc = (ClientEventDoc)member; var eventMethodsStringBuilder = new StringBuilder(); eventMethodsStringBuilder.Append(_renderer.RenderNewParagraph() + _renderer.RenderText("Add event handler method:", italic: true) + " " + _renderer.RenderText(eventDoc.AddMethodName + "(handler)")); eventMethodsStringBuilder.Append(_renderer.RenderLineBreak() + _renderer.RenderText("Remove event handler method:", italic: true) + " " + _renderer.RenderText(eventDoc.RemoveMethodName + "(handler)")); if(!String.IsNullOrWhiteSpace(eventDoc.RaiseMethodName)) eventMethodsStringBuilder.Append(_renderer.RenderLineBreak() + _renderer.RenderText("Raise event method:", italic: true) + " " + _renderer.RenderText(eventDoc.RaiseMethodName + "()")); eventMethodsStringBuilder.Append(_renderer.RenderNewParagraph()); return eventMethodsStringBuilder.ToString(); }