Example #1
0
		public Rotate3DTool()
			: base(SR.TooltipRotate3D)
		{
			CursorToken = new CursorToken("Icons.Rotate3DToolSmall.png", GetType().Assembly);
			_operation = new SpatialTransform3DImageOperation(Apply);

			const string graphicName = "Icons.NoSpineLabeling.png";
			var iconSet = new UnavailableActionIconSet(new IconSet("Icons.Rotate3DToolSmall.png", "Icons.Rotate3DToolMedium.png", "Icons.Rotate3DToolLarge.png"));
			var resolver = new ApplicationThemeResourceResolver(GetType(), false);
			_flashOverlayController = new FlashOverlayController(iconSet, resolver) {FlashSpeed = 1500};
		}
		private void UpdateIcons()
		{
			var resourceResolver = new ApplicationThemeResourceResolver(GetType(), false);
			_searchButton.Image = resourceResolver.OpenImage(@"Icons.Search.png");
			_searchTodayButton.Image = resourceResolver.OpenImage(@"Icons.Today.png");
			_searchLastWeekButton.Image = resourceResolver.OpenImage(@"Icons.Last7Days.png");
			_clearButton.Image = resourceResolver.OpenImage(@"Icons.Clear.png");
		}
Example #3
0
		/// <summary>
		/// Gets a set of exported <see cref="IAction"/>s.
		/// </summary>
		/// <param name="site">The action model site at which the actions should reside.</param>
		/// <param name="mouseInformation">The mouse input when the action model was requested, such as in response to a context menu request.</param>
		/// <returns>A set of exported <see cref="IAction"/>s.</returns>
		public override IActionSet GetExportedActions(string site, IMouseInformation mouseInformation)
		{
			IResourceResolver resolver = new ApplicationThemeResourceResolver(this.GetType(), true);
			string @namespace = typeof(RoiCalloutGraphic).FullName;

			List<IAction> actions = new List<IAction>();
			MenuAction hideAction = new MenuAction(@namespace + ":toggle", new ActionPath(site + "/MenuShowAnalysis", resolver), ClickActionFlags.None, resolver);
			hideAction.GroupHint = new GroupHint("Tools.Measurements.Display");
			hideAction.Label = SR.MenuShowAnalysis;
			hideAction.Checked = this.ShowAnalysis;
			hideAction.Persistent = true;
			hideAction.SetClickHandler(this.ToggleShowAnalysis);
			actions.Add(hideAction);

			if (AllowRename)
			{
				MenuAction renameAction = new MenuAction(@namespace + ":rename", new ActionPath(site + "/MenuRename", resolver), ClickActionFlags.None, resolver);
				renameAction.GroupHint = new GroupHint("Tools.Measurements.Properties");
				renameAction.Label = SR.MenuRename;
				renameAction.Persistent = true;
				renameAction.SetClickHandler(this.Rename);
				actions.Add(renameAction);
			}

			IActionSet actionSet = new ActionSet(actions);

			if (this.ShowAnalysis)
            {
                var analyzerActionSets = GetAnalyzersExportedActions(site, mouseInformation);

                if (analyzerActionSets != null)
                {
                    foreach(var set in analyzerActionSets)
                    {
                        actionSet = actionSet.Union(set);
                    } 
                }
                   
            }

			IActionSet other = base.GetExportedActions(site, mouseInformation);
			if (other != null)
				actionSet = actionSet.Union(other);

			return actionSet;
		}
Example #4
0
		/// <summary>
		/// Gets a set of exported <see cref="IAction"/>s.
		/// </summary>
		/// <param name="site">The action model site at which the actions should reside.</param>
		/// <param name="mouseInformation">The mouse input when the action model was requested, such as in response to a context menu request.</param>
		/// <returns>A set of exported <see cref="IAction"/>s.</returns>
		public override IActionSet GetExportedActions(string site, IMouseInformation mouseInformation)
		{
			IActionSet actions = base.GetExportedActions(site, mouseInformation);
			_lastContextMenuPoint = mouseInformation.Location;

			if (!_canAddRemoveVertices)
				return actions;

			if (!base.Subject.HitTest(Point.Round(_lastContextMenuPoint)))
				return actions;

			int count = this.Subject.Points.Count;
			bool hit = base.ControlPoints.HitTest(Point.Round(_lastContextMenuPoint));

			IResourceResolver resolver = new ApplicationThemeResourceResolver(this.GetType(), true);
			string @namespace = typeof (VerticesControlGraphic).FullName;

			MenuAction insertAction = new MenuAction(@namespace + ":insert", new ActionPath(site + "/MenuInsertVertex", resolver), ClickActionFlags.None, resolver);
			insertAction.GroupHint = new GroupHint("Tools.Graphics.Edit");
			insertAction.Label = SR.MenuInsertVertex;
			insertAction.Persistent = true;
			insertAction.SetClickHandler(this.PerformInsertVertex);

			MenuAction deleteAction = new MenuAction(@namespace + ":delete", new ActionPath(site + "/MenuDeleteVertex", resolver), ClickActionFlags.None, resolver);
			deleteAction.GroupHint = new GroupHint("Tools.Graphics.Edit");
			deleteAction.Label = SR.MenuDeleteVertex;
			deleteAction.Visible = hit && count > 1;
			deleteAction.Persistent = true;
			deleteAction.SetClickHandler(this.PerformDeleteVertex);

			return actions.Union(new ActionSet(new IAction[] {insertAction, deleteAction}));
		}
		private void UpdateIcons()
		{
			var resourceResolver = new ApplicationThemeResourceResolver(GetType(), false);
			_searchButton.Image = resourceResolver.OpenImage(@"Resources.SearchToolSmall.png");
			_clearButton.Image = resourceResolver.OpenImage(@"Resources.ClearFilterSmall.png");
		}
Example #6
0
		/// <summary>
		/// Gets a set of exported <see cref="IAction"/>s.
		/// </summary>
		/// <param name="site">The action model site at which the actions should reside.</param>
		/// <param name="mouseInformation">The mouse input when the action model was requested, such as in response to a context menu request.</param>
		/// <returns>A set of exported <see cref="IAction"/>s.</returns>
		public override IActionSet GetExportedActions(string site, IMouseInformation mouseInformation)
		{
            if (!HitTest(mouseInformation.Location))
                return new ActionSet();

			IResourceResolver resolver = new ApplicationThemeResourceResolver(this.GetType(), true);
			string @namespace = typeof(TextEditControlGraphic).FullName;
			MenuAction action = new MenuAction(@namespace + ":edit", new ActionPath(site + "/MenuEditText", resolver), ClickActionFlags.None, resolver);
			action.GroupHint = new GroupHint("Tools.Graphics.Edit");
			action.Label = SR.MenuEditText;
			action.Persistent = true;
			action.SetClickHandler(delegate { this.StartEdit(); });
			return base.GetExportedActions(site, mouseInformation).Union(new ActionSet(new IAction[] {action}));
		}