128 lines
4.1 KiB
C#
128 lines
4.1 KiB
C#
using System;
|
|
|
|
namespace System.ComponentModel.Design
|
|
{
|
|
/// <summary>Provides a way to group a series of design-time actions to improve performance and enable most types of changes to be undone.</summary>
|
|
// Token: 0x02000042 RID: 66
|
|
public abstract class DesignerTransaction : IDisposable
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.Design.DesignerTransaction" /> class with no description.</summary>
|
|
// Token: 0x060002AF RID: 687 RVA: 0x0000972C File Offset: 0x0000792C
|
|
protected DesignerTransaction()
|
|
: this(string.Empty)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.Design.DesignerTransaction" /> class using the specified transaction description.</summary>
|
|
/// <param name="description">A description for this transaction. </param>
|
|
// Token: 0x060002B0 RID: 688 RVA: 0x0000973C File Offset: 0x0000793C
|
|
protected DesignerTransaction(string description)
|
|
{
|
|
this.description = description;
|
|
this.committed = false;
|
|
this.canceled = false;
|
|
}
|
|
|
|
/// <summary>Releases all resources used by the <see cref="T:System.ComponentModel.Design.DesignerTransaction" />. </summary>
|
|
// Token: 0x060002B1 RID: 689 RVA: 0x0000975C File Offset: 0x0000795C
|
|
void IDisposable.Dispose()
|
|
{
|
|
this.Dispose(true);
|
|
}
|
|
|
|
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.ComponentModel.Design.DesignerTransaction" /> 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: 0x060002B2 RID: 690 RVA: 0x00009768 File Offset: 0x00007968
|
|
protected virtual void Dispose(bool disposing)
|
|
{
|
|
this.Cancel();
|
|
if (disposing)
|
|
{
|
|
GC.SuppressFinalize(true);
|
|
}
|
|
}
|
|
|
|
/// <summary>Raises the Cancel event.</summary>
|
|
// Token: 0x060002B3 RID: 691
|
|
protected abstract void OnCancel();
|
|
|
|
/// <summary>Performs the actual work of committing a transaction.</summary>
|
|
// Token: 0x060002B4 RID: 692
|
|
protected abstract void OnCommit();
|
|
|
|
/// <summary>Cancels the transaction and attempts to roll back the changes made by the events of the transaction.</summary>
|
|
// Token: 0x060002B5 RID: 693 RVA: 0x00009784 File Offset: 0x00007984
|
|
public void Cancel()
|
|
{
|
|
if (!this.Canceled && !this.Committed)
|
|
{
|
|
this.canceled = true;
|
|
this.OnCancel();
|
|
}
|
|
}
|
|
|
|
/// <summary>Commits this transaction.</summary>
|
|
// Token: 0x060002B6 RID: 694 RVA: 0x000097AC File Offset: 0x000079AC
|
|
public void Commit()
|
|
{
|
|
if (!this.Canceled && !this.Committed)
|
|
{
|
|
this.committed = true;
|
|
this.OnCommit();
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether the transaction was canceled.</summary>
|
|
/// <returns>true if the transaction was canceled; otherwise, false.</returns>
|
|
// Token: 0x170000C8 RID: 200
|
|
// (get) Token: 0x060002B7 RID: 695 RVA: 0x000097D4 File Offset: 0x000079D4
|
|
public bool Canceled
|
|
{
|
|
get
|
|
{
|
|
return this.canceled;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether the transaction was committed.</summary>
|
|
/// <returns>true if the transaction was committed; otherwise, false.</returns>
|
|
// Token: 0x170000C9 RID: 201
|
|
// (get) Token: 0x060002B8 RID: 696 RVA: 0x000097DC File Offset: 0x000079DC
|
|
public bool Committed
|
|
{
|
|
get
|
|
{
|
|
return this.committed;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a description for the transaction.</summary>
|
|
/// <returns>A description for the transaction.</returns>
|
|
// Token: 0x170000CA RID: 202
|
|
// (get) Token: 0x060002B9 RID: 697 RVA: 0x000097E4 File Offset: 0x000079E4
|
|
public string Description
|
|
{
|
|
get
|
|
{
|
|
return this.description;
|
|
}
|
|
}
|
|
|
|
/// <summary>Releases the resources associated with this object. This override commits this transaction if it was not already committed.</summary>
|
|
// Token: 0x060002BA RID: 698 RVA: 0x000097EC File Offset: 0x000079EC
|
|
~DesignerTransaction()
|
|
{
|
|
this.Dispose(false);
|
|
}
|
|
|
|
// Token: 0x040000C4 RID: 196
|
|
private string description;
|
|
|
|
// Token: 0x040000C5 RID: 197
|
|
private bool committed;
|
|
|
|
// Token: 0x040000C6 RID: 198
|
|
private bool canceled;
|
|
}
|
|
}
|