当前位置: 首页>>代码示例>>C#>>正文


C# CurveItem.GetType方法代码示例

本文整理汇总了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;
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:15,代码来源:CurveDataHandlers.cs

示例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);
        }
开发者ID:konrad-zielinski,项目名称:ZedGraph,代码行数:18,代码来源:FilledLine.cs

示例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);
                }
            }
        }
开发者ID:oghenez,项目名称:trade-software,代码行数:27,代码来源:chartTest.cs

示例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;
            }
        }
开发者ID:oghenez,项目名称:trade-software,代码行数:26,代码来源:libs.cs

示例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;
        }
开发者ID:konrad-zielinski,项目名称:ZedGraph,代码行数:8,代码来源:FilledLine.cs


注:本文中的ZedGraph.CurveItem.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。