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


C# Input.MouseButtonEventArgs类代码示例

本文整理汇总了C#中System.Windows.Input.MouseButtonEventArgs的典型用法代码示例。如果您正苦于以下问题:C# MouseButtonEventArgs类的具体用法?C# MouseButtonEventArgs怎么用?C# MouseButtonEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MouseButtonEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了MouseButtonEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: carpesan_MouseDoubleClick

        void carpesan_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            //Ver los documentos de la carpeta en la mesa
            Carpesano c = sender as Carpesano;
            string ruta = logic.gestionBiblioDB.getRutaBiblioteca() + "\\" + c.CodigoEstante.Replace(".", "\\");
            List<FileInfo> ficheros = mifaro.logic.Util.ListarFicheros(ruta);


            comun.Visor3D.mesaDocumentos.Children.Clear();
            foreach (FileInfo documento in ficheros)
            {
                string codigo = documento.Name.Replace(documento.Extension, "");
                codigo = codigo.Replace("_", ".");
                Diseños.VisorPdfWpf vi = new Diseños.VisorPdfWpf(documento.FullName, codigo);
                /*
                visorPDF v = new visorPDF();
                v.axAcroPDF1.LoadFile(documento.FullName);
                vi.windowsFormsHost1.Child = v;
                vi.Height=220;
                vi.Width =170;
                */
                comun.Visor3D.mesaDocumentos.Children.Add(vi);
                logic.Util.DoEvents(this.Dispatcher);
            }

        }
开发者ID:mialejandriastartup,项目名称:mialejandria.mifaro,代码行数:26,代码来源:Estanteria.xaml.cs

示例2: element_MouseLeftButtonDown

 private static void element_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     UIElement element = sender as UIElement;
     Point position = e.GetPosition(element);
     DispatcherTimer timer = element.GetValue(DoubleClickTimerProperty) as DispatcherTimer;
     if (timer != null)
     {
         timer.Stop();
         Point oldPosition = (Point)element.GetValue(DoubleClickPositionProperty);
         element.ClearValue(DoubleClickTimerProperty);
         element.ClearValue(DoubleClickPositionProperty);
         if (Math.Abs(oldPosition.X - position.X) < 1 && Math.Abs(oldPosition.Y - position.Y) < 1) //mouse didn't move => Valid double click
         {
             List<MouseButtonEventHandler> handlers = element.GetValue(DoubleClickHandlersProperty) as List<MouseButtonEventHandler>;
             if (handlers != null)
             {
                 foreach (MouseButtonEventHandler handler in handlers)
                 {
                     handler(sender, e);
                 }
             }
             return;
         }
     }
     timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(doubleClickInterval) };
     timer.Tick += new EventHandler((s, args) =>
     {
         (s as DispatcherTimer).Stop();
         element.ClearValue(DoubleClickTimerProperty);
         element.ClearValue(DoubleClickPositionProperty);
     });
     element.SetValue(DoubleClickTimerProperty, timer);
     element.SetValue(DoubleClickPositionProperty, position);
     timer.Start();
 }
开发者ID:SuperMap,项目名称:iClient-for-Silverlight,代码行数:35,代码来源:DoubleClickHelper.cs

示例3: CustomMarkerDemo_MouseLeftButtonDown

 void CustomMarkerDemo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
    if(!IsMouseCaptured)
    {
       Mouse.Capture(this);
    }
 }
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:7,代码来源:CustomMarkerRed.xaml.cs

示例4: PartViewMouseDown

 private void PartViewMouseDown(object sender, MouseButtonEventArgs e)
 {
     //
     Point loc = e.GetPosition((IInputElement) sender);
     ScrollViewer.ScrollToVerticalOffset(loc.Y);
     ScrollViewer.ScrollToHorizontalOffset(loc.X);
 }
开发者ID:Kyphis,项目名称:Terraria-Map-Editor,代码行数:7,代码来源:ScrollViewerThumbnail.cs

示例5: lbCustomers_MouseDoubleClick

        private void lbCustomers_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (m_selectedCustomer == null) return;

            var cew = new CustomerEditWindow(this, m_selectedCustomer);
            cew.ShowDialog();
        }
