本文整理汇总了C#中ILocatable类的典型用法代码示例。如果您正苦于以下问题:C# ILocatable类的具体用法?C# ILocatable怎么用?C# ILocatable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILocatable类属于命名空间,在下文中一共展示了ILocatable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BlimpCameraMan
public BlimpCameraMan(ILocatable posLoc, ILocatable lookAt)
{
Dirty = true;
Pos3d = posLoc.ToPositionAboveSeaLeveld (_altitude);
LookAt = new Location (lookAt);
LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);
}
示例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");
}
}
示例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");
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例8: VectorTo
public static Vector2 VectorTo(this ILocatable fr, ILocatable to)
{
return new Vector2((float)(to.Longitude - fr.Longitude),
(float)(to.Latitude - fr.Latitude));
}
示例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;
}
示例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)
{
}
示例11: LocLinAnim
public LocLinAnim(double duration, ILocatable start, ILocatable end)
{
_start = new Location(start);
_end = new Location(end);
_current = _start;
_duration = duration;
}
示例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;
}
示例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);
}
示例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)
{
}
示例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;
}