當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。