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


C# ILine类代码示例

本文整理汇总了C#中ILine的典型用法代码示例。如果您正苦于以下问题:C# ILine类的具体用法?C# ILine怎么用?C# ILine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ILine类属于命名空间,在下文中一共展示了ILine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Convert

 public static void Convert(ILine oldLine, ILine newLine)
 {
     var drawing = oldLine.Drawing;
     newLine.Style = oldLine.Style;
     Actions.ReplaceWithNew(oldLine, newLine);
     drawing.RaiseUserIsAddingFigures(new Drawing.UIAFEventArgs() { Figures = newLine.AsEnumerable<IFigure>() });
 }
开发者ID:ondrej11,项目名称:o106,代码行数:7,代码来源:LineTwoPoints.cs

示例2: LineDetails

 public LineDetails(ILine line, IDelimiterFinder finder, string delimiter, int minIndex, int tabSize)
 {
     var withoutTabs = line.Text.ReplaceTabs(tabSize);
     Line            = line;
     Index           = finder.GetIndex(line.Text,   delimiter, minIndex, tabSize);
     Position        = finder.GetIndex(withoutTabs, delimiter, minIndex, tabSize);
 }
开发者ID:NicholasBuse,项目名称:codealignment,代码行数:7,代码来源:LineDetails.cs

示例3: cLimitAgregator

        public cLimitAgregator(ILine owner, IProject project)
        {
            if(project == null || owner == null) throw new ArgumentNullException();

            _owner = owner;
            _project = project;
        }
开发者ID:NickJ1984,项目名称:alterPlanner,代码行数:7,代码来源:cLimitAgregator.cs

示例4: LineSelection

 /// <summary>
 /// Initialize new instance of <see cref="LineSelection"/> class.
 /// </summary>
 /// <param name="layer">The selection shapes layer.</param>
 /// <param name="shape">The selected shape.</param>
 /// <param name="style">The selection shapes style.</param>
 /// <param name="point">The selection point shape.</param>
 public LineSelection(XLayer layer, ILine shape, ShapeStyle style, BaseShape point)
 {
     _layer = layer;
     _line = shape;
     _style = style;
     _point = point;
 }
开发者ID:Core2D,项目名称:Core2D,代码行数:14,代码来源:LineSelection.cs

示例5: CalculateIntersectionPoint

        private IPoint[] CalculateIntersectionPoint(ILine line, ILine anotherLine)
        {
            double answer;
            if ((answer = GetHasIntersectionAnswer(line, anotherLine)) == 0)
                return new IPoint[0];

            var intersectionPointOnLine = (((anotherLine.EndingPoint.XCoordinate - anotherLine.StartingPoint.XCoordinate)*
                       (line.StartingPoint.YCoordinate - anotherLine.StartingPoint.YCoordinate)) -
                      ((anotherLine.EndingPoint.YCoordinate - anotherLine.StartingPoint.YCoordinate)*
                       (line.StartingPoint.XCoordinate - anotherLine.StartingPoint.XCoordinate)))/answer;

            var intersectionPointOnAnotherLine = (((line.EndingPoint.XCoordinate - line.StartingPoint.XCoordinate)*
                       (line.StartingPoint.YCoordinate - anotherLine.StartingPoint.YCoordinate)) -
                      ((line.EndingPoint.YCoordinate - line.StartingPoint.YCoordinate)*
                       (line.StartingPoint.XCoordinate - anotherLine.StartingPoint.XCoordinate)))/answer;

            if ((intersectionPointOnLine < 0) || (intersectionPointOnLine > 1) || (intersectionPointOnAnotherLine < 0) || (intersectionPointOnAnotherLine > 1))
            return new IPoint[0];

            return new IPoint[]
                {
                    new Point(
                        line.StartingPoint.XCoordinate +
                        intersectionPointOnLine*(line.EndingPoint.XCoordinate - line.StartingPoint.XCoordinate),
                        line.StartingPoint.YCoordinate +
                        intersectionPointOnLine*(line.EndingPoint.YCoordinate - line.StartingPoint.YCoordinate)
                        )
                };
        }
