158 lines
5.8 KiB
C#
158 lines
5.8 KiB
C#
using System;
|
|
using System.ComponentModel.Design;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.ComponentModel
|
|
{
|
|
/// <summary>Implements <see cref="T:System.ComponentModel.IComponent" /> and provides the base implementation for remotable components that are marshaled by value (a copy of the serialized object is passed).</summary>
|
|
// Token: 0x020000AB RID: 171
|
|
[DesignerCategory("Component")]
|
|
[ComVisible(true)]
|
|
[Designer("System.Windows.Forms.Design.ComponentDocumentDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(global::System.ComponentModel.Design.IRootDesigner))]
|
|
[TypeConverter(typeof(ComponentConverter))]
|
|
public class MarshalByValueComponent : IDisposable, IServiceProvider, IComponent
|
|
{
|
|
/// <summary>Adds an event handler to listen to the <see cref="E:System.ComponentModel.MarshalByValueComponent.Disposed" /> event on the component.</summary>
|
|
// Token: 0x14000018 RID: 24
|
|
// (add) Token: 0x06000580 RID: 1408 RVA: 0x0000E57C File Offset: 0x0000C77C
|
|
// (remove) Token: 0x06000581 RID: 1409 RVA: 0x0000E590 File Offset: 0x0000C790
|
|
public event EventHandler Disposed
|
|
{
|
|
add
|
|
{
|
|
this.Events.AddHandler(this.disposedEvent, value);
|
|
}
|
|
remove
|
|
{
|
|
this.Events.RemoveHandler(this.disposedEvent, value);
|
|
}
|
|
}
|
|
|
|
/// <summary>Releases all resources used by the <see cref="T:System.ComponentModel.MarshalByValueComponent" />.</summary>
|
|
// Token: 0x06000582 RID: 1410 RVA: 0x0000E5A4 File Offset: 0x0000C7A4
|
|
public void Dispose()
|
|
{
|
|
this.Dispose(true);
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
|
|
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.ComponentModel.MarshalByValueComponent" /> and optionally releases the managed resources.</summary>
|
|
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
|
|
// Token: 0x06000583 RID: 1411 RVA: 0x0000E5B4 File Offset: 0x0000C7B4
|
|
[global::System.MonoTODO]
|
|
protected virtual void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000584 RID: 1412 RVA: 0x0000E5BC File Offset: 0x0000C7BC
|
|
~MarshalByValueComponent()
|
|
{
|
|
this.Dispose(false);
|
|
}
|
|
|
|
/// <summary>Gets the implementer of the <see cref="T:System.IServiceProvider" />.</summary>
|
|
/// <returns>An <see cref="T:System.Object" /> that represents the implementer of the <see cref="T:System.IServiceProvider" />.</returns>
|
|
/// <param name="service">A <see cref="T:System.Type" /> that represents the type of service you want. </param>
|
|
// Token: 0x06000585 RID: 1413 RVA: 0x0000E5F8 File Offset: 0x0000C7F8
|
|
public virtual object GetService(Type service)
|
|
{
|
|
if (this.mySite != null)
|
|
{
|
|
return this.mySite.GetService(service);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/// <summary>Gets the container for the component.</summary>
|
|
/// <returns>An object implementing the <see cref="T:System.ComponentModel.IContainer" /> interface that represents the component's container, or null if the component does not have a site.</returns>
|
|
// Token: 0x1700016F RID: 367
|
|
// (get) Token: 0x06000586 RID: 1414 RVA: 0x0000E614 File Offset: 0x0000C814
|
|
[Browsable(false)]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
|
public virtual IContainer Container
|
|
{
|
|
get
|
|
{
|
|
if (this.mySite == null)
|
|
{
|
|
return null;
|
|
}
|
|
return this.mySite.Container;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether the component is currently in design mode.</summary>
|
|
/// <returns>true if the component is in design mode; otherwise, false.</returns>
|
|
// Token: 0x17000170 RID: 368
|
|
// (get) Token: 0x06000587 RID: 1415 RVA: 0x0000E630 File Offset: 0x0000C830
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
|
[Browsable(false)]
|
|
public virtual bool DesignMode
|
|
{
|
|
get
|
|
{
|
|
return this.mySite != null && this.mySite.DesignMode;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the site of the component.</summary>
|
|
/// <returns>An object implementing the <see cref="T:System.ComponentModel.ISite" /> interface that represents the site of the component.</returns>
|
|
// Token: 0x17000171 RID: 369
|
|
// (get) Token: 0x06000588 RID: 1416 RVA: 0x0000E64C File Offset: 0x0000C84C
|
|
// (set) Token: 0x06000589 RID: 1417 RVA: 0x0000E654 File Offset: 0x0000C854
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
|
[Browsable(false)]
|
|
public virtual ISite Site
|
|
{
|
|
get
|
|
{
|
|
return this.mySite;
|
|
}
|
|
set
|
|
{
|
|
this.mySite = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>Returns a <see cref="T:System.String" /> containing the name of the <see cref="T:System.ComponentModel.Component" />, if any. This method should not be overridden.</summary>
|
|
/// <returns>A <see cref="T:System.String" /> containing the name of the <see cref="T:System.ComponentModel.Component" />, if any.null if the <see cref="T:System.ComponentModel.Component" /> is unnamed.</returns>
|
|
// Token: 0x0600058A RID: 1418 RVA: 0x0000E660 File Offset: 0x0000C860
|
|
public override string ToString()
|
|
{
|
|
if (this.mySite == null)
|
|
{
|
|
return base.GetType().ToString();
|
|
}
|
|
return string.Format("{0} [{1}]", this.mySite.Name, base.GetType().ToString());
|
|
}
|
|
|
|
/// <summary>Gets the list of event handlers that are attached to this component.</summary>
|
|
/// <returns>An <see cref="T:System.ComponentModel.EventHandlerList" /> that provides the delegates for this component.</returns>
|
|
// Token: 0x17000172 RID: 370
|
|
// (get) Token: 0x0600058B RID: 1419 RVA: 0x0000E6A4 File Offset: 0x0000C8A4
|
|
protected EventHandlerList Events
|
|
{
|
|
get
|
|
{
|
|
if (this.eventList == null)
|
|
{
|
|
this.eventList = new EventHandlerList();
|
|
}
|
|
return this.eventList;
|
|
}
|
|
}
|
|
|
|
// Token: 0x040001A5 RID: 421
|
|
private EventHandlerList eventList;
|
|
|
|
// Token: 0x040001A6 RID: 422
|
|
private ISite mySite;
|
|
|
|
// Token: 0x040001A7 RID: 423
|
|
private object disposedEvent = new object();
|
|
}
|
|
}
|