开发者ID:sinland,项目名称:vkshopmanager,代码行数:7,代码来源:CustomersSelectionWindow.xaml.cs

示例6: BouncingWindow_MouseDown

        private void BouncingWindow_MouseDown(Object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                if (this.bouncingBalls.Count < MainWindow.MaxBalls)
                {
                    BouncingBall ball = new BouncingBall(this.rand);

                    ball.Left = e.GetPosition(this.BouncingCanvas).X - BouncingBall.Radius;
                    ball.Top = e.GetPosition(this.BouncingCanvas).Y - BouncingBall.Radius;

                    Monitor.Enter(this);
                    this.bouncingBalls.Add(ball);
                    this.BouncingCanvas.Children.Add(ball.Circle);
                    Monitor.Exit(this);
                }
            }
            else if (e.RightButton == MouseButtonState.Pressed)
            {
                int count = this.bouncingBalls.Count;
                if (count == 0)
                    return;

                Monitor.Enter(this);
                this.bouncingBalls.RemoveAt(count - 1);
                this.BouncingCanvas.Children.RemoveAt(count - 1);
                Monitor.Exit(this);
            }
        }
开发者ID:peterloos,项目名称:Wpf_BouncingBalls,代码行数:29,代码来源:MainWindow.xaml.cs

示例7: boardCanvas_MouseDown

        public void boardCanvas_MouseDown(object sender, MouseButtonEventArgs e)
        {
            boardCanvas.CaptureMouse();
            sP = e.GetPosition(boardCanvas);
            newAtr.Color = (Color)colorStroke.SelectedColor;
            newAtr.Height = newAtr.Width = slider.Value;
            boardCanvas.DefaultDrawingAttributes = newAtr;

            if (tempTool == pencilImage.Name || tempTool == eraserImage.Name || tempTool == circleImage.Name || tempTool == rectangleImage.Name)
            {

               if (tempTool == circleImage.Name)
                {
                    ellipse = new Ellipse();
                }
                else if (tempTool == rectangleImage.Name)
                {
                    rect = new Rectangle();
                }
            }
            else if (tempTool == lineImage.Name)
            {
                line_C = new Line();
            }

            else if (tempTool == textBoxImage.Name) {
                tB = new TextBox();
            }

            //eP = new Point(0, 0);
        }
开发者ID:asadnadeem93,项目名称:Collaboard,代码行数:31,代码来源:boardPage.xaml.cs

示例8: OnMouseLeftButtonDown

 protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
 {
     base.OnMouseLeftButtonDown(e);
     e.Handled = true;
     _isMouseDown = true;
     _mousePt = Mouse.GetPosition(this);
 }
开发者ID:rexperalta,项目名称:OCTGN,代码行数:7,代码来源:MarkerControl.xaml.cs

示例9: CategoryImage_MouseLeftButtonUp

        private void CategoryImage_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            Image selectedImage = (Image)sender;

            switch (selectedImage.Name)
            {
                case "DigitalImage":
                    this.DigitalFlipReverse.Begin();
                    this.CategoryViewControl.AssignCategory("Digital");
                    break;
                case "HolgaImage":
                    this.DarkroomFlipReverse.Begin();
                    this.CategoryViewControl.AssignCategory("Holga");
                    break;
                case "DarkroomImage":
                    this.HolgaFlipReverse.Begin();
                    this.CategoryViewControl.AssignCategory("Darkroom");
                    break;
            }

            DisableTextAnimations();

            this.CategoryTransition.Begin();
            this.CategoryViewControl.RaiseThumbnailBar();
            Analytics.TrackEvent(Analytics.Source.MenuImage, Analytics.Action.Click, selectedImage.Name);
        }
开发者ID:nmahoney,项目名称:neilmahoneyphotographyVS,代码行数:26,代码来源:MainPage.xaml.cs

示例10: closeLid_SimDouleClick

 void closeLid_SimDouleClick(object sender, MouseButtonEventArgs e)
 {
     if (SocketUtils.SimDoubleClick(sender, e))
     {
         BlackLid_Ellipse.Visibility = Visibility.Visible;
     }
 }
