1 //------------------------------------------------------------------------------
2 // <copyright file="RefreshEventArgs.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6 
7 /*
8  */
9 namespace System.ComponentModel {
10 
11     using System;
12     using System.Diagnostics;
13     using System.Security.Permissions;
14 
15     /// <devdoc>
16     ///    <para>
17     ///       Provides data for the <see cref='System.ComponentModel.TypeDescriptor.Refresh'/> event.
18     ///    </para>
19     /// </devdoc>
20     [HostProtection(SharedState = true)]
21     public class RefreshEventArgs : EventArgs {
22 
23         private object componentChanged;
24         private Type   typeChanged;
25 
26         /// <devdoc>
27         ///    <para>
28         ///       Initializes a new instance of the <see cref='System.ComponentModel.RefreshEventArgs'/> class with
29         ///       the component that has
30         ///       changed.
31         ///    </para>
32         /// </devdoc>
RefreshEventArgs(object componentChanged)33         public RefreshEventArgs(object componentChanged) {
34             this.componentChanged = componentChanged;
35             this.typeChanged = componentChanged.GetType();
36         }
37 
38         /// <devdoc>
39         ///    <para>
40         ///       Initializes a new instance of the <see cref='System.ComponentModel.RefreshEventArgs'/> class with
41         ///       the type
42         ///       of component that has changed.
43         ///    </para>
44         /// </devdoc>
RefreshEventArgs(Type typeChanged)45         public RefreshEventArgs(Type typeChanged) {
46             this.typeChanged = typeChanged;
47         }
48 
49         /// <devdoc>
50         ///    <para>
51         ///       Gets the component that has changed
52         ///       its properties, events, or
53         ///       extenders.
54         ///    </para>
55         /// </devdoc>
56         public object ComponentChanged {
57             get {
58                 return componentChanged;
59             }
60         }
61 
62         /// <devdoc>
63         ///    <para>
64         ///       Gets the type that has changed its properties, or events.
65         ///    </para>
66         /// </devdoc>
67         public Type TypeChanged {
68             get {
69                 return typeChanged;
70             }
71         }
72     }
73 }
74 
75