Class Percentage
Inheritance
System.Object
Percentage
Assembly: IronPPT.dll
Syntax
public class Percentage : Object, IPercentage
Expressing a proportional amount in a presentation, such as a luminance shift or a gradient stop position, runs through Percentage. It wraps a single proportion value so the API can take a percentage in one consistent shape wherever a fraction of a whole is meant, rather than mixing raw doubles with no unit signal.
The proportion is stored in the Value property, a nullable double, which leaves a percentage unset until it is assigned. Two implicit conversions make assignment terse: a double and an int both convert straight to a Percentage, so 0.75 or 50 can be passed where one is expected. ToString renders the stored value for logging or display. Percentage implements IPercentage, the contract color-component fields like Luminance, Saturation, and Hue accept, so the same value type flows through every place a presentation needs a proportion.
Percentage opacity = 0.75;
The add shape example builds the shapes whose color and fill take these proportions, and the paragraph style example sets the styling values they feed into.
Constructors
Percentage()
Declaration
Properties
Value
Declaration
public Nullable<double> Value { get; set; }
Property Value
| Type |
Description |
| System.Nullable<System.Double> |
|
Methods
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Operators
Implicit(Double to Percentage)
Declaration
public static implicit operator Percentage(double value)
Parameters
| Type |
Name |
Description |
| System.Double |
value |
|
Returns
Implicit(Int32 to Percentage)
Declaration
public static implicit operator Percentage(int value)
Parameters
| Type |
Name |
Description |
| System.Int32 |
value |
|
Returns
Implements