开发者ID:JasonvanBrackel,项目名称:Rectangles,代码行数:29,代码来源:LineIntersectionService.cs

示例6: Normalize

 private static void Normalize(ILine line, Line normalized)
 {
     var max = line.Max ?? 100.0;
     var stretch = (float)(100.0 / max);
     foreach (var point in line.Points)
         Normalize(point, normalized.AddPoint(point.Value*stretch, point.Timestamp));
 }
开发者ID:jasondentler,项目名称:YouTrackBurnDown,代码行数:7,代码来源:GraphNormalizeExtension.cs

示例7: CostForLineSwitch

        internal double CostForLineSwitch(ILine from,
                                          Constants.LineDirection fromDirection,
                                          ILine to,
                                          Constants.LineDirection toDirection)
        {
            double cost = double.MaxValue;

            if ( fromDirection == Constants.LineDirection.Forward &&
                 toDirection == Constants.LineDirection.Forward )
            {
                cost = from.EndPoint.DistanceTo(to.StartPoint);
            }
            else if ( fromDirection == Constants.LineDirection.Forward &&
                      toDirection == Constants.LineDirection.Reverse )
            {
                cost = from.EndPoint.DistanceTo(to.EndPoint);
            }
            else if ( fromDirection == Constants.LineDirection.Reverse &&
                      toDirection == Constants.LineDirection.Forward )
            {
                cost = from.StartPoint.DistanceTo(to.StartPoint);
            }
            else if ( fromDirection == Constants.LineDirection.Reverse &&
                      toDirection == Constants.LineDirection.Reverse )
            {
                cost = from.StartPoint.DistanceTo(to.EndPoint);
            }

            return cost;
        }
开发者ID:tschroedter,项目名称:Selkie.WPF,代码行数:30,代码来源:CostForLineSwitchCalculator.cs

示例8: GetLines

        public ILine[] GetLines(IRectangle rectangle)
        {
            const uint linesInARectangle = 4;
            var lines = new ILine[linesInARectangle];

            lines[0] = _factory.CreateLine(rectangle.StartingPoint.XCoordinate,
                                           rectangle.StartingPoint.YCoordinate,
                                           rectangle.EndingPoint.XCoordinate,
                                           rectangle.StartingPoint.YCoordinate);

            lines[1] = _factory.CreateLine(rectangle.EndingPoint.XCoordinate,
                                           rectangle.StartingPoint.YCoordinate,
                                           rectangle.EndingPoint.XCoordinate,
                                           rectangle.EndingPoint.YCoordinate);

            lines[2] = _factory.CreateLine(rectangle.EndingPoint.XCoordinate,
                                           rectangle.EndingPoint.YCoordinate,
                                           rectangle.StartingPoint.XCoordinate,
                                           rectangle.EndingPoint.YCoordinate);

            lines[3] = _factory.CreateLine(rectangle.StartingPoint.XCoordinate,
                                           rectangle.EndingPoint.YCoordinate,
                                           rectangle.StartingPoint.XCoordinate,
                                           rectangle.StartingPoint.YCoordinate);

            return lines;
        }
开发者ID:JasonvanBrackel,项目名称:Rectangles,代码行数:27,代码来源:RectangleDecomposer.cs

示例9: Reconnect

        public static void Reconnect(ICanvas canvas,
            ILine line, IElement splitPin,
            double x, double y,
            List<Connection> connections,
            ILine currentLine,
            IDiagramCreator creator)
        {
            var wire1 = connections[0].Wires.FirstOrDefault();
            var wire2 = connections[1].Wires.FirstOrDefault();
            var startRoot = (wire1.Start != null ? wire1.Start : wire2.Start) as IElement;
            var endRoot = (wire1.End != null ? wire1.End : wire2.End) as IElement;

            PointEx start;
            PointEx end;
            GetLocation(wire1, wire2, out start, out end);

            if (start != null && end != null)
            {
                var startLine = Connect(canvas, startRoot, currentLine, start.X, start.Y, creator);
                var splitLine = Connect(canvas, splitPin, startLine, x, y, creator);
                var endLine = Connect(canvas, splitPin, splitLine, x, y, creator);

                Connect(canvas, endRoot, endLine, start.X + end.X, start.Y + end.Y, creator);

                startLine.SetStartVisible(line.GetStartVisible());
                startLine.SetStartIO(line.GetStartIO());
                endLine.SetEndVisible(line.GetEndVisible());
                endLine.SetEndIO(line.GetEndIO());
            }
            else
            {
                throw new InvalidOperationException("LineEx must have Start and End points.");
            }
        }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:34,代码来源:WireEditor.cs