开发者ID:ychost,项目名称:PowerControlSimulation,代码行数:7,代码来源:SFPCircle.xaml.cs

示例11: listBox_MouseDoubleClick

		void listBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) {
			if (!UIUtilities.IsLeftDoubleClick<ListBoxItem>(listBox, e))
				return;
			var data = DataContext as ListVM;
			if (data != null)
				data.EditItem();
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:ListVMControl.xaml.cs

示例12: IsDoubleClick

        public static bool IsDoubleClick(object sender, MouseButtonEventArgs e)
        {
            bool senderMatch = sender.Equals(m_LastSender);
            m_LastSender = sender;

            long clickTicks = DateTime.Now.Ticks;
            Point position = e.GetPosition(null);
            if (senderMatch)
            {
                long elapsedTicks = clickTicks - m_LastClickTicks;
                long elapsedTime = elapsedTicks / TimeSpan.TicksPerMillisecond;
                double distance = position.Distance(m_LastPosition);
                if (elapsedTime <= k_DoubleClickSpeed && distance <= k_MaxMoveDistance)
                {
                    // Double click!
                    m_LastClickTicks = 0;
                    return true;
                }
            }

            // Not a double click
            m_LastClickTicks = clickTicks;
            m_LastPosition = position;
            return false;
        }
开发者ID:valeriob,项目名称:Routing,代码行数:25,代码来源:MouseButtonHelper.cs

示例13: MessageMouseDoubleClick

        /// <summary>
        /// When a user double clicks on a message then open the message in a message box.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">Event arguments.</param>
        private void MessageMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;
            var contentControl = sender as ContentControl;
            if (contentControl == null)
            {
                return;
            }

            var mesage = contentControl.DataContext as Message;
            if (mesage == null)
            {
                return;
            }

            if (String.IsNullOrEmpty(mesage.Title))
            {
                mesage.Title = ModuleName;
            }

            var modalManager = ServiceLocator.Current.GetInstance<ModalNavigator>();
            var messageBoxSettings = new MessageBoxSettings
            {
                MessageBoxButtons = MessageBoxButtonsEnum.Ok,
                CopyToClipboardEnabled = true,
                Message = mesage
            };

            modalManager.ShowMessageBox(messageBoxSettings);
        }
开发者ID:WELL-E,项目名称:origin,代码行数:35,代码来源:DocumentViewHost.xaml.cs

示例14: OnMouseUp

    protected override void OnMouseUp(MouseButtonEventArgs e)
    {
      if (HitConnector != null)
      {
        var sourceConnector = this.sourceConnector;
        var sinkConnector = HitConnector;

        var model = new ConnectionModel(sourceConnector.ConnectorViewModel.ConnectorModel, sinkConnector.ConnectorViewModel.ConnectorModel);
        var connectionViewModel = new ConnectionViewModel(sourceConnector.ConnectorViewModel, sinkConnector.ConnectorViewModel, model);
        var newConnection = new Connection(sourceConnector, sinkConnector, connectionViewModel);

        Panel.SetZIndex(newConnection, designerCanvas.Children.Count);
        designerCanvas.Children.Add(newConnection);

        var vm = designerCanvas.DataContext as EditorWindowViewModel;
        if (vm == null)
          throw new ArgumentNullException("designerCanvas.DataContext as EditorWindowViewModel");

        vm.Add(connectionViewModel);
      }
      if (HitDesignerItem != null)
      {
        HitDesignerItem.IsDragConnectionOver = false;
      }

      if (IsMouseCaptured) ReleaseMouseCapture();

      var adornerLayer = AdornerLayer.GetAdornerLayer(designerCanvas);
      if (adornerLayer != null)
      {
        adornerLayer.Remove(this);
      }
    }
开发者ID:WinnieThePoooh,项目名称:Lego,代码行数:33,代码来源:ConnectorAdorner.cs

示例15: TitleBar_OnPreviewMouseDown

 private void TitleBar_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
 {
     if (Mouse.LeftButton == MouseButtonState.Pressed)
     {
         DragMove();
     }
 }
开发者ID:Yaguar666,项目名称:ffxivapp-plugin-parse,代码行数:7,代码来源:DTPSWidget.xaml.cs


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