File: Helper.cs

package info (click to toggle)
mono-basic 2.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 18,852 kB
  • ctags: 809
  • sloc: cs: 8,852; makefile: 516; sh: 307
file content (53 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download
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
using System;
using System.Text;
using NUnit.Framework;

namespace MonoTests.Microsoft_VisualBasic
{
	[TestFixture]
	public class Helper
	{
		[Test]
		public void PrintRuntimePath ()
		{
			Console.WriteLine ("\r\nUsing runtime in: " + typeof (Microsoft.VisualBasic.Strings).Assembly.Location);
		}
		
		public static bool OnMono {
			get {
				return Type.GetType ("Mono.Runtime") != null;
			}
		}
		
		public static bool OnMS {
			get {
				return !OnMono;
			}
		}

#if NET_2_0

		public static T [] getObjects <T> (System.Collections.IEnumerable en)
		{
			System.Collections.Generic.List<T> list = new System.Collections.Generic.List<T> ();
			foreach (T obj in en) {
				list.Add (obj);
			}
			return list.ToArray ();
		}
		
		public static void RemoveWarning  (object obj)
		{
		}
		
		public static string Join <T> (T [] array, string delimiter) 
		{
			if (array == null)
				return Microsoft.VisualBasic.Strings.Join (null, delimiter);
			object [] obj = new object [array.Length];
			Array.Copy (array, obj, array.Length);
			return Microsoft.VisualBasic.Strings.Join (obj, delimiter);
		}
#endif
	}
}