CSharp Class

Summary

A variety of methods relating to C# code.
Assembly
Weaver.dll
Namespace
Weaver
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["CSharp"] class Type type-node

Syntax

public static class CSharp

Methods

Name Value Summary
AppendMethodSignature(StringBuilder, Type, Type, string, Type[], Type[], CSharp.NameVerbosity) void
Appends the signature of a method with the specified details as it would appear in C# code.
static
AppendNameAndGenericArguments(StringBuilder, Type, CSharp.NameVerbosity, int) int
Appends the name and generic arguments of `type` (after skipping the specified number). Returns the index of the last argument.
static
AppendNameAndGenericArguments(StringBuilder, Type, Type[], CSharp.NameVerbosity, int) int
Appends the name and generic arguments of `type` (after skipping the specified number). Returns the index of the last argument.
static
AppendParameters(StringBuilder, ParameterInfo[], bool, CSharp.NameVerbosity) void
Appends the signature of `method` as it would appear in C# code.
static
AppendSignature(MethodInfo, StringBuilder, CSharp.NameVerbosity, bool, bool, bool, bool) void
Appends the signature of `method` as it would appear in C# code.
static
CompareNamespaceTypeMember(MemberInfo, MemberInfo) int
Compares the declaring type namespaces, then declaring type names, then member names.
static
GetKeyword(Type) string
Returns the C# keyword associated with the specified `type` such as int, float, string, etc. Returns null if there is no associated keyword.
static
GetNameCS(Action) string
Returns the full name of a `method` as it would appear in C# code. See: Weaver.CSharp.GetNameCS(System.Reflection.MemberInfo,Weaver.CSharp.NameVerbosity).
static
GetNameCS(Delegate) string
Returns the full name of a `method` as it would appear in C# code. See: Weaver.CSharp.GetNameCS(System.Reflection.MemberInfo,Weaver.CSharp.NameVerbosity).
static
GetNameCS(MemberInfo, CSharp.NameVerbosity) string
Returns the full name of a `member` as it would appear in C# code.

For example, passing the System.Reflection.MethodInfo of this method in as its own parameter would return "Weaver.CSharp.GetNameCS".

Note that when `member` is a System.Type, this method calls Weaver.CSharp.GetNameCS(System.Type,Weaver.CSharp.NameVerbosity) instead.
static
GetNameCS(Type, CSharp.NameVerbosity) string
Returns the name of a `type` as it would appear in C# code. Results are cached.
static
GetNameCS<T, TResult>(Func<T, TResult>) string
Returns the full name of a `method` as it would appear in C# code. See: Weaver.CSharp.GetNameCS(System.Reflection.MemberInfo,Weaver.CSharp.NameVerbosity).
static
GetNameCS<T>(Action<T>) string
Returns the full name of a `method` as it would appear in C# code. See: Weaver.CSharp.GetNameCS(System.Reflection.MemberInfo,Weaver.CSharp.NameVerbosity).
static
GetNameCS<T1, T2, TResult>(Func<T1, T2, TResult>) string
Returns the full name of a `method` as it would appear in C# code. See: Weaver.CSharp.GetNameCS(System.Reflection.MemberInfo,Weaver.CSharp.NameVerbosity).
static
GetNameCS<TResult>(Func<TResult>) string
Returns the full name of a `method` as it would appear in C# code. See: Weaver.CSharp.GetNameCS(System.Reflection.MemberInfo,Weaver.CSharp.NameVerbosity).
static
GetSignature(MethodInfo, CSharp.NameVerbosity, bool, bool, bool, bool) string
Returns the signature of `method` as it would appear in C# code.
static
HasKeyword(Type) bool
Returns true if the specified `type` is associated with a C# keyword such as int, float, string, etc.
static
IsReservedKeyword(string) bool
Returns true if the `word` is reserved by the C# language.
static