本文整理汇总了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>() });
}
示例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);
}
示例3: cLimitAgregator
public cLimitAgregator(ILine owner, IProject project)
{
if(project == null || owner == null) throw new ArgumentNullException();
_owner = owner;
_project = project;
}
示例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;
}
示例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)
)
};
}
示例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));
}
示例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;
}
示例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;
}
示例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.");
}
}
示例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");
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例15: CreateSurveyPolylineFromLine
private static SurveyPolyline CreateSurveyPolylineFromLine(ILine line)
{
IPolyline polyline = new Polyline(line.Id,
line.RunDirection);
polyline.AddSegment(line);
return new SurveyPolyline(polyline);
}