Mediation 5.4.0 - Unity C# API Reference Mediation 5.4.0 - Unity C# API Reference
Mediation 5.4.0 - Unity C# API Reference Mediation 5.4.0 - Unity C# API Reference
© 2025 Chartboost, Inc. All rights reserved.

Struct ContainerSize

Represents a container size with options for fixed, wrapped, or content-based sizing.

Implements
IEquatable<ContainerSize>
Inherited Members
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: Chartboost.Mediation.Ad.Banner
Assembly: Chartboost.Mediation.dll
Syntax
public readonly struct ContainerSize : IEquatable<ContainerSize>

Constructors

ContainerSize(int, int)

Initializes a new instance of the ContainerSize struct with specified width and height.

Declaration
[JsonConstructor]
public ContainerSize(int width, int height)
Parameters
Type Name Description
int width

The width of the container. Use -1 for wrap content horizontally.

int height

The height of the container. Use -1 for wrap content vertically.

Properties

Height

Gets the height of the container.

Declaration
[JsonProperty("height")]
public int Height { get; }
Property Value
Type Description
int

Width

Gets the width of the container.

Declaration
[JsonProperty("width")]
public int Width { get; }
Property Value
Type Description
int

Methods

Equals(ContainerSize)

Determines whether the specified ContainerSize is equal to the current instance.

Declaration
public bool Equals(ContainerSize other)
Parameters
Type Name Description
ContainerSize other

The ContainerSize to compare with the current instance.

Returns
Type Description
bool

true if the specified ContainerSize is equal to the current instance; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current instance.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The object to compare with the current instance.

Returns
Type Description
bool

true if the specified object is a ContainerSize and is equal to the current instance; otherwise, false.

Overrides
ValueType.Equals(object)

FixedSize(int, int)

Creates a container size with fixed dimensions.

Declaration
public static ContainerSize FixedSize(int width, int height)
Parameters
Type Name Description
int width

The fixed width of the container.

int height

The fixed height of the container.

Returns
Type Description
ContainerSize

A new ContainerSize instance.

GetHashCode()

Returns the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A 32-bit signed integer hash code.

Overrides
ValueType.GetHashCode()

WrapContent()

Creates a container size that wraps both its width and height to fit its content.

Declaration
public static ContainerSize WrapContent()
Returns
Type Description
ContainerSize

A new ContainerSize instance.

WrapHorizontal(int)

Creates a container size that automatically adjusts its width to wrap its content, with a fixed height.

Declaration
public static ContainerSize WrapHorizontal(int height)
Parameters
Type Name Description
int height

The fixed height of the container.

Returns
Type Description
ContainerSize

A new ContainerSize instance.

WrapVertical(int)

Creates a container size that automatically adjusts its height to wrap its content, with a fixed width.

Declaration
public static ContainerSize WrapVertical(int width)
Parameters
Type Name Description
int width

The fixed width of the container.

Returns
Type Description
ContainerSize

A new ContainerSize instance.

Implements

IEquatable<T>