Table of Contents

Class ExtensionsClass

Namespace
LightningChartLib.WinForms.Charting
Assembly
LightningChart.WinForms.Charting.NET4.dll

Extensions

public static class ExtensionsClass
Inheritance
ExtensionsClass
Inherited Members

Methods

CalculateGradient(Color, Color, double)

Calculate gradient from color to the other with amount given as pecents. Each channel is calculated separately and changed with channgel difference multiplied by the defined factor.

public static Color CalculateGradient(this Color colorFrom, Color colorTo, double positionPercents)

Parameters

colorFrom Color

Source color to start from.

colorTo Color

Destination color to move towards.

positionPercents double

Factor to move by, as percents. Negative and values over 100 are valid, though channel values are capped to between [0, 255].

Returns

Color

Resulting color

CopyItems(Array, Array, int)

Copy array

public static void CopyItems(this Array array, Array destination, int length)

Parameters

array Array
destination Array
length int

DisposeAllAndClear<T>(List<T>)

Disposes all items in the given list, and clears the list.

Note that the list must NOT change because of the dispose. For those situations use DisposeAllThroughCopyAndClear instead.

public static void DisposeAllAndClear<T>(this List<T> list) where T : IDisposable

Parameters

list List<T>

Type Parameters

T

DisposeAllThroughCopyAndClear<T>(List<T>)

Disposes all items in the given list by first taking a copy of the list.

This is intended only for situations where the dispose change original list contents. It's preferable to use DisposeAllAndClear instead.

public static void DisposeAllThroughCopyAndClear<T>(this List<T> list) where T : IDisposable

Parameters

list List<T>

Type Parameters

T

DistanceSquareTo(PointDouble2D, PointDouble2D)

Square distance between two points

public static double DistanceSquareTo(this PointDouble2D from, PointDouble2D dest)

Parameters

from PointDouble2D
dest PointDouble2D

Returns

double

DistanceSquareTo(PointFloat, PointFloat)

Square distance between two points

public static double DistanceSquareTo(this PointFloat from, PointFloat dest)

Parameters

from PointFloat
dest PointFloat

Returns

double

GatherApplicationInformation(LightningChart, GatherDataOptions, string, string)

Gathers various information from the current chart for debugging purposes as a string by calling GatherApplicationInformation(GatherDataOptions, LightningChart, string, string) Optionally saves the output to a text file if file path and file name are specified. Gathered data (if ChartTools.GatherDataOptions is set to All): system information, chart information, list of running processes, DxDiag output, installed Windows hotfixes.

public static string GatherApplicationInformation(this LightningChart chart, ChartTools.GatherDataOptions options, string path = null, string fileName = null)

Parameters

chart LightningChart

Chart to collect data from.

options ChartTools.GatherDataOptions

Data gathering options flags. See ChartTools.GatherDataOptions.

path string

Path to folder where file is saved (optional, if not specified the data won't be saved to a file and just returned as a string).

fileName string

Output text file filename (optional, if not specified the default name is created with timestamp)

Returns

string

The gathered data as a string.

GetItemCount(Array)

Get item counter

public static int GetItemCount(this Array array)

Parameters

array Array

Returns

int

RemoveAndDispose(IList, int)

Removes item from the list and then disposes it.

public static void RemoveAndDispose(this IList list, int i)

Parameters

list IList
i int

RemoveAndDispose<T>(IList<T>, int)

Removes item from the list and then disposes it.

public static void RemoveAndDispose<T>(this IList<T> list, int i) where T : IDisposable

Parameters

list IList<T>
i int

Type Parameters

T

ToCurrentPlat(Color)

Convert given color to currently active platform.

public static Color ToCurrentPlat(this Color color)

Parameters

color Color

Returns

Color

ToLongString(RendererDeviceType)

Change device types to long strings

public static string ToLongString(this RendererDeviceType rdi)

Parameters

rdi RendererDeviceType

Returns

string

ToPlatSize(SizeInt)

To WinForm size

public static Size ToPlatSize(this SizeInt size)

Parameters

size SizeInt

Returns

Size

ToPublicColor(Color)

Make public color

public static Color ToPublicColor(this Color color)

Parameters

color Color

Returns

Color

ToShortString(RendererDeviceType)

Change device types to short strings

public static string ToShortString(this RendererDeviceType rdi)

Parameters

rdi RendererDeviceType

Returns

string

ToSizeInt(Size)

To SizeInt size

public static SizeInt ToSizeInt(this Size size)

Parameters

size Size

Returns

SizeInt

ToWinFormsSize(SizeInt)

To WinForm size

public static Size ToWinFormsSize(this SizeInt size)

Parameters

size SizeInt

Returns

Size