本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceSymbol.GetTypeMembers方法的典型用法代码示例。如果您正苦于以下问题:C# NamespaceSymbol.GetTypeMembers方法的具体用法?C# NamespaceSymbol.GetTypeMembers怎么用?C# NamespaceSymbol.GetTypeMembers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceSymbol
的用法示例。
在下文中一共展示了NamespaceSymbol.GetTypeMembers方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TypeDocumentationCommentTests
public TypeDocumentationCommentTests()
{
_compilation = CreateCompilationWithMscorlibAndDocumentationComments(@"enum Color { Red, Blue, Green }
namespace Acme
{
interface IProcess {...}
struct ValueType {...}
class Widget: IProcess
{
/// <summary>
/// Hello! Nested Class.
/// </summary>
public class NestedClass {...}
public interface IMenuItem {...}
public delegate void Del(int i);
public enum Direction { North, South, East, West }
}
class MyList<T>
{
class Helper<U,V> {...}
}
}");
_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single();
_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single();
}
示例2: FieldDocumentationCommentTests
public FieldDocumentationCommentTests()
{
_compilation = CreateCompilationWithMscorlibAndDocumentationComments(@"
namespace Acme
{
struct ValueType
{
/// <summary>Summary for total fields.</summary>
private int total1, total2;
}
class Widget: IProcess
{
public class NestedClass
{
private int value;
}
private string message;
private static Color defaultColor;
private const double PI = 3.14159;
protected readonly double monthlyAverage;
private long[] array1;
private Widget[,] array2;
private unsafe int *pCount;
private unsafe float **ppValues;
}
enum E
{
/// <summary>Enum field</summary>
A = 1
}
}
");
_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single();
_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single();
_enumSymbol = _acmeNamespace.GetTypeMembers("E").Single();
_valueType = _acmeNamespace.GetTypeMembers("ValueType").Single();
}
示例3: DestructorDocumentationCommentTests
public DestructorDocumentationCommentTests()
{
_compilation = CreateCompilationWithMscorlibAndDocumentationComments(@"namespace Acme
{
class Widget: IProcess
{
/// <summary>Destructor Documentation</summary>
~Widget() {...}
}
}
");
_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single();
_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single();
}
示例4: LoadChildNamespace
internal static XElement LoadChildNamespace(NamespaceSymbol n)
{
XElement elem = new XElement((n.Name.Length == 0 ? "Global" : n.Name));
var childrenTypes = n.GetTypeMembers().OrderBy((t) => t, new NameAndArityComparer());
elem.Add(from t in childrenTypes select LoadChildType(t));
var childrenNS = n.GetMembers().
OfType<NamespaceSymbol>().
OrderBy(child => child.Name, StringComparer.OrdinalIgnoreCase);
elem.Add(from c in childrenNS select LoadChildNamespace(c));
return elem;
}
示例5: PropertyDocumentationCommentTests
public PropertyDocumentationCommentTests()
{
compilation = CreateCompilationWithMscorlib(@"namespace Acme
{
class Widget: IProcess
{
public int Width { get { } set { } }
public int this[int i] { get { } set { } }
public int this[string s, int i] { get { } set { } }
}
}
");
acmeNamespace = (NamespaceSymbol)compilation.GlobalNamespace.GetMembers("Acme").Single();
widgetClass = acmeNamespace.GetTypeMembers("Widget").Single();
}
示例6: MethodDocumentationCommentTests
public MethodDocumentationCommentTests()
{
_compilation = CreateCompilationWithMscorlibAndDocumentationComments(@"namespace Acme
{
struct ValueType
{
public void M(int i) { }
public static explicit operator ValueType (byte value)
{
return default(ValueType);
}
}
class Widget: IProcess
{
public class NestedClass
{
public void M(int i) { }
}
/// <summary>M0 Summary.</summary>
public static void M0() { }
public void M1(char c, out float f, ref ValueType v) { }
public void M2(short[] x1, int[,] x2, long[][] x3) { }
public void M3(long[][] x3, Widget[][,,] x4) { }
public unsafe void M4(char *pc, Color **pf) { }
public unsafe void M5(void *pv, double *[][,] pd) { }
public void M6(int i, params object[] args) { }
}
class MyList<T>
{
public void Test(T t) { }
public void Zip(MyList<T> other) { }
public void ReallyZip(MyList<MyList<T>> other) { }
}
class UseList
{
public void Process(MyList<int> list) { }
public MyList<T> GetValues<T>(T inputValue) { return null; }
}
}
");
_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single();
_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single();
}
示例7: ConstructorDocumentationCommentTests
public ConstructorDocumentationCommentTests()
{
compilation = CreateCompilationWithMscorlibAndDocumentationComments(@"namespace Acme
{
class Widget: IProcess
{
/// <summary>Static Constructor</summary>
static Widget() {...}
/** <summary>Instance Constructor</summary> */
public Widget() {...}
/// <summary>
/// Parameterized Constructor
/// </summary>
/// <param name=""s"">s, the string argument</param>
public Widget(string s) {...}
}
}
");
acmeNamespace = (NamespaceSymbol)compilation.GlobalNamespace.GetMembers("Acme").Single();
widgetClass = acmeNamespace.GetTypeMembers("Widget").Single();
}