Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BaseCompiler.cs « System.Web.Compilation « System.Web « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9828f6bcf0e17bc5fdbf0056e00b23b9d9f6badf (plain)
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
//
// System.Web.Compilation.BaseCompiler
//
// Authors:
//	Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
//

using System;
using System.IO;

namespace System.Web.Compilation
{
	abstract class BaseCompiler
	{
		static Random rnd = new Random ((int) DateTime.Now.Ticks);
		string randomName;

		protected BaseCompiler ()
		{
		}

		public virtual Type GetCompiledType ()
		{
			return null;
		}

		public virtual string Key {
			get {
				return null;
			}
		}

		public virtual string SourceFile {
			get {
				return null;
			}
		}

		public virtual string [] Dependencies {
			get {
				return null;
			}
		}
		
		public virtual string CompilerOptions {
			get {
				return "/r:System.Web.dll /r:System.Data.dll /r:System.Drawing.dll";
			}
		}

		static string GetRandomFileName ()
		{
			string output;

			do { 
				output = "tmp" + rnd.Next () + ".dll";
			} while (File.Exists (output));

			return output;
		}

		public virtual string TargetFile {
			get {
				if (randomName == null)
					randomName = GetRandomFileName ();

				return randomName;
			}
		}
	}
}