namespace Spectre.Console
{
///
/// Contains extension methods for .
///
public static class PaddingExtensions
{
///
/// Gets the left padding.
///
/// The padding.
/// The left padding or zero if padding is null.
public static int GetLeftSafe(this Padding? padding)
{
return padding?.Left ?? 0;
}
///
/// Gets the right padding.
///
/// The padding.
/// The right padding or zero if padding is null.
public static int GetRightSafe(this Padding? padding)
{
return padding?.Right ?? 0;
}
///
/// Gets the top padding.
///
/// The padding.
/// The top padding or zero if padding is null.
public static int GetTopSafe(this Padding? padding)
{
return padding?.Top ?? 0;
}
///
/// Gets the bottom padding.
///
/// The padding.
/// The bottom padding or zero if padding is null.
public static int GetBottomSafe(this Padding? padding)
{
return padding?.Bottom ?? 0;
}
}
}