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


C# Command.AddTag方法代码示例

本文整理汇总了C#中Command.AddTag方法的典型用法代码示例。如果您正苦于以下问题:C# Command.AddTag方法的具体用法?C# Command.AddTag怎么用?C# Command.AddTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Command的用法示例。


在下文中一共展示了Command.AddTag方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Preview

 public override void Preview(string contentName)
 {
     verdana = ContentLoader.Load<Font>("Verdana12");
     new FontText(verdana, "Play", Rectangle.One);
     sound = ContentLoader.Load<Sound>(contentName);
     var trigger = new MouseButtonTrigger();
     trigger.AddTag("temporary");
     var soundCommand = new Command(() => sound.Play(1)).Add(trigger);
     soundCommand.AddTag("temporary");
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:10,代码来源:SoundPreviewer.cs

示例2: Preview

		protected override void Preview(string contentName)
		{
			var verdana = ContentLoader.Load<Font>("Verdana12");
			new FontText(verdana, "Play", Rectangle.One);
			if (Sound != null)
				DisposeData();
			Sound = ContentLoader.Load<Sound>(contentName);
			trigger = new MouseButtonTrigger();
			trigger.AddTag("temporary");
			soundCommand = new Command(() => Sound.Play(1)).Add(trigger);
			soundCommand.AddTag("temporary");
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:12,代码来源:SoundPreviewer.cs

示例3: SetMouseCommands

		private void SetMouseCommands(string obj)
		{
			var leftClickTriggerReleasing = new MouseButtonTrigger(MouseButton.Left, State.Releasing);
			leftClickTriggerReleasing.AddTag("temporary");
			var findEntityCommand = new Command(FindEntity2DOnPosition).Add(leftClickTriggerReleasing);
			findEntityCommand.AddTag("temporary");
			var releaseMiddleMouse = new MouseButtonTrigger(MouseButton.Left, State.Releasing);
			releaseMiddleMouse.AddTag("temporary");
			var setReleasingCommand =
				new Command(position => AddControlToScene(position)).Add(releaseMiddleMouse);
			setReleasingCommand.AddTag("temporary");
			UiEditorScene.SetMousePosition();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:13,代码来源:UIEditorViewModel.cs

示例4: Preview

		protected override void Preview(string contentName)
		{
			verdana = ContentLoader.Load<Font>("Verdana12");
			new FontText(verdana, "Play/Stop", Rectangle.One);
			music = ContentLoader.Load<Music>(contentName);
			music.Play(1);
			var trigger = new MouseButtonTrigger();
			trigger.AddTag("temporary");
			var musicCommand = new Command(() => //ncrunch: no coverage start
			{
				if (music.IsPlaying())
					music.Stop();
				else
					music.Play(1);
			}).Add(trigger);
			musicCommand.AddTag("temporary");
			//ncrunch: no coverage end
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:18,代码来源:MusicPreviewer.cs

示例5: SetCommands

		public void SetCommands()
		{
			var leftClickTrigger = new MouseButtonTrigger();
			leftClickTrigger.AddTag("temporary");
			var leftClickCommand = new Command(LeftMouseButton).Add(leftClickTrigger);
			leftClickCommand.AddTag("temporary");
			var middleDragTrigger = new MouseDragTrigger(MouseButton.Middle);
			middleDragTrigger.AddTag("temporary");
			var middleDragCommand = new Command(MiddleMouseDrag).Add(middleDragTrigger);
			middleDragCommand.AddTag("temporary");
			var dragLeftTrigger = new MouseDragTrigger();
			dragLeftTrigger.AddTag("temporary");
			var dragLeftCommand = new Command(LeftMouseDrag).Add(dragLeftTrigger);
			dragLeftCommand.AddTag("temporary");
			var zoomTrigger = new MouseZoomTrigger();
			zoomTrigger.AddTag("temporary");
			var zoomCommand = new Command(Zoom).Add(zoomTrigger);
			zoomCommand.AddTag("temporary");
			var leftReleaseTrigger = new MouseButtonTrigger(State.Releasing);
			leftReleaseTrigger.AddTag("temporary");
			var leftReleaseCommand = new Command(LeftMouseRelease).Add(leftReleaseTrigger);
			leftReleaseCommand.AddTag("temporary");
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:23,代码来源:LevelEditorCommands.cs

示例6: SetMouseCommands

 private void SetMouseCommands(string obj)
 {
     var leftClickTrigger = new MouseButtonTrigger();
     leftClickTrigger.AddTag("temporary");
     var findEntityCommand = new Command(FindEntity2DOnPosition).Add(leftClickTrigger);
     findEntityCommand.AddTag("temporary");
     var moveMouse = new MousePositionTrigger(MouseButton.Left, State.Pressed);
     moveMouse.AddTag("temporary");
     var moveImageCommand =
         new Command(
             position =>
                 uiEditorScene.ControlProcessor.MoveImage(position, SelectedEntity2D, Adder.IsDragging,
                     uiEditorScene.IsSnappingToGrid, uiEditorScene)).Add(moveMouse);
     moveImageCommand.AddTag("temporary");
     var middleMouseClick = new MouseButtonTrigger(MouseButton.Middle);
     middleMouseClick.AddTag("temporary");
     var setLastPositionCommand =
         new Command(position => uiEditorScene.ControlProcessor.lastMousePosition = position).Add(
             middleMouseClick);
     setLastPositionCommand.AddTag("temporary");
     var releaseMiddleMouse = new MouseButtonTrigger(MouseButton.Left, State.Releasing);
     releaseMiddleMouse.AddTag("temporary");
     var setReleasingCommand =
         new Command(position => SetCommandsForReleasing(position)).Add(releaseMiddleMouse);
     setReleasingCommand.AddTag("temporary");
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:26,代码来源:UIEditorViewModel.cs

示例7: CreateViewportCommands

 private static void CreateViewportCommands(Service service)
 {
     var dragTrigger = new MouseDragTrigger(Input.MouseButton.Middle);
     dragTrigger.AddTag("ViewControl");
     var zoomTrigger = new MouseZoomTrigger();
     zoomTrigger.AddTag("ViewControl");
     var panningCommand = new Command(service.Viewport.OnViewportPanning).Add(dragTrigger);
     var zoomCommand = new Command(service.Viewport.OnViewPortZooming).Add(zoomTrigger);
     panningCommand.AddTag("ViewControl");
     zoomCommand.AddTag("ViewControl");
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:11,代码来源:ViewportControl.xaml.cs

示例8: SetMousePosition

		public void SetMousePosition()
		{
			var middleClick = new MouseButtonTrigger();
			middleClick.AddTag("temporary");
			var setLastPositionCommand = new Command(position => SetPosition(position)).Add(middleClick);
			setLastPositionCommand.AddTag("temporary");
			var moveMouse = new MousePositionTrigger(MouseButton.Left, State.Released);
			moveMouse.AddTag("temporary");
			var checkTransformationCommand =
				new Command(position => CheckIfCanTransformControl(position)).Add(moveMouse);
			checkTransformationCommand.AddTag("temporary");
			var pressAndMoveMouse = new MousePositionTrigger(MouseButton.Left, State.Pressed);
			pressAndMoveMouse.AddTag("temporary");
			var pressOnControlCommand =
				new Command(position => TransformSelectedControl(position)).Add(pressAndMoveMouse);
			pressOnControlCommand.AddTag("temporary");
			var pressControl = new KeyTrigger(Key.LeftControl);
			pressControl.AddTag("temporary");
			var multiSelectControl = new Command(() => SetMultiSelection(true)).Add(pressControl);
			multiSelectControl.AddTag("temporary");
			var releaseControl = new KeyTrigger(Key.LeftControl, State.Releasing);
			releaseControl.AddTag("temporary");
			var disableMultiSelectControl =
				new Command(() => SetMultiSelection(false)).Add(releaseControl);
			disableMultiSelectControl.AddTag("temporary");
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:26,代码来源:UIEditorScene.cs


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