本文整理汇总了C#中Loop.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Loop.Run方法的具体用法?C# Loop.Run怎么用?C# Loop.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loop
的用法示例。
在下文中一共展示了Loop.Run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunCommand
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
Loop loop = new Loop();
loop.Run(doc);
return Result.Success;
// TODO: start here modifying the behaviour of your command.
// ---
RhinoApp.WriteLine("The {0} command will add a line right now.", EnglishName);
Point3d pt0;
using (GetPoint getPointAction = new GetPoint())
{
getPointAction.SetCommandPrompt("Please select the start point");
if (getPointAction.Get() != GetResult.Point)
{
RhinoApp.WriteLine("No start point was selected.");
return getPointAction.CommandResult();
}
pt0 = getPointAction.Point();
}
Point3d pt1;
using (GetPoint getPointAction = new GetPoint())
{
getPointAction.SetCommandPrompt("Please select the end point");
getPointAction.SetBasePoint(pt0, true);
getPointAction.DynamicDraw +=
(sender, e) => e.Display.DrawLine(pt0, e.CurrentPoint, System.Drawing.Color.DarkRed);
if (getPointAction.Get() != GetResult.Point)
{
RhinoApp.WriteLine("No end point was selected.");
return getPointAction.CommandResult();
}
pt1 = getPointAction.Point();
}
doc.Objects.AddLine(pt0, pt1);
doc.Views.Redraw();
RhinoApp.WriteLine("The {0} command added one line to the document.", EnglishName);
// ---
return Result.Success;
}