當前位置: 首頁>>代碼示例>>C#>>正文


C# MouseButtonEventArgs.ToTEMouseArgs方法代碼示例

本文整理匯總了C#中System.Windows.Input.MouseButtonEventArgs.ToTEMouseArgs方法的典型用法代碼示例。如果您正苦於以下問題:C# MouseButtonEventArgs.ToTEMouseArgs方法的具體用法?C# MouseButtonEventArgs.ToTEMouseArgs怎麽用?C# MouseButtonEventArgs.ToTEMouseArgs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Input.MouseButtonEventArgs的用法示例。


在下文中一共展示了MouseButtonEventArgs.ToTEMouseArgs方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: canvas1_MouseLeftButtonUp

        private void canvas1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {

            if (canvas1.IsMouseCaptured)
                canvas1.ReleaseMouseCapture();  // release mouse capture here to make sure the tools cannot forget
            Point mousep = e.GetPosition(canvas1);
            TEMouseArgs ee = e.ToTEMouseArgs();
            TheModel.CurrentTool.OnLeftMouseButtonUp(new Point(mousep.X, Height - mousep.Y), ee);
            e.Handled = ee.Handled;
        }
開發者ID:JoeyEremondi,項目名稱:tikzedt,代碼行數:10,代碼來源:PdfOverlay.xaml.cs

示例2: canvas1_MouseRightButtonDown

        /// <summary>
        /// The standard handling of right click is as follows (with this priority): 
        ///   1. The current tool uses the click.
        ///   2. Set the tool to the standard tool (move)
        ///   3. Deselect the CurEditing item.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void canvas1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            // call right down-method in the current tool
            Point mousep = e.GetPosition(canvas1);
            var oo = ObjectAtPosition(mousep);
            TEMouseArgs ee = e.ToTEMouseArgs();
            TheModel.CurrentTool.OnRightMouseButtonDown(oo, new Point(mousep.X, Height - mousep.Y), ee);
            e.Handled = ee.Handled;

            // if the tool didn't use the click-> proceed with standard handling
            if (!e.Handled)
            {
                if (Tool == OverlayToolType.move)
                {
                    //canvas1.ContextMenu.IsEnabled = true;
                    if (TheModel.CurEditing != null)
                    {
                        TheModel.CurEditing = null;
                        PreventContextMenuOpening = true;
                    }
                }
                else
                {
                    Tool = OverlayToolType.move;
                    PreventContextMenuOpening = true;
                }
            }
            else
                PreventContextMenuOpening = true;
        }
開發者ID:JoeyEremondi,項目名稱:tikzedt,代碼行數:38,代碼來源:PdfOverlay.xaml.cs

示例3: canvas1_MouseLeftButtonDown

 private void canvas1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {            
     // for some unknown reason the focus has to be set using the dispatcher...
     Dispatcher.BeginInvoke(new Action(delegate() { Keyboard.Focus(canvas1); }));            
     
     // call left down-method in the current tool
     Point mousep = e.GetPosition(canvas1);
     var oo = ObjectAtPosition(mousep);
     TEMouseArgs ee = e.ToTEMouseArgs();
     TheModel.CurrentTool.OnLeftMouseButtonDown(oo, new Point(mousep.X, Height - mousep.Y), ee);
     e.Handled = ee.Handled;
 }
開發者ID:JoeyEremondi,項目名稱:tikzedt,代碼行數:12,代碼來源:PdfOverlay.xaml.cs


注:本文中的System.Windows.Input.MouseButtonEventArgs.ToTEMouseArgs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。