-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathExpressionBinding.cs
118 lines (94 loc) · 3.08 KB
/
ExpressionBinding.cs
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//------------------------------------------------------------------------------
// <copyright file="ExpressionBinding.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Web.UI {
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Globalization;
using System.Security.Permissions;
using System.Web.Util;
/// <devdoc>
/// </devdoc>
public sealed class ExpressionBinding {
private string _propertyName;
private Type _propertyType;
private string _expression;
private string _expressionPrefix;
private bool _generated;
private object _parsedExpressionData;
public ExpressionBinding(string propertyName, Type propertyType, string expressionPrefix, string expression) : this(propertyName, propertyType, expressionPrefix, expression, false, null) {
}
/// <devdoc>
/// </devdoc>
internal ExpressionBinding(string propertyName, Type propertyType, string expressionPrefix, string expression, bool generated, object parsedExpressionData) {
_propertyName = propertyName;
_propertyType = propertyType;
_expression = expression;
_expressionPrefix = expressionPrefix;
_generated = generated;
_parsedExpressionData = parsedExpressionData;
}
/// <devdoc>
/// </devdoc>
public string Expression {
get {
return _expression;
}
set {
_expression = value;
}
}
/// <devdoc>
/// </devdoc>G
public string ExpressionPrefix {
get {
return _expressionPrefix;
}
set {
_expressionPrefix = value;
}
}
public bool Generated {
get {
return _generated;
}
}
public object ParsedExpressionData {
get {
return _parsedExpressionData;
}
}
/// <devdoc>
/// </devdoc>
public string PropertyName {
get {
return _propertyName;
}
}
/// <devdoc>
/// </devdoc>
public Type PropertyType {
get {
return _propertyType;
}
}
/// <devdoc>
/// </devdoc>
public override int GetHashCode() {
return _propertyName.ToLower(CultureInfo.InvariantCulture).GetHashCode();
}
/// <devdoc>
/// </devdoc>
public override bool Equals(object obj) {
if ((obj != null) && (obj is ExpressionBinding)) {
ExpressionBinding binding = (ExpressionBinding)obj;
return StringUtil.EqualsIgnoreCase(_propertyName, binding.PropertyName);
}
return false;
}
}
}