using System; using System.Collections; using System.Collections.Generic; public class NoNamespace {} namespace System { /* * The System namespace gets special treatment, e.g. instead of * System.Environment C# declarations it's just Environment. */ /// T:System.Action`1 public delegate void Action (T obj); /// T:System.Environment public static class Environment { /// T:System.Environment+SpecialFolder public enum SpecialFolder {} /// /// A instance. /// /// /// M:System.Environment.GetFolderPath(System.Environment+SpecialFolder) /// public static string GetFolderPath (SpecialFolder folder) { return null; } } // to test ECMA doc importing... public class Array { // the ECMA docs have a different return type than .NET -- skip. public static System.Collections.ObjectModel.ReadOnlyCollection AsReadOnly (T[] array) { return null; } // ECMA docs use instead of --> map them. public static TOutput[] ConvertAll (TInput[] array, Converter converter) { return null; } // ECMA docs *incorrectly* document parameter -- skip public static void Resize (ref T[] array, int newSize) { } } // to test ECMA doc importing... public delegate void AsyncCallback (IAsyncResult ar); } namespace Mono.DocTest { internal class Internal { public class ShouldNotBeDocumented { } } internal class MonoTODOAttribute : Attribute { } /// /// /// cref=T:Mono.DocTest.DocAttribute. /// /// /// [AttributeUsage (AttributeTargets.All)] public class DocAttribute : Attribute { #region DocAttribute Example [Doc ("documented class")] class Example { [Doc ("documented field")] public string field; } #endregion public DocAttribute (string docs) { } } /// Possible colors /// . [MonoTODO] public enum Color { /// Insert Red summary here /// F:Mono.DocTest.Color.Red. Red, /// Insert Blue summary here /// F:Mono.DocTest.Color.Blue. Blue, /// Insert Green summary here /// F:Mono.DocTest.Color.Green. Green } /// Process interface /// T:Mono.DocTest.IProcess. public interface IProcess {} /// Process interface /// T:Mono.DocTest.DocValueType. public struct DocValueType : IProcess { /// F:Mono.DocTest.DocValueType.total. public int total; /// A . /// . public void M (int i) {} } /// T:Mono.DocTest.Widget. /// /// Some extra tag value public unsafe class Widget : IProcess { /// T:Mono.DocTest.Widget.NestedClass. public class NestedClass { /// F:Mono.DocTest.Widget.NestedClass.value. public int value; /// Some . /// M:Mono.DocTest.Widget.NestedClass.M(System.Int32). public void M (int i) {} } /// T:Mono.DocTest.Widget.NestedClass`1. public class NestedClass { /// F:Mono.DocTest.Widget.NestedClass`1.value. public int value; /// Another . /// M:Mono.DocTest.Widget.NestedClass`1.M(System.Int32). public void M (int i) {} } /// F:Mono.DocTest.Widget.classCtorError. public static readonly string[] classCtorError = CreateArray (); private static string[] CreateArray () { throw new NotSupportedException (); } /// F:Mono.DocTest.Widget.message. public string message; /// F:Mono.DocTest.Widget.defaultColor. protected static Color defaultColor; /// F:Mono.DocTest.Widget.PI. protected internal const double PI = 3.14159; /// F:Mono.DocTest.Widget.monthlyAverage. internal protected readonly double monthlyAverage; /// F:Mono.DocTest.Widget.array1. public long[] array1; /// F:Mono.DocTest.Widget.array2. public Widget[,] array2; /// F:Mono.DocTest.Widget.pCount. public unsafe int *pCount; /// F:Mono.DocTest.Widget.ppValues. public unsafe float **ppValues; /// T:Mono.DocTest.Widget.IMenuItem. public interface IMenuItem {} /// T:Mono.DocTest.Widget.Del. public delegate void Del (int i); /// T:Mono.DocTest.Widget.Direction. public enum Direction { /// T:Mono.DocTest.Widget.Direction.North. North, /// T:Mono.DocTest.Widget.Direction.South. South, /// T:Mono.DocTest.Widget.Direction.East. East, /// T:Mono.DocTest.Widget.Direction.West. West, } /// /// C:Mono.DocTest.Widget. /// M:Mono.DocTest.Widget.#ctor. /// /// /// public Widget () {} /// A . /// /// C:Mono.DocTest.Widget(System.String). /// M:Mono.DocTest.Widget.#ctor(System.String). /// public Widget (string s) {} /// A . /// /// C:Mono.DocTest.Widget(System.Converter{System.String,System.String}). /// public Widget (Converter c) {} /// M:Mono.DocTest.Widget.M0. public static void M0 () {} /// A . /// A . /// A . /// M:Mono.DocTest.Widget.M1(System.Char,System.Signle@,Mono.DocTest.DocValueType@). [return:Doc ("return:DocAttribute")] [Doc("normal DocAttribute")] public void M1 ([Doc ("c")] char c, [Doc ("f")] out float f, [Doc ("v")] ref DocValueType v) {f=0;} /// A array. /// A array. /// A array. /// M:Mono.DocTest.Widget.M2(System.Int16[],System.Int32[0:,0:],System.Int64[][]). public void M2 (short[] x1, int[,] x2, long[][] x3) {} /// Another array. /// A array. /// M:Mono.DocTest.Widget.M3(System.Int64[][],Mono.DocTest.Widget[0:,0:,0:][]). protected void M3 (long[][] x3, Widget[][,,] x4) {} /// A pointer. /// A pointer. /// M:Mono.DocTest.Widget.M4(System.Char*,Mono.DocTest.Color**). protected unsafe void M4 (char *pc, Color **ppf) {} /// A pointer. /// A array. /// M:Mono.DocTest.Widget.M5(System.Void*,System.Double*[0:,0:][]). protected unsafe void M5 (void *pv, double *[][,] pd) {} /// Yet another . /// An array. /// M:Mono.DocTest.Widget.M6(System.Int32,System.Object[]). protected void M6 (int i, params object[] args) {} /// A value... /// P:Mono.DocTest.Widget.Width. public int Width {get {return 0;} protected set {}} /// A value... /// P:Mono.DocTest.Widget.Height. protected long Height {get {return 0;}} /// A value... /// P:Mono.DocTest.Widget.X. protected internal short X {set {}} /// A value... /// P:Mono.DocTest.Widget.Y. internal protected double Y {get {return 0;} set {}} /// TODO /// P:Mono.DocTest.Widget.Item(System.Int32). /// A instance. public int this [int i] {get {return 0;} set {}} /// Some . /// I love s. /// P:Mono.DocTest.Widget.Item(System.String,System.Int32). /// A instance. public int this [string s, int i] {get {return 0;} set {}} /// E:Mono.DocTest.Widget.AnEvent. public event Del AnEvent; /// E:Mono.DocTest.Widget.AnotherEvent. protected event Del AnotherEvent; /// Another . /// M:Mono.DocTest.Widget.op_UnaryPlus(Mono.DocTest.Widget). /// A instance. public static Widget operator+ (Widget x) {return null;} /// Yet Another . /// Yay, s. /// M:Mono.DocTest.Widget.op_Addition(Mono.DocTest.Widget,Mono.DocTest.Widget). /// A instance (2). public static Widget operator+ (Widget x1, Widget x2) {return null;} /// s are fun!. /// M:Mono.DocTest.Widget.op_Explicit(Mono.DocTest.Widget)~System.Int32. /// A instance. public static explicit operator int (Widget x) {return 0;} /// foo; . /// M:Mono.DocTest.Widget.op_Implicit(Mono.DocTest.Widget)~System.Int64. /// A instance. public static implicit operator long (Widget x) {return 0;} } /// T:Mono.DocTest.UseLists. public class UseLists { /// A . /// M:Mono.DocTest.UseLists.Process(Mono.DocTest.MyList{System.Int32}). public void Process (Generic.MyList list) {} /// A T. /// Something /// M:Mono.DocTest.UseLists.GetValues``1(``0). /// A instance. public Generic.MyList GetValues (T value) where T : struct {return null;} /// Another . /// /// M:Mono.DocTest.UseLists.Process(System.Collections.Generic.List{System.Int32}). /// /// public void Process (List list) {} /// A . /// M:Mono.DocTest.UseLists.Process(System.Collections.Generic.List{System.Predicate{System.Int32}}). public void Process (List> list) {} /// A . /// Something Else /// M:Mono.DocTest.UseLists.Process``1(System.Collections.Generic.List{System.Predicate{``0}}). public void Process (List> list) {} /// A . /// T /// U /// V /// M:Mono.DocTest.UseLists.UseHelper``3(Mono.DocTest.Generic.MyList{``0}.Helper{``1,``2}). public void UseHelper (Generic.MyList.Helper helper) {} } } namespace Mono.DocTest.Generic { // Need to place this into a separate namespace to work around gmcs bug // where XML docs for type *following* this one aren't extracted. /// argument type, with attributes! /// return type, with attributes! /// T:Mono.DocTest.Generic.Func`2. [Doc ("method")] [return:Doc ("return")] public delegate TRet Func<[Doc ("arg!")] TArg, [Doc ("ret!")] TRet> ( [Doc ("arg-actual")] TArg a ) where TArg : Exception; } namespace Mono.DocTest.Generic { using Mono.DocTest; /// extension methods! /// T:Mono.DocTest.Generic.Extensions public static class Extensions { /// System.Object extension method /// M:Mono.DocTest.Generic.Extensions.ToEnumerable``1 public static IEnumerable ToEnumerable (this T self) { yield return self; } /// extension method /// M:Mono.DocTest.Generic.Extensions.ForEach``1 public static void ForEach (this IEnumerable self, Action a) { } /// extension method /// M:Mono.DocTest.Generic.Extensions.Bar``1 public static void Bar (this IFoo self, string s) { } /// /// /// extension method. /// /// M:Mono.DocTest.Generic.Extensions.ToDouble public static IEnumerable ToDouble (this IEnumerable list) { return null; } /// /// extension method. /// /// M:Mono.DocTest.Generic.Extensions.ToDouble public static double ToDouble (this T val) where T : IFoo { // the target type is T:...IFoo, NOT T:System.Object. return 0.0; } } /// Insert text here. /// T:Mono.DocTest.Generic.GenericBase`1. public class GenericBase { /// Something /// Insert more text here. /// M:Mono.DocTest.GenericBase`1.BaseMethod``1(``0). /// The default value. public U BaseMethod<[Doc ("S")] S> (S genericParameter) { return default(U); } /// F:Mono.DocTest.GenericBase`1.StaticField1 public static readonly GenericBase StaticField1 = new GenericBase (); /// F:Mono.DocTest.GenericBase`1.ConstField1 public const int ConstField1 = 1; /// Insert description here /// M:Mono.DocTest.GenericBase`1.op_Explicit(Mono.DocTest.GenericBase{`0})~`0 /// The default value for . public static explicit operator U (GenericBase list) {return default(U);} /// T:Mono.DocTest.Generic.GenericBase`1.FooEventArgs public class FooEventArgs : EventArgs { } /// E:Mono.DocTest.Generic.GenericBase`1.MyEvent public event EventHandler MyEvent; } /// I'm Dying Here! /// T:Mono.DocTest.Generic.MyList`1. public class MyList<[Mono.DocTest.Doc("Type Parameter!")] T> : GenericBase , IEnumerable { /// Seriously! /// Too many docs! /// T:Mono.DocTest.MyList`1.Helper`2. public class Helper { /// Ako /// bko /// cko /// M:Mono.DocTest.MyList`1.Helper`2.UseT(`0,`1,`2). public void UseT(T a, U b, V c) { } } /// tko /// M:Mono.DocTest.MyList`1.Test(`0). public void Test (T t) {} /// Class generic type /// Method generic type /// Method generic parameter /// M:Mono.DocTest.MyList`1.Method``1(`0,``0). public void Method (T t, U u) {} // mcs "crashes" (CS1569) on this method; exclude it for now. // M:Mono.DocTest.MyList`1.RefMethod``1(`0@,``0@). public void RefMethod (ref T t, ref U u) {} /// A . /// Argh! /// Foo Argh! /// M:Mono.DocTest.Generic.MyList`1.UseHelper``2(Mono.DocTest.Generic.MyList{``0}.Helper{``1,``2}). public void UseHelper (Helper helper) {} /// M:Mono.DocTest.Generic.MyList`1.GetHelper``2. /// . public Helper GetHelper () {return null;} /// M:Mono.DocTest.MyList`1.System#Collections#GetEnumerator. IEnumerator IEnumerable.GetEnumerator () {return null;} /// M:Mono.DocTest.MyList`1.GetEnumerator. public IEnumerator GetEnumerator () {return null;} } /// T generic param /// T:Mono.DocTest.IFoo`1. public interface IFoo { /// U generic param /// T:Mono.DocTest.IFoo`1.Method``1(`0,``0). T Method (T t, U u); } /// Ako generic param /// Bko generic param /// T:Mono.DocTest.MyList`2. public class MyList : GenericBase>, IEnumerable, IEnumerator, ICollection, IFoo where A : class, IList, new() where B : class, A { // IEnumerator // shown? object IEnumerator.Current {get {return null;}} /// M:Mono.DocTest.MyList`2.MoveNext. /// public bool MoveNext () {return false;} /// M:Mono.DocTest.MyList`2.Reset. public void Reset () {} // IDisposable /// M:Mono.DocTest.MyList`2.Dispose. public void Dispose () {} // IEnumerator /// P:Mono.DocTest.MyList`2.Current. /// The current value. public A Current {get {return default(A);}} /// P:Mono.DocTest.MyList`2.Current. /// The current value. A IEnumerator.Current {get {return default(A);}} // IEnumerable /// M:Mono.DocTest.MyList`2.System#Collections#GetEnumerator. IEnumerator IEnumerable.GetEnumerator () {return this;} // IEnumerable /// M:Mono.DocTest.MyList`2.System#Collections#Generic#IEnumerable{A}#GetEnumerator. /// A . IEnumerator IEnumerable.GetEnumerator () {return this;} /// M:Mono.DocTest.MyList`2.GetEnumerator. /// A . public List.Enumerator GetEnumerator () {return new List.Enumerator ();} // ICollection /// P:Mono.DocTest.MyList`2.Count. /// A . public int Count {get {return 0;}} /// P:Mono.DocTest.MyList`2.System#Collections#Generic#ICollection{A}#IsReadOnly. /// A . bool ICollection.IsReadOnly {get {return false;}} /// The item to add. /// M:Mono.DocTest.MyList`2.System#Collections#Generic#ICollection{A}#Add(`0). void ICollection.Add (A item) {} /// M:Mono.DocTest.MyList`2.System#Collections#Generic#ICollection{A}#Clear. void ICollection.Clear () {} /// The item to check for /// M:Mono.DocTest.MyList`2.System#Collections#Generic#ICollection{A}.Contains(`0). /// A instance (). bool ICollection.Contains (A item) {return false;} /// Where to copy elements to /// Where to start copyingto /// M:Mono.DocTest.MyList`2.CopyTo(`0[],System.Int32). public void CopyTo (A[] array, int arrayIndex) {} /// the item to remove /// M:Mono.DocTest.MyList`2.System#Collections#Generic#ICollection{A}#Remove(`0). /// Whether the item was removed. bool ICollection.Remove (A item) {return false;} /// M:Mono.DocTest.Generic.MyList`2.Foo public KeyValuePair, IEnumerable> Foo () { return new KeyValuePair, IEnumerable> (); } // IFoo members /// U generic param on MyList`2 /// M:Mono.DocTest.Generic.MyList`2.Mono#DocTest#Generic#IFoo{A}#Method``1(`0,``0). A IFoo.Method (A a, U u) { return default (A); } } }