1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenTK
{
// Override a number of System.* classes when compiling for
// minimal targets (e.g. MonoTouch).
// Note: the "overriden" classes must not be fully qualified for this to work!
#if IPHONE
// System.Diagnostics.Debug
static class Debug
{
public static void Write(string message) { }
public static void Write(object obj) { }
public static void WriteLine(string message) { }
public static void WriteLine(object obj) { }
public static void Print(string message) { }
public static void Print(string format, params object[] args) { }
public static void Indent() { }
public static void Unindent() { }
public static void Flush() { }
}
// System.Diagnostics.Trace
static class Trace
{
public static void Write(string message) { }
public static void Write(object obj) { }
public static void WriteLine(string message) { }
public static void WriteLine(object obj) { }
public static void Indent() { }
public static void Unindent() { }
public static void Flush() { }
}
// System.Diagnostics.Stopwatch
sealed class Stopwatch
{
DateTime start, stop;
bool running;
public void Reset()
{
start = stop = DateTime.MinValue;
running = false;
}
public void Start()
{
start = DateTime.Now;
running = true;
}
public void Stop()
{
stop = DateTime.Now;
running = false;
}
public TimeSpan Elapsed
{
get
{
if (running)
return TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks);
else
return TimeSpan.FromTicks(stop.Ticks - start.Ticks);
}
}
}
// System.Xml.XmlIgnoreAttribute
class XmlIgnoreAttribute : Attribute
{
}
// System.ComponentModel.EditorBrowrableAttribute
class EditorBrowsableAttribute : Attribute
{
public EditorBrowsableAttribute(EditorBrowsableState state) { }
}
// System.ComponentModel.EditorBrowsableState
enum EditorBrowsableState
{
Always = 0,
Never = 1,
Advanced = 2,
}
#endif
}
|