当前位置: 首页>>代码示例>>C#>>正文


C# IMouseInformation类代码示例

本文整理汇总了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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:7,代码来源:MeasurementTool.cs

示例2: InsertRoadJunctionFourBlocksCommand

        public InsertRoadJunctionFourBlocksCommand( IMouseInformation mouseInformation, Factories.Factories factories, IEventAggregator eventAggregator )
        {
            this._factories = factories;
            this._mouseInformation = mouseInformation.NotNull();

            this._mouseInformation.LeftButtonPressed.Subscribe( this.AddJunction );
        }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:7,代码来源:InsertRoadJunction_FourBlocksCommand.cs

示例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;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:33,代码来源:InteractiveBoundableGraphicBuilder.cs

示例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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:34,代码来源:MeasurementTool.cs

示例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;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:8,代码来源:InteractiveTextAreaBuilder.cs

示例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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:15,代码来源:MprProbeTool.cs

示例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 );
 }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:9,代码来源:NotifiyAboutClickedControls.cs

示例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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:18,代码来源:SelectedGraphicState.cs

示例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();
 }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:10,代码来源:DebugMouseInformation.cs

示例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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:17,代码来源:SelectedGraphicState.cs

示例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 );
        }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:10,代码来源:InsertRoadLaneCommand.cs

示例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;
 }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:10,代码来源:SelectToEditCommand.cs

示例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 );
        }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:11,代码来源:ConnectObjectCommand.cs

示例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;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:18,代码来源:InactiveGraphicState.cs

示例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 ) );
                         } );
 }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:12,代码来源:CarsRemoverCommand.cs


注:本文中的IMouseInformation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。