本文整理汇总了C#中IMouseInformation类的典型用法代码示例。如果您正苦于以下问题:C# IMouseInformation类的具体用法?C# IMouseInformation怎么用?C# IMouseInformation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMouseInformation类属于命名空间,在下文中一共展示了IMouseInformation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Track
public override bool Track(IMouseInformation mouseInformation)
{
if (_graphicBuilder != null)
return _graphicBuilder.Track(mouseInformation);
return false;
}
示例2: InsertRoadJunctionFourBlocksCommand
public InsertRoadJunctionFourBlocksCommand( IMouseInformation mouseInformation, Factories.Factories factories, IEventAggregator eventAggregator )
{
this._factories = factories;
this._mouseInformation = mouseInformation.NotNull();
this._mouseInformation.LeftButtonPressed.Subscribe( this.AddJunction );
}
示例3: Start
/// <summary>
/// Passes user input to the builder when <see cref="IMouseButtonHandler.Start"/> is called on the owning tool.
/// </summary>
/// <param name="mouseInformation">The user input data.</param>
/// <returns>True if the builder did something as a result of the call, and hence would like to receive capture; False otherwise.</returns>
public override bool Start(IMouseInformation mouseInformation)
{
// We just started creating
if (_numberOfPointsAnchored == 0)
{
this.Graphic.CoordinateSystem = CoordinateSystem.Destination;
this.Graphic.TopLeft = mouseInformation.Location;
this.Graphic.BottomRight = mouseInformation.Location;
this.Graphic.ResetCoordinateSystem();
_numberOfPointsAnchored++;
}
// We're done creating
else
{
_numberOfPointsAnchored++;
// When user moves the mouse very quickly and events are filtered for performance purpose (eg web viewer case),
// the final point may not be the same as the last tracked point. Must update the final point based on the latest mouse position.
this.Graphic.CoordinateSystem = CoordinateSystem.Destination;
this.Graphic.BottomRight = mouseInformation.Location;
this.Graphic.ResetCoordinateSystem();
this.NotifyGraphicComplete();
}
return true;
}
示例4: Start
public override bool Start(IMouseInformation mouseInformation)
{
base.Start(mouseInformation);
if (_graphicBuilder != null)
return _graphicBuilder.Start(mouseInformation);
if (!CanStart(mouseInformation.Tile.PresentationImage))
return false;
RoiGraphic roiGraphic = CreateRoiGraphic();
_graphicBuilder = CreateGraphicBuilder(roiGraphic.Subject);
_graphicBuilder.GraphicComplete += OnGraphicBuilderComplete;
_graphicBuilder.GraphicCancelled += OnGraphicBuilderCancelled;
AddRoiGraphic( mouseInformation.Tile.PresentationImage,
roiGraphic,
(IOverlayGraphicsProvider)mouseInformation.Tile.PresentationImage);
roiGraphic.Suspend();
try
{
if (_graphicBuilder.Start(mouseInformation))
return true;
}
finally
{
roiGraphic.Resume(true);
}
this.Cancel();
return false;
}
示例5: Start
public override bool Start(IMouseInformation mouseInformation)
{
this.Graphic.CoordinateSystem = CoordinateSystem.Destination;
this.Graphic.Location = mouseInformation.Location;
this.Graphic.ResetCoordinateSystem();
this.NotifyGraphicComplete();
return true;
}
示例6: Track
/// <summary>
/// Called by the framework as the mouse moves while the assigned mouse button
/// is pressed.
/// </summary>
/// <param name="e">Mouse event args</param>
/// <returns>True if the event was handled, false otherwise</returns>
public override bool Track(IMouseInformation mouseInformation)
{
if (_selectedTile == null || _selectedImageGraphic == null)
return false;
Probe(mouseInformation.Location);
return true;
}
示例7: NotifiyAboutClickedControls
public NotifiyAboutClickedControls( IMouseInformation mouseInformation, IEventAggregator eventAggregator, VisitAllChildren allControls )
{
Contract.Requires( mouseInformation != null );
Contract.Requires( eventAggregator != null );
this._mouseInformation = mouseInformation;
this._eventAggreagor = eventAggregator;
this._allControls = allControls;
this._mouseInformation.LeftButtonClicked.Subscribe( this.OnLeftButtonClicked );
}
示例8: Track
/// <summary>
/// Called by the framework when the mouse is moving and results in a transition
/// to the <see cref="FocussedGraphicState"/> when
/// the mouse hovers over the associated
/// <see cref="IStandardStatefulGraphic"/>.
/// </summary>
/// <param name="mouseInformation"></param>
/// <returns></returns>
public override bool Track(IMouseInformation mouseInformation)
{
if (this.StatefulGraphic.HitTest(mouseInformation.Location))
{
this.StatefulGraphic.State = this.StatefulGraphic.CreateFocussedSelectedState();
return true;
}
return false;
}
示例9: DebugMouseInformationModel
public DebugMouseInformationModel( IMouseInformation mouseInformation )
{
this._mouseInformation = mouseInformation;
this._mouseInformation.MousePositionChanged.Where( t => this.ShouldShowMousePositoion).Subscribe(t =>
{
this.MouseXPosition = this._mouseInformation.XnaXMousePosition.ToString();
this.MouseYPosition = this._mouseInformation.XnaYMousePosition.ToString();
});
this._mouseInformation.StartRecord();
}
示例10: Start
/// <summary>
/// Called by the framework when the user clicks away from the
/// associated <see cref="IStandardStatefulGraphic"/>
/// and results in a transition to the <see cref="InactiveGraphicState"/>.
/// </summary>
/// <param name="mouseInformation"></param>
/// <returns></returns>
public override bool Start(IMouseInformation mouseInformation)
{
if (!this.StatefulGraphic.HitTest(mouseInformation.Location))
{
this.StatefulGraphic.State = this.StatefulGraphic.CreateInactiveState();
return false;
}
return true;
}
示例11: InsertRoadLaneCommand
public InsertRoadLaneCommand( IMouseInformation mouseInformation, RoadLayer ownr, RoadLaneBuilder roadLaneBuilder )
{
this._mouseInformation = mouseInformation;
this._mouseInformation.LeftButtonPressed.Subscribe( this.MousePressed );
this._owner = ownr;
this._roadLaneBuilder = roadLaneBuilder;
this._roadLaneBuilder.SetOwner( ownr );
this._visitator = new VisitAllChildren( this._owner );
}
示例12: SelectToEditCommand
public SelectToEditCommand( IMouseInformation mouseInformation, Factories.Factories factories, IEventAggregator eventAggregator, VisitAllChildren allControls )
{
Contract.Requires( mouseInformation != null );
Contract.Requires( factories != null );
Contract.Requires( eventAggregator != null );
this._eventAggregator = eventAggregator;
this._mouseInformation = mouseInformation;
this._mouseInformation.LeftButtonClicked.Subscribe( this.OnLeftButtonClick );
this._allControl = allControls;
}
示例13: ConnectObjectCommand
public ConnectObjectCommand(
IMouseInformation mouseInformation,
CompositeConnectionCommand compositeConnectionCommand,
RoadLayer owner )
{
this._mouseInformation = mouseInformation;
this._compositeConnectionCommand = compositeConnectionCommand;
this._visitator = new VisitAllChildren( owner );
this._mouseInformation.LeftButtonClicked.Subscribe( this.LeftButtonClicked );
}
示例14: Track
/// <summary>
/// Called by the framework when the mouse is moving and results in a transition
/// to the <see cref="FocussedGraphicState"/> when
/// the mouse hovers over the associated <see cref="IStandardStatefulGraphic"/>.
/// </summary>
/// <param name="mouseInformation"></param>
/// <returns></returns>
public override bool Track(IMouseInformation mouseInformation)
{
// If mouse is over object, transition to focused state
if (this.StatefulGraphic.HitTest(mouseInformation.Location))
{
this.StatefulGraphic.State = this.StatefulGraphic.CreateFocussedState();
return true;
}
return false;
}
示例15: CarsRemoverCommand
public CarsRemoverCommand( IMouseInformation mouseInformation, Factories.Factories factories, IEventAggregator eventAggregator )
{
Contract.Requires( mouseInformation != null );
Contract.Requires( factories != null );
Contract.Requires( eventAggregator != null );
this._mouseInformation = mouseInformation;
this._mouseInformation.LeftButtonPressed.Subscribe( s =>
{
var carInserter = new CarsRemover( factories, s.Location );
eventAggregator.Publish( new AddControlToRoadLayer( carInserter ) );
} );
}