mscorlib(4.0.0.0) API with additions
RegexCompilationInfo.cs
2 
4 {
7  public class RegexCompilationInfo
8  {
9  private string pattern;
10 
11  private RegexOptions options;
12 
13  private string name;
14 
15  private string nspace;
16 
17  private bool isPublic;
18 
19  [OptionalField(VersionAdded = 2)]
20  private TimeSpan matchTimeout;
21 
25  public string Pattern
26  {
27  get
28  {
29  return pattern;
30  }
31  set
32  {
33  if (value == null)
34  {
35  throw new ArgumentNullException("value");
36  }
37  pattern = value;
38  }
39  }
40 
43  public RegexOptions Options
44  {
45  get
46  {
47  return options;
48  }
49  set
50  {
51  options = value;
52  }
53  }
54 
59  public string Name
60  {
61  get
62  {
63  return name;
64  }
65  set
66  {
67  if (value == null)
68  {
69  throw new ArgumentNullException("value");
70  }
71  if (value.Length == 0)
72  {
73  throw new ArgumentException(SR.GetString("InvalidNullEmptyArgument", "value"), "value");
74  }
75  name = value;
76  }
77  }
78 
82  public string Namespace
83  {
84  get
85  {
86  return nspace;
87  }
88  set
89  {
90  if (value == null)
91  {
92  throw new ArgumentNullException("value");
93  }
94  nspace = value;
95  }
96  }
97 
101  public bool IsPublic
102  {
103  get
104  {
105  return isPublic;
106  }
107  set
108  {
109  isPublic = value;
110  }
111  }
112 
115  public TimeSpan MatchTimeout
116  {
117  get
118  {
119  return matchTimeout;
120  }
121  set
122  {
124  matchTimeout = value;
125  }
126  }
127 
128  [OnDeserializing]
129  private void InitMatchTimeoutDefaultForOldVersionDeserialization(StreamingContext unusedContext)
130  {
131  matchTimeout = Regex.DefaultMatchTimeout;
132  }
133 
147  public RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic)
148  : this(pattern, options, name, fullnamespace, ispublic, Regex.DefaultMatchTimeout)
149  {
150  }
151 
168  public RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic, TimeSpan matchTimeout)
169  {
170  Pattern = pattern;
171  Name = name;
172  Namespace = fullnamespace;
173  this.options = options;
174  isPublic = ispublic;
175  MatchTimeout = matchTimeout;
176  }
177  }
178 }
RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic)
Initializes a new instance of the T:System.Text.RegularExpressions.RegexCompilationInfo class that co...
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
bool IsPublic
Gets or sets a value that indicates whether the compiled regular expression has public visibility.
Definition: __Canon.cs:3
static internal void ValidateMatchTimeout(TimeSpan matchTimeout)
Checks whether a time-out interval is within an acceptable range.
Definition: Regex.cs:340
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about a regular expression that is used to compile a regular expression to a sta...
RegexOptions Options
Gets or sets the options to use when compiling the regular expression.
string Pattern
Gets or sets the regular expression to compile.
RegexOptions
Provides enumerated values to use to set regular expression options.
Definition: RegexOptions.cs:6
The exception that is thrown when one of the arguments provided to a method is not valid.
Represents a time interval.To browse the .NET Framework source code for this type,...
Definition: TimeSpan.cs:12
Specifies that the class can be serialized.
string Name
Gets or sets the name of the type that represents the compiled regular expression.
string Namespace
Gets or sets the namespace to which the new type belongs.
Represents an immutable regular expression.To browse the .NET Framework source code for this type,...
Definition: Regex.cs:16
RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic, TimeSpan matchTimeout)
Initializes a new instance of the T:System.Text.RegularExpressions.RegexCompilationInfo class that co...
TimeSpan MatchTimeout
Gets or sets the regular expression's default time-out interval.