Add utility to editor CodeDocs for tooltips from C# types and members

This commit is contained in:
Wojciech Figat
2022-03-22 18:10:47 +01:00
parent 832a4bf86a
commit 891d65dc87

View File

@@ -27,6 +27,17 @@ namespace FlaxEditor.Modules.SourceCodeEditing
{
}
/// <summary>
/// Gets the tooltip text for the type.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="attributes">The type attributes. Optional, if null type attributes will be used.</param>
/// <returns>The documentation tooltip.</returns>
public string GetTooltip(Type type, object[] attributes = null)
{
return GetTooltip(new ScriptType(type), attributes);
}
/// <summary>
/// Gets the tooltip text for the type.
/// </summary>
@@ -62,6 +73,19 @@ namespace FlaxEditor.Modules.SourceCodeEditing
return text;
}
/// <summary>
/// Gets the tooltip text for the type member.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="memberName">The member name.</param>
/// <param name="attributes">The member attributes. Optional, if null member attributes will be used.</param>
/// <returns>The documentation tooltip.</returns>
public string GetTooltip(Type type, string memberName, object[] attributes = null)
{
var member = new ScriptType(type).GetMember(memberName, MemberTypes.All, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
return GetTooltip(member, attributes);
}
/// <summary>
/// Gets the tooltip text for the type member.
/// </summary>