Show / Hide Table of Contents

# Class Framework

This class represents the Framework of the native game client and grants access to various subsystems.

##### Inheritance

System.Object
Framework

##### Implements

System.IDisposable
IServiceType

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Dalamud.Game

###### Assembly: Dalamud.dll

##### Syntax

    public sealed class Framework : IDisposable, IServiceType

### Properties

| Improve this Doc View Source

#### Address

Gets a raw pointer to the instance of Client::Framework.

##### Declaration

    public FrameworkAddressResolver Address { get; }

##### Property Value

Type | Description
--- | ---
FrameworkAddressResolver |

| Improve this Doc View Source

#### IsFrameworkUnloading

Gets a value indicating whether game Framework is unloading.

##### Declaration

    public bool IsFrameworkUnloading { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsInFrameworkUpdateThread

Gets a value indicating whether currently executing code is running in the game's framework update thread.

##### Declaration

    public bool IsInFrameworkUpdateThread { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### LastUpdate

Gets the last time that the Framework Update event was triggered.

##### Declaration

    public DateTime LastUpdate { get; }

##### Property Value

Type | Description
--- | ---
System.DateTime |

| Improve this Doc View Source

#### LastUpdateUTC

Gets the last time in UTC that the Framework Update event was triggered.

##### Declaration

    public DateTime LastUpdateUTC { get; }

##### Property Value

Type | Description
--- | ---
System.DateTime |

| Improve this Doc View Source

#### StatsEnabled

Gets or sets a value indicating whether the collection of stats is enabled.

##### Declaration

    public static bool StatsEnabled { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### StatsHistory

Gets the stats history mapping.

##### Declaration

    public static Dictionary<string, List<double>> StatsHistory { get; }

##### Property Value

Type | Description
--- | ---
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.Double>> |

| Improve this Doc View Source

#### UpdateDelta

Gets the delta between the last Framework Update and the currently executing one.

##### Declaration

    public TimeSpan UpdateDelta { get; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

### Methods

| Improve this Doc View Source

#### RunOnFrameworkThread(Action)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

##### Declaration

    public Task RunOnFrameworkThread(Action action)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action | action | Function to call.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | Task representing the pending or already completed function.

| Improve this Doc View Source

#### RunOnFrameworkThread(Func<Task>)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

##### Declaration

    public Task RunOnFrameworkThread(Func<Task> func)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<System.Threading.Tasks.Task> | func | Function to call.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | Task representing the pending or already completed function.

| Improve this Doc View Source

#### RunOnFrameworkThread<T>(Func<T>)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

##### Declaration

    public Task<T> RunOnFrameworkThread<T>(Func<T> func)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<T> | func | Function to call.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<T> | Task representing the pending or already completed function.

##### Type Parameters

Name | Description
--- | ---
T | Return type.

| Improve this Doc View Source

#### RunOnFrameworkThread<T>(Func<Task<T>>)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

##### Declaration

    public Task<T> RunOnFrameworkThread<T>(Func<Task<T>> func)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<System.Threading.Tasks.Task<T>> | func | Function to call.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<T> | Task representing the pending or already completed function.

##### Type Parameters

Name | Description
--- | ---
T | Return type.

| Improve this Doc View Source

#### RunOnTick(Action, TimeSpan, Int32, CancellationToken)

Run given function in upcoming Framework.Tick call.

##### Declaration

    public Task RunOnTick(Action action, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action | action | Function to call.
System.TimeSpan | delay | Wait for given timespan before calling this function.
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationToken | cancellationToken | Cancellation token which will prevent the execution of this function if wait conditions are not met.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | Task representing the pending function.

| Improve this Doc View Source

#### RunOnTick(Func<Task>, TimeSpan, Int32, CancellationToken)

Run given function in upcoming Framework.Tick call.

##### Declaration

    public Task RunOnTick(Func<Task> func, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<System.Threading.Tasks.Task> | func | Function to call.
System.TimeSpan | delay | Wait for given timespan before calling this function.
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationToken | cancellationToken | Cancellation token which will prevent the execution of this function if wait conditions are not met.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | Task representing the pending function.

| Improve this Doc View Source

#### RunOnTick<T>(Func<T>, TimeSpan, Int32, CancellationToken)

Run given function in upcoming Framework.Tick call.

##### Declaration

    public Task<T> RunOnTick<T>(Func<T> func, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<T> | func | Function to call.
System.TimeSpan | delay | Wait for given timespan before calling this function.
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationToken | cancellationToken | Cancellation token which will prevent the execution of this function if wait conditions are not met.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<T> | Task representing the pending function.

##### Type Parameters

Name | Description
--- | ---
T | Return type.

| Improve this Doc View Source

#### RunOnTick<T>(Func<Task<T>>, TimeSpan, Int32, CancellationToken)

Run given function in upcoming Framework.Tick call.

##### Declaration

    public Task<T> RunOnTick<T>(Func<Task<T>> func, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<System.Threading.Tasks.Task<T>> | func | Function to call.
System.TimeSpan | delay | Wait for given timespan before calling this function.
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationToken | cancellationToken | Cancellation token which will prevent the execution of this function if wait conditions are not met.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<T> | Task representing the pending function.

##### Type Parameters

Name | Description
--- | ---
T | Return type.

### Events

| Improve this Doc View Source

#### Update

Event that gets fired every time the game framework updates.

##### Declaration

    public event Framework.OnUpdateDelegate Update

##### Event Type

Type | Description
--- | ---
Framework.OnUpdateDelegate |

### Explicit Interface Implementations

| Improve this Doc View Source

#### IDisposable.Dispose()

Dispose of managed and unmanaged resources.

##### Declaration

    void IDisposable.Dispose()

### Implements

System.IDisposable
IServiceType