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

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

using System;

namespace System.ComponentModel {

[AttributeUsage(AttributeTargets.All)]
public sealed class TypeConverterAttribute : Attribute
{
	private string converter_type;

	public TypeConverterAttribute ()
	{
		converter_type = "";
	}

	public TypeConverterAttribute (string typeName)
	{
		converter_type = typeName;
	}

	public TypeConverterAttribute (Type type)
	{
		converter_type = type.AssemblyQualifiedName;
	}

	public override bool Equals (object obj)
	{
		if (!(obj is TypeConverterAttribute))
			return false;

		return ((TypeConverterAttribute) obj).ConverterTypeName == converter_type;
	}

	public override int GetHashCode ()
	{
		return converter_type.GetHashCode ();
	}

	public string ConverterTypeName
	{
		get { return converter_type; }
	}
}
}