示例10: AssertLine

 private static void AssertLine(ILine actual,
                                int expectedId,
                                double expectedX1,
                                double expectedY1,
                                double expectedX2,
                                double expectedY2,
                                bool isUnknown,
                                Constants.LineDirection direction)
 {
     Assert.AreEqual(expectedId,
                     actual.Id,
                     "Id");
     Assert.AreEqual(expectedX1,
                     actual.X1,
                     "X1");
     Assert.AreEqual(expectedY1,
                     actual.Y1,
                     "Y1");
     Assert.AreEqual(expectedX2,
                     actual.X2,
                     "X2");
     Assert.AreEqual(expectedY2,
                     actual.Y2,
                     "Y2");
     Assert.AreEqual(isUnknown,
                     actual.IsUnknown,
                     "IsUnknown");
     Assert.AreEqual(direction,
                     actual.RunDirection,
                     "RunDirection");
 }
开发者ID:tschroedter,项目名称:Selkie.WPF,代码行数:31,代码来源:TestLinesDtoToLinesConverterTests.cs

示例11: Contains

        public bool Contains(ILine innerLine)
        {
            //Derived from http://stackoverflow.com/questions/328107/how-can-you-determine-a-point-is-between-two-other-points-on-a-line-segment
            if (Equals(innerLine))
                return true;

            return Contains(innerLine.StartingPoint) && Contains(innerLine.EndingPoint);
        }
开发者ID:JasonvanBrackel,项目名称:Rectangles,代码行数:8,代码来源:Line.cs

示例12: dependDotAdapter

 public dependDotAdapter(object ownerSender, IId IDinterface, ILine LineInterface)
 {
     if(ownerSender == null || IDinterface == null || LineInterface == null) 
         throw new ArgumentNullException();
     sender = ownerSender;
     parentID = IDinterface;
     line = LineInterface;
 }
开发者ID:shketbox,项目名称:alterPlanner,代码行数:8,代码来源:dependDotAdapter.cs

示例13: Class

 public Class(IOpenBraceStatement OpenBraceStatementBase, ILine Line, ILiveStatement LiveStatementBase, System.Boolean Public = false, System.Collections.Generic.List<System.String> Implements = null, System.String Name = null)
 {
     this.OpenBraceStatementBase = OpenBraceStatementBase;
     this.Public = Public;
     this.Line = Line;
     this.LiveStatementBase = LiveStatementBase;
     this.Implements = Implements;
     this.Name = Name;
 }
开发者ID:bahrus,项目名称:teaspoon,代码行数:9,代码来源:ICurlyBraceParser.defaultImpl.cs

示例14: Insert

 public bool Insert(ILine line, int position, string text)
 {
     if (UnmanagedExports.insertTextCallback != null)
     {
         UnmanagedExports.insertTextCallback(line.Position + position, text);
         return true;
     }
     return false;
 }
开发者ID:NicholasBuse,项目名称:codealignment,代码行数:9,代码来源:Edit.cs

示例15: CreateSurveyPolylineFromLine

        private static SurveyPolyline CreateSurveyPolylineFromLine(ILine line)
        {
            IPolyline polyline = new Polyline(line.Id,
                                              line.RunDirection);

            polyline.AddSegment(line);

            return new SurveyPolyline(polyline);
        }
开发者ID:tschroedter,项目名称:Selkie.WPF,代码行数:9,代码来源:SurveyFeatureSource.cs


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