Show / Hide Table of Contents

# Struct Utils.ScopeGuardObject

An object used to manage scope guards.

##### Implements

IDisposable

##### Inherited Members

ValueType.Equals(Object)
ValueType.GetHashCode()
ValueType.ToString()
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()

###### Namespace: IPA.Utilities

###### Assembly: IPA.Loader.dll

##### Syntax

    public struct ScopeGuardObject : IDisposable

##### Examples

    using var _ = new Utils.ScopeGuardObject(() => RunOnScopeExit(value));

### Constructors

| Improve this Doc View Source

#### ScopeGuardObject(Action)

Creates a new scope guard that will invoke `action` when disposed.

##### Declaration

    public ScopeGuardObject(Action action)

##### Parameters

Type | Name | Description
--- | --- | ---
Action | action | the action to run on dispose

### Explicit Interface Implementations

| Improve this Doc View Source

#### IDisposable.Dispose()

##### Declaration

    void IDisposable.Dispose()

### Implements

System.IDisposable

### Extension Methods

ReflectionUtil.SetField<T, U>(T, String, U)
ReflectionUtil.GetField<U, T>(T, String)
ReflectionUtil.SetProperty<T, U>(T, String, U)
ReflectionUtil.GetProperty<U, T>(T, String)
ReflectionUtil.InvokeMethod<U, T>(T, String, Object[])

### See Also

ScopeGuard(Action)