~ubuntu-branches/ubuntu/natty/moon/natty

« back to all changes in this revision

Viewing changes to class/Microsoft.SilverlightControls/Controls/Extended/Src/DatePicker/DatePickerTextParseErrorEventArgs.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
Import upstream version 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright © Microsoft Corporation. 
 
2
// This source is subject to the Microsoft Source License for Silverlight Controls (March 2008 Release).
 
3
// Please see http://go.microsoft.com/fwlink/?LinkID=111693 for details.
 
4
// All other rights reserved. 
 
5
 
 
6
 
 
7
namespace System.Windows.Controls 
 
8
 
9
    /// <summary>
 
10
    /// Provides data for the TextParseError event. 
 
11
    /// </summary>
 
12
    public class DatePickerTextParseErrorEventArgs : EventArgs
 
13
    { 
 
14
        private bool _throwException;
 
15
 
 
16
        /// <summary> 
 
17
        /// Initializes a new instance of the DatePickerTextParseErrorEventArgs class. 
 
18
        /// </summary>
 
19
        /// <param name="exception">The exception that initially triggered the TextParseError event.</param> 
 
20
        /// <param name="text">The text being parsed.</param>
 
21
        public DatePickerTextParseErrorEventArgs(Exception exception,
 
22
                                          string text) 
 
23
        {
 
24
            this.Text = text;
 
25
            this.Exception = exception; 
 
26
        } 
 
27
 
 
28
        /// <summary> 
 
29
        /// Gets the exception that initially triggered the TextParseError event.
 
30
        /// </summary>
 
31
        public Exception Exception 
 
32
        {
 
33
            get;
 
34
            private set; 
 
35
        } 
 
36
 
 
37
        /// <summary> 
 
38
        /// Gets the text being parsed when the TextParseError event was raised.
 
39
        /// </summary>
 
40
        public string Text 
 
41
        {
 
42
            get;
 
43
            private set; 
 
44
        } 
 
45
 
 
46
        /// <summary> 
 
47
        /// Gets or sets a value that indicates whether Exception should be thrown.
 
48
        /// </summary>
 
49
        public bool ThrowException 
 
50
        {
 
51
            get
 
52
            { 
 
53
                return this._throwException; 
 
54
            }
 
55
            set 
 
56
            {
 
57
                if (value && this.Exception == null)
 
58
                { 
 
59
                    throw new ArgumentException("Cannot Throw Null Exception");
 
60
                }
 
61
                this._throwException = value; 
 
62
            } 
 
63
        }
 
64
    } 
 
65
}