Thickness Summary Defines the thickness of the frame around the rectangle.
Signature
public sealed struct Thickness : ValueType
Namespace cAlgo.API
Examples Example 1 (C#) Example 2 (PYTHON)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 using cAlgo.API ;
namespace cAlgo
{
// This sample shows how to use Thickness for defining a chart control margin
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class ThicknessSample : Indicator
{
protected override void Initialize ()
{
var stackPanel = new StackPanel
{
HorizontalAlignment = HorizontalAlignment . Center ,
VerticalAlignment = VerticalAlignment . Center ,
BackgroundColor = Color . Gold ,
Opacity = 0.6
};
var rectangle = new Rectangle
{
StrokeColor = Color . Blue ,
FillColor = Color . Red ,
StrokeThickness = 2 ,
Margin = new Thickness ( 10 , 5 , 10 , 5 ),
Width = 300 ,
Height = 100 ,
};
stackPanel . AddChild ( rectangle );
Chart . AddControl ( stackPanel );
}
public override void Calculate ( int index )
{
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import clr
clr . AddReference ( "cAlgo.API" )
from cAlgo.API import *
class Test ():
def initialize ( self ):
stackPanel = StackPanel ()
stackPanel . BackgroundColor = Color . Gold
stackPanel . HorizontalAlignment = HorizontalAlignment . Center
stackPanel . VerticalAlignment = VerticalAlignment . Center
stackPanel . Opacity = 0.6
rectangle = Rectangle ()
rectangle . StrokeColor = Color . Blue
rectangle . FillColor = Color . Red
rectangle . StrokeThickness = 2
rectangle . Margin = Thickness ( 10 , 5 , 10 , 5 )
rectangle . Width = 300
rectangle . Height = 100
stackPanel . AddChild ( rectangle )
api . Chart . AddControl ( stackPanel )
Methods GetHashCode Summary
Returns the hash code for this instance.
Signature
Return Value
int
Equals (2) Equals (1 of 2)
Summary
Defines whether the specified object is equal to this instance.
Signature
public bool Equals ( Thickness other )
Parameters
Name Type Description other Thickness The other Thickness object to compare with current instance
Return Value
bool
Equals (2 of 2)
Summary
Defines whether the specified object is equal to this instance.
Signature
public bool Equals ( object obj )
Parameters
Name Type Description obj object The other object to compare with current instance
Return Value
bool
ValidateAndFixValue Signature
private static double ValidateAndFixValue ( double value , bool allowNegative , bool allowPositiveInfinity , string propertyName )
Parameters
Name Type Description value double allowNegative bool allowPositiveInfinity bool propertyName string
Return Value
double
IsEqual Signature
private static bool IsEqual ( double t1Value , double t2Value )
Parameters
Name Type Description t1Value double t2Value double
Return Value
bool
Properties Top Summary
Gets or sets the thickness of the top side of the retangle.
Signature
public double Top { get ; set ;}
Return Value
double
Left Summary
Gets or sets the thickness of the left side of the retangle.
Signature
public double Left { get ; set ;}
Return Value
double
Bottom Summary
Gets or sets the thickness of the bottom side of the retangle.
Signature
public double Bottom { get ; set ;}
Return Value
double
Right Summary
Gets or sets the thickness of the right side of the retangle.
Signature
public double Right { get ; set ;}
Return Value
double