Ejemplo n.º 1
0
        private void RegisterMouseTool(MouseImageViewerTool mouseTool)
        {
            if (mouseTool.Active)
            {
                ActivateMouseTool(mouseTool);
            }

            mouseTool.MouseButtonChanged += OnMouseToolMouseButtonChanged;
            mouseTool.ActivationChanged  += OnMouseToolActivationChanged;
        }
Ejemplo n.º 2
0
        private void DeactivateMouseTools(MouseImageViewerTool activating)
        {
            var others = from tool in GetMouseTools()
                         where tool != activating && tool.MouseButton == activating.MouseButton
                         select tool;

            foreach (var otherTool in others)
            {
                otherTool.Active = false;
            }
        }
Ejemplo n.º 3
0
 private void ActivateMouseTool(MouseImageViewerTool mouseTool)
 {
     if (mouseTool.MouseButton == XMouseButtons.None)
     {
         Platform.Log(LogLevel.Debug, String.Format(SR.FormatMouseToolHasNoAssignment, mouseTool.GetType().FullName));
         mouseTool.Active = false;
     }
     else
     {
         DeactivateMouseTools(mouseTool);
         mouseTool.Active = true;
     }
 }
Ejemplo n.º 4
0
 private void ActivateMouseTool(MouseImageViewerTool mouseTool)
 {
     if (mouseTool.MouseButton == XMouseButtons.None)
     {
         Platform.Log(LogLevel.Debug, String.Format("The mouse tool does not have a shortcut assignment ({0}).  The tool cannot be activated.", mouseTool.GetType().FullName));
         mouseTool.Active = false;
     }
     else
     {
         DeactivateMouseTools(mouseTool);
         mouseTool.Active = true;
     }
 }