本文整理汇总了C#中Treefrog.Presentation.Tools.PointerEventInfo类的典型用法代码示例。如果您正苦于以下问题:C# PointerEventInfo类的具体用法?C# PointerEventInfo怎么用?C# PointerEventInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointerEventInfo类属于Treefrog.Presentation.Tools命名空间,在下文中一共展示了PointerEventInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowPreviewMarker
private void ShowPreviewMarker(PointerEventInfo info)
{
if (ActiveObjectClass == null)
return;
if (ActiveObjectClass != _activeClass) {
HidePreviewMarker();
_previewMarker = null;
_activeClass = ActiveObjectClass;
}
if (!_previewMarkerVisible) {
if (_previewMarker == null) {
_previewMarker = new ImageAnnot() {
Image = ActiveObjectClass.Image,
BlendColor = new Color(255, 255, 255, 128),
};
}
_annots.Add(_previewMarker);
_previewMarkerVisible = true;
}
Point xlat = new Point((int)info.X - _activeClass.ImageBounds.Width / 2, (int)info.Y - _activeClass.ImageBounds.Height / 2);
if (SnapManager != null)
xlat = SnapManager.Translate(xlat, SnappingTarget);
_previewMarker.Position = xlat;
}
示例2: EndPointerSequenceCore
protected override void EndPointerSequenceCore(PointerEventInfo info, ILevelGeometry viewport)
{
switch (info.Type) {
case PointerEventType.Primary:
EndSelectTilesSequence(info, viewport);
break;
}
}
示例3: StartPointerSequenceCore
protected override void StartPointerSequenceCore(PointerEventInfo info, ILevelGeometry viewport)
{
switch (info.Type) {
case PointerEventType.Primary:
StartFillSequence(info);
break;
}
UpdatePointerSequence(info, viewport);
}
示例4: EndPointerSequenceCore
protected override void EndPointerSequenceCore(PointerEventInfo info, ILevelGeometry viewport)
{
_state = _state.EndPointerSequence(info, viewport);
/*switch (info.Type) {
case PointerEventType.Primary:
EndSelectObjectSequence(info, viewport);
break;
}*/
}
示例5: PointerPositionCore
protected override void PointerPositionCore(PointerEventInfo info, ILevelGeometry viewport)
{
TileCoord location = TileLocation(info);
if (!TileInRange(location) || _inAreaSequence) {
HidePreviewMarker();
return;
}
ShowPreviewMarker(location);
}
示例6: EndPointerSequenceCore
protected override void EndPointerSequenceCore(PointerEventInfo info, ILevelGeometry viewport)
{
switch (info.Type) {
case PointerEventType.Primary:
EndErasePathSequence(info);
break;
case PointerEventType.Secondary:
EndEraseAreaSequence(info, viewport);
break;
}
}
示例7: StartPointerSequenceCore
protected override void StartPointerSequenceCore(PointerEventInfo info, ILevelGeometry viewport)
{
switch (info.Type) {
case PointerEventType.Primary:
StartSelectTilesSequence(info, viewport);
break;
case PointerEventType.Secondary:
DefloatSelection();
break;
}
UpdatePointerSequence(info, viewport);
}
示例8: StartPointerSequenceCore
protected override void StartPointerSequenceCore(PointerEventInfo info, ILevelGeometry viewport)
{
switch (info.Type) {
case PointerEventType.Primary:
StartDrawObjectSequence(info);
break;
case PointerEventType.Secondary:
Cancel();
break;
}
UpdatePointerSequence(info, viewport);
}
示例9: StartPointerSequenceCore
protected override void StartPointerSequenceCore(PointerEventInfo info, ILevelGeometry viewport)
{
_state = _state.StartPointerSequence(info, viewport);
/*switch (info.Type) {
case PointerEventType.Primary:
StartSelectObjectSequence(info, viewport);
break;
case PointerEventType.Secondary:
_selectionManager.ClearSelection();
if (_rotationAnnot != null) {
_annots.Remove(_rotationAnnot);
_rotationAnnot = null;
}
UpdatePropertyProvider();
break;
}*/
UpdatePointerSequence(info, viewport);
}
示例10: UpdateErasePathSequence
private void UpdateErasePathSequence(PointerEventInfo info)
{
TileCoord location = TileLocation(info);
if (!TileInRange(location))
return;
if (Layer[location] != null && Layer[location].Count > 0) {
_drawCommand.QueueReplacement(location, (TileStack)null);
Layer[location] = null;
}
}
示例11: UpdateEraseAreaSequenceCommon
private void UpdateEraseAreaSequenceCommon(PointerEventInfo info, ILevelGeometry viewport)
{
TileCoord location = TileLocation(info);
int x = Math.Max(0, Math.Min(Layer.TilesWide - 1, location.X)) * Layer.TileWidth;
int y = Math.Max(0, Math.Min(Layer.TilesHigh - 1, location.Y)) * Layer.TileHeight;
_band.End = new Point(location.X, location.Y);
Rectangle selection = _band.Selection;
_selection.Start = new Point(selection.Left * Layer.TileWidth, selection.Top * Layer.TileHeight);
_selection.End = new Point(selection.Right * Layer.TileWidth, selection.Bottom * Layer.TileHeight);
}
示例12: UpdateEraseAreaSequence
private void UpdateEraseAreaSequence(PointerEventInfo info, ILevelGeometry viewport)
{
UpdateEraseAreaSequenceCommon(info, viewport);
UpdateAutoScroll(info, viewport);
}
示例13: StartErasePathSequence
private void StartErasePathSequence(PointerEventInfo info)
{
_drawCommand = new TileReplace2DCommand(Layer);
}
示例14: StartEraseAreaSequence
private void StartEraseAreaSequence(PointerEventInfo info, ILevelGeometry viewport)
{
HidePreviewMarker();
TileCoord location = TileLocation(info);
int x = (int)(location.X * Layer.TileWidth);
int y = (int)(location.Y * Layer.TileHeight);
_band = new RubberBand(new Point(location.X, location.Y));
_selection = new SelectionAnnot(new Point(x, y))
{
Fill = new SolidColorBrush(new Color(192, 0, 0, 128)),
//Outline = new Pen(new SolidColorBrush(new Color(192, 0, 0, 200))),
};
_annots.Add(_selection);
_inAreaSequence = true;
StartAutoScroll(info, viewport);
}
示例15: EndErasePathSequence
private void EndErasePathSequence(PointerEventInfo info)
{
History.Execute(_drawCommand);
}