本文整理汇总了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);
}
}
示例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();
}
示例3: CustomMarkerDemo_MouseLeftButtonDown
void CustomMarkerDemo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if(!IsMouseCaptured)
{
Mouse.Capture(this);
}
}
示例4: PartViewMouseDown
private void PartViewMouseDown(object sender, MouseButtonEventArgs e)
{
//
Point loc = e.GetPosition((IInputElement) sender);
ScrollViewer.ScrollToVerticalOffset(loc.Y);
ScrollViewer.ScrollToHorizontalOffset(loc.X);
}
示例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();
}
示例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);
}
}
示例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);
}
示例8: OnMouseLeftButtonDown
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
e.Handled = true;
_isMouseDown = true;
_mousePt = Mouse.GetPosition(this);
}
示例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);
}
示例10: closeLid_SimDouleClick
void closeLid_SimDouleClick(object sender, MouseButtonEventArgs e)
{
if (SocketUtils.SimDoubleClick(sender, e))
{
BlackLid_Ellipse.Visibility = Visibility.Visible;
}
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
}
示例15: TitleBar_OnPreviewMouseDown
private void TitleBar_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
{
if (Mouse.LeftButton == MouseButtonState.Pressed)
{
DragMove();
}
}