本文整理汇总了C#中ILocatable类的典型用法代码示例。如果您正苦于以下问题:C# ILocatable类的具体用法?C# ILocatable怎么用?C# ILocatable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILocatable类属于命名空间,在下文中一共展示了ILocatable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BlimpCameraMan
public BlimpCameraMan(ILocatable posLoc, ILocatable lookAt)
{
Dirty = true;
Pos3d = posLoc.ToPositionAboveSeaLeveld (_altitude);
LookAt = new Location (lookAt);
LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);
}
开发者ID:jorik041,项目名称:caulker,代码行数:7,代码来源:Camera.cs
示例2: LongPressAction
/// <summary>
/// Initializes a new instance of the <see cref="LongPressAction"/> class.
/// </summary>
/// <param name="touchScreen">The <see cref="ITouchScreen"/> with which the action will be performed.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
public LongPressAction(ITouchScreen touchScreen, ILocatable actionTarget)
: base(touchScreen, actionTarget)
{
if (actionTarget == null)
{
throw new ArgumentException("Must provide a location for a single tap action.", "actionTarget");
}
}
开发者ID:BogdanLivadariu,项目名称:selenium,代码行数:13,代码来源:LongPressAction.cs
示例3: MoveMouseAction
/// <summary>
/// Initializes a new instance of the <see cref="MoveMouseAction"/> class.
/// </summary>
/// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
public MoveMouseAction(IMouse mouse, ILocatable actionTarget)
: base(mouse, actionTarget)
{
if (actionTarget == null)
{
throw new ArgumentException("Must provide a location for a move action.", "actionTarget");
}
}
开发者ID:RanchoLi,项目名称:selenium,代码行数:13,代码来源:MoveMouseAction.cs
示例4: SingleKeyAction
/// <summary>
/// Initializes a new instance of the <see cref="SingleKeyAction"/> class.
/// </summary>
/// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
/// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
/// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
protected SingleKeyAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
: base(keyboard, mouse, actionTarget)
{
if (!ModifierKeys.Contains(key))
{
throw new ArgumentException("key must be a modifier key (Keys.Shift, Keys.Control, or Keys.Alt)", "key");
}
this.key = key;
}
开发者ID:RanchoLi,项目名称:selenium,代码行数:17,代码来源:SingleKeyAction.cs
示例5: AddItem
/// <summary>
/// Adds the specified <see cref="ILocatable"/> to the <see cref="GridBucket"/> that covers
/// its current location
/// </summary>
/// <param name="item"></param>
public void AddItem(ILocatable item)
{
int x = (int)(item.XPos / _xBlockWidth);
int y = (int)(item.YPos / _yBlockHeight);
// Ensure we clamp the ceiling value
if (x == _numXBlocks) { x--; }
if (y == _numYBlocks) { y--; }
_buckets[x, y].Add(item);
}
开发者ID:Kanpai888,项目名称:AntsSimulator,代码行数:16,代码来源:WorldGrid.cs
示例6: ScrollAction
/// <summary>
/// Initializes a new instance of the <see cref="ScrollAction"/> class for use with the specified element.
/// </summary>
/// <param name="touchScreen">The <see cref="ITouchScreen"/> with which the action will be performed.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
/// <param name="offsetX">The x coordinate relative to the view port.</param>
/// <param name="offsetY">The y coordinate relative to the view port.</param>
public ScrollAction(ITouchScreen touchScreen, ILocatable actionTarget, int offsetX, int offsetY)
: base(touchScreen, actionTarget)
{
if (actionTarget == null)
{
throw new ArgumentException("Must provide a location for a single tap action.", "actionTarget");
}
this.offsetX = offsetX;
this.offsetY = offsetY;
}
开发者ID:draculavlad,项目名称:selenium,代码行数:18,代码来源:ScrollAction.cs
示例7: GetDistance
/// <summary>
/// Returns the distance between this ant and the <see cref="ILocatable"/> item
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
private float GetDistance(ILocatable target)
{
// Use pythagora
float xOffset = (float)XPos - (float)target.XPos;
float yOffset = (float)YPos - (float)target.YPos;
float xOffsetSquared = xOffset * xOffset;
float yOffsetSquared = yOffset * yOffset;
float distance = (float)Math.Sqrt(xOffset + yOffset);
return distance;
}
开发者ID:Kanpai888,项目名称:AntsSimulator,代码行数:18,代码来源:Ant.cs
示例8: VectorTo
public static Vector2 VectorTo(this ILocatable fr, ILocatable to)
{
return new Vector2((float)(to.Longitude - fr.Longitude),
(float)(to.Latitude - fr.Latitude));
}
开发者ID:jorik041,项目名称:caulker,代码行数:5,代码来源:Location.cs
示例9: MoveToOffsetAction
/// <summary>
/// Initializes a new instance of the <see cref="MoveToOffsetAction"/> class.
/// </summary>
/// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
/// <param name="offsetX">The horizontal offset from the origin of the target to which to move the mouse.</param>
/// <param name="offsetY">The vertical offset from the origin of the target to which to move the mouse.</param>
public MoveToOffsetAction(IMouse mouse, ILocatable actionTarget, int offsetX, int offsetY)
: base(mouse, actionTarget)
{
this.offsetX = offsetX;
this.offsetY = offsetY;
}
开发者ID:kaushik9k,项目名称:Selenium2,代码行数:13,代码来源:MoveToOffsetAction.cs
示例10: ButtonReleaseAction
/// <summary>
/// Initializes a new instance of the <see cref="ButtonReleaseAction"/> class.
/// </summary>
/// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
public ButtonReleaseAction(IMouse mouse, ILocatable actionTarget)
: base(mouse, actionTarget)
{
}
开发者ID:v4viveksharma90,项目名称:selenium,代码行数:9,代码来源:ButtonReleaseAction.cs
示例11: LocLinAnim
public LocLinAnim(double duration, ILocatable start, ILocatable end)
{
_start = new Location(start);
_end = new Location(end);
_current = _start;
_duration = duration;
}
开发者ID:jorik041,项目名称:caulker,代码行数:7,代码来源:Camera.cs
示例12: SendKeysAction
/// <summary>
/// Initializes a new instance of the <see cref="SendKeysAction"/> class.
/// </summary>
/// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
/// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
/// <param name="keysToSend">The key sequence to send.</param>
public SendKeysAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string keysToSend)
: base(keyboard, mouse, actionTarget)
{
this.keysToSend = keysToSend;
}
开发者ID:v4viveksharma90,项目名称:selenium,代码行数:12,代码来源:SendKeysAction.cs
示例13: CalculateDragElementRect
/// <summary>
/// Returns a Rect which describes the bounds of the element being dragged.
/// </summary>
private Rect CalculateDragElementRect(ILocatable el, double newHorizOffset, double newVertOffset, bool modLeftOffset, bool modTopOffset)
{
//if(this.elementsBeingDragged.Count == 0)
// throw new InvalidOperationException("ElementBeingDragged is null.");
//double xMin = 10000000.0;
//double yMin = 10000000.0;
//double xMax = -10000000.0;
//double yMax = -10000000.0;
//foreach (UIElement el in this.elementsBeingDragged)
//{
// double elX = Canvas.GetLeft(el);
// double elY = Canvas.GetTop(el);
// xMin = Math.Min(xMin, elX);
// yMin = Math.Min(yMin, elY);
// xMax = Math.Max(xMax, elX + el.RenderSize.Width);
// yMax = Math.Max(yMax, elY + el.RenderSize.Height);
//}
//Size elemSize = new Size(xMax - xMin, yMax - yMin);
//if (this.ElementBeingDragged == null)
// throw new InvalidOperationException("ElementBeingDragged is null.");
//Size elemSize = this.elementsBeingDragged.RenderSize;
//Size elemSize = el.RenderSize;
Size elemSize = new Size(el.Width, el.Height);
double x, y;
if (modLeftOffset)
x = newHorizOffset;
else
x = this.ActualWidth - newHorizOffset - elemSize.Width;
if (modTopOffset)
y = newVertOffset;
else
y = this.ActualHeight - newVertOffset - elemSize.Height;
Point elemLoc = new Point(x, y);
return new Rect(elemLoc, elemSize);
}
开发者ID:romeo08437,项目名称:Dynamo,代码行数:48,代码来源:DragCanvas.cs
示例14: KeyDownAction
/// <summary>
/// Initializes a new instance of the <see cref="KeyDownAction"/> class.
/// </summary>
/// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
/// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
/// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
public KeyDownAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
: base(keyboard, mouse, actionTarget, key)
{
}
开发者ID:asynchrony,项目名称:Selenium2,代码行数:11,代码来源:KeyDownAction.cs
示例15: KeyboardAction
/// <summary>
/// Initializes a new instance of the <see cref="KeyboardAction"/> class.
/// </summary>
/// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
/// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
/// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
protected KeyboardAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget)
: base(actionTarget)
{
this.keyboard = keyboard;
this.mouse = mouse;
}
开发者ID:v4viveksharma90,项目名称:selenium,代码行数:12,代码来源:KeyboardAction.cs
示例16: Location
public Location(ILocatable loc)
{
Longitude = loc.Longitude;
Latitude = loc.Latitude;
}
开发者ID:jorik041,项目名称:caulker,代码行数:5,代码来源:Location.cs
示例17: SetLookAt
public void SetLookAt(ILocatable lookAt, bool animated)
{
}
开发者ID:jorik041,项目名称:caulker,代码行数:3,代码来源:Camera.cs
示例18: Scale
public void Scale(ILocatable loc, float scale)
{
var toCam = (Pos3d - LookAt3d);
var dist = toCam.Length;
var sdist = dist / scale;
toCam.Normalize();
var newPos = LookAt3d + toCam * sdist;
var alt = newPos.Length - Location.EarthRadiusInKm;
_altitude = (float)alt;
if (_altitude > 12500.0f) _altitude = 12500.0f;
if (_altitude < 0.03f) _altitude = 0.03f;
Pos3d = _pos.ToPositionAboveSeaLeveld(_altitude);
Dirty = true;
}
开发者ID:jorik041,项目名称:caulker,代码行数:19,代码来源:Camera.cs
示例19: Rotate
public void Rotate(ILocatable loc, float ddegs)
{
_pos = _pos.RotateAround(loc, ddegs);
LookAt = LookAt.RotateAround(loc, ddegs);
Pos3d = _pos.ToPositionAboveSeaLeveld (_altitude);
LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);
Dirty = true;
}
开发者ID:jorik041,项目名称:caulker,代码行数:10,代码来源:Camera.cs
示例20: ManualCameraMan
public ManualCameraMan(ILocatable posLoc, ILocatable lookAt)
{
Dirty = true;
_pos = new Location(posLoc);
Pos3d = _pos.ToPositionAboveSeaLeveld (_altitude);
LookAt = new Location (lookAt);
LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);
}
开发者ID:jorik041,项目名称:caulker,代码行数:8,代码来源:Camera.cs
注:本文中的ILocatable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论