using System;
using System.Runtime.InteropServices;
namespace System.ComponentModel
{
/// Provides the base implementation for the interface and enables object sharing between applications.
// Token: 0x02000064 RID: 100
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[DesignerCategory("Component")]
[ComVisible(true)]
public class Component : MarshalByRefObject, IDisposable, IComponent
{
/// Initializes a new instance of the class.
// Token: 0x060003BD RID: 957 RVA: 0x0000B740 File Offset: 0x00009940
public Component()
{
this.event_handlers = null;
}
/// Occurs when the component is disposed by a call to the method.
// Token: 0x14000013 RID: 19
// (add) Token: 0x060003BE RID: 958 RVA: 0x0000B75C File Offset: 0x0000995C
// (remove) Token: 0x060003BF RID: 959 RVA: 0x0000B770 File Offset: 0x00009970
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
public event EventHandler Disposed
{
add
{
this.Events.AddHandler(this.disposedEvent, value);
}
remove
{
this.Events.RemoveHandler(this.disposedEvent, value);
}
}
/// Gets a value indicating whether the component can raise an event.
/// true if the component can raise events; otherwise, false. The default is true.
// Token: 0x17000108 RID: 264
// (get) Token: 0x060003C0 RID: 960 RVA: 0x0000B784 File Offset: 0x00009984
protected virtual bool CanRaiseEvents
{
get
{
return false;
}
}
/// Gets or sets the of the .
/// The associated with the , or null if the is not encapsulated in an , the does not have an associated with it, or the is removed from its .
// Token: 0x17000109 RID: 265
// (get) Token: 0x060003C1 RID: 961 RVA: 0x0000B788 File Offset: 0x00009988
// (set) Token: 0x060003C2 RID: 962 RVA: 0x0000B790 File Offset: 0x00009990
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Browsable(false)]
public virtual ISite Site
{
get
{
return this.mySite;
}
set
{
this.mySite = value;
}
}
/// Gets the that contains the .
/// The that contains the , if any, or null if the is not encapsulated in an .
// Token: 0x1700010A RID: 266
// (get) Token: 0x060003C3 RID: 963 RVA: 0x0000B79C File Offset: 0x0000999C
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IContainer Container
{
get
{
if (this.mySite == null)
{
return null;
}
return this.mySite.Container;
}
}
/// Gets a value that indicates whether the is currently in design mode.
/// true if the is in design mode; otherwise, false.
// Token: 0x1700010B RID: 267
// (get) Token: 0x060003C4 RID: 964 RVA: 0x0000B7B8 File Offset: 0x000099B8
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Browsable(false)]
protected bool DesignMode
{
get
{
return this.mySite != null && this.mySite.DesignMode;
}
}
/// Gets the list of event handlers that are attached to this .
/// An that provides the delegates for this component.
// Token: 0x1700010C RID: 268
// (get) Token: 0x060003C5 RID: 965 RVA: 0x0000B7D4 File Offset: 0x000099D4
protected EventHandlerList Events
{
get
{
if (this.event_handlers == null)
{
this.event_handlers = new EventHandlerList();
}
return this.event_handlers;
}
}
/// Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection.
// Token: 0x060003C6 RID: 966 RVA: 0x0000B7F4 File Offset: 0x000099F4
~Component()
{
this.Dispose(false);
}
/// Releases all resources used by the .
// Token: 0x060003C7 RID: 967 RVA: 0x0000B830 File Offset: 0x00009A30
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// Releases the unmanaged resources used by the and optionally releases the managed resources.
/// true to release both managed and unmanaged resources; false to release only unmanaged resources.
// Token: 0x060003C8 RID: 968 RVA: 0x0000B840 File Offset: 0x00009A40
protected virtual void Dispose(bool release_all)
{
if (release_all)
{
if (this.mySite != null && this.mySite.Container != null)
{
this.mySite.Container.Remove(this);
}
EventHandler eventHandler = (EventHandler)this.Events[this.disposedEvent];
if (eventHandler != null)
{
eventHandler(this, EventArgs.Empty);
}
}
}
/// Returns an object that represents a service provided by the or by its .
/// An that represents a service provided by the , or null if the does not provide the specified service.
/// A service provided by the .
// Token: 0x060003C9 RID: 969 RVA: 0x0000B8A8 File Offset: 0x00009AA8
protected virtual object GetService(Type service)
{
if (this.mySite != null)
{
return this.mySite.GetService(service);
}
return null;
}
/// Returns a containing the name of the , if any. This method should not be overridden.
/// A containing the name of the , if any, or null if the is unnamed.
// Token: 0x060003CA RID: 970 RVA: 0x0000B8C4 File Offset: 0x00009AC4
public override string ToString()
{
if (this.mySite == null)
{
return base.GetType().ToString();
}
return string.Format("{0} [{1}]", this.mySite.Name, base.GetType().ToString());
}
// Token: 0x04000142 RID: 322
private EventHandlerList event_handlers;
// Token: 0x04000143 RID: 323
private ISite mySite;
// Token: 0x04000144 RID: 324
private object disposedEvent = new object();
}
}