本文整理汇总了C#中ZedGraph.CurveItem.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# CurveItem.GetType方法的具体用法?C# CurveItem.GetType怎么用?C# CurveItem.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZedGraph.CurveItem
的用法示例。
在下文中一共展示了CurveItem.GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindCurveHandler
/// <summary>
/// Returns a new instance of a <see cref="ICurveDataHandler"/> appropriate for the
/// <paramref name="curveItem"/>.
/// </summary>
public static ICurveDataHandler FindCurveHandler(CurveItem curveItem)
{
var handlerClass = curveItem.GetType().GetCustomAttributes(typeof (CurveDataHandlerAttribute), true)
.Cast<CurveDataHandlerAttribute>().Select(attribute=>attribute.Class)
.FirstOrDefault() ??
((curveItem is HiLowBarItem) ? typeof (HiLowBarDataHandler) : typeof (CurveDataHandler));
var constructorInfo = handlerClass.GetConstructor(new Type[0]);
if (constructorInfo != null)
return (ICurveDataHandler) constructorInfo.Invoke(new object[0]);
return null;
}
示例2: CloseCurve
public override void CloseCurve(GraphPane pane, CurveItem curve, PointF[] arrPoints, int count, double yMin, System.Drawing.Drawing2D.GraphicsPath path)
{
if(pane.LineType == LineType.Stack)
throw new NotSupportedException("Filled lines cannot be stacked");
FilledLineItem filledCurve = curve as FilledLineItem;
if(filledCurve == null)
throw new ArgumentException("Curve was of the wrong type. Expected FilledLineItem but was " + curve.GetType(), "curve");
// Build another points array consisting of the low points (It gets these from the LowerPoints property of the curve)
PointF[] arrPoints2;
int count2;
BuildLowPointsArray(pane, curve, out arrPoints2, out count2);
// Add the new points to the GraphicsPath
float tension = _isSmooth ? _smoothTension : 0f;
path.AddCurve(arrPoints2, 0, count2 - 2, tension);
}
示例3: UpdatePrice
private void UpdatePrice(int noOfUpdate, CurveItem curve)
{
this.ShowMessage("Update " + noOfUpdate.ToString());
IPointListEdit list = curve.Points as IPointListEdit;
int lastPos = list.Count - 1;
if (curve.GetType() == typeof(JapaneseCandleStickItem))
{
if (lastPos >= 0)(list as StockPointList).RemoveAt(lastPos);
for (int idx = Math.Max(0, lastPos); idx < myData.DateTime.Count; idx++)
{
StockPt item = new StockPt(myData.DateTime[idx], myData.High.Values[idx], myData.Low.Values[idx],
myData.Open.Values[idx], myData.Close.Values[idx], myData.Volume.Values[idx]);
(list as StockPointList).Add(item);
}
}
else
{
if (lastPos >= 0) (list as PointPairList).RemoveAt(lastPos);
for (int idx = Math.Max(0,lastPos); idx < myData.DateTime.Count; idx++)
{
PointPair item = new PointPair(myData.DateTime[idx], myData.Close.Values[idx]);
(list as PointPairList).Add(item);
}
}
}
示例4: GetRangeY
public static void GetRangeY(CurveItem curve,int fromId, int toId,ref ValueRange range)
{
if (curve.GetType() == typeof(JapaneseCandleStickItem))
{
GetRangeY((curve as JapaneseCandleStickItem), fromId, toId, ref range);
return;
}
if (curve.GetType() == typeof(LineItem))
{
GetRangeY((curve as LineItem), fromId, toId, ref range);
return;
}
if (curve.GetType() == typeof(BarItem))
{
GetRangeY((curve as BarItem), fromId, toId, ref range);
return;
}
if (curve.GetType() == typeof(StickItem))
{
GetRangeY((curve as StickItem), fromId, toId, ref range);
return;
}
}
示例5: GetPointsForLowPointsArray
protected override IPointList GetPointsForLowPointsArray(CurveItem curve)
{
FilledLineItem filledCurve = curve as FilledLineItem;
if (filledCurve == null)
throw new ArgumentException("Curve was of the wrong type. Expected FilledLineItem but was " + curve.GetType(), "curve");
return filledCurve.LowerPoints;
}