private void btnStart_Click(object sender, RoutedEventArgs e) { stepDiagramViewer.Clear(); btnStart.IsEnabled = false; Session.Clean(); Session.SetStepDiagram(null); UpdateTotals(); HookEngine.Start(); HookEngine.UsageChanged += HookEngine_UsageChanged; stepDiagramViewer.Start(); HookEngine.StepDiagram.Events.CollectionChanged += Events_CollectionChanged; btnStop.IsEnabled = true; TextBox txtDiagramName = VisualTree.FindChild <TextBox>(this, "txtDiagramName"); if (txtDiagramName != null) { txtDiagramName.Visibility = System.Windows.Visibility.Hidden; } lblClock.Text = "0:00.00"; timer.Interval = 5; timer.Elapsed += timer_Elapsed; timer.Start(); stopwatch = new Stopwatch(); }
void ResetDiagramNameBox() { TextBox txtDiagramName = VisualTree.FindChild <TextBox>(this, "txtDiagramName"); if (txtDiagramName != null) { txtDiagramName.Text = string.Empty; txtDiagramName.Visibility = System.Windows.Visibility.Visible; } }
ScrollBar GetStepDiagramHorizontalScrollBar() { List <ScrollBar> scrollBars = VisualTree.GetVisualChildCollection <ScrollBar>(lstSteps); ScrollBar horizontalScrollBar = null; foreach (ScrollBar scrollBar in scrollBars) { if (scrollBar.Orientation == Orientation.Horizontal) { horizontalScrollBar = scrollBar; break; } } return(horizontalScrollBar); }
public static void TooltipLoaded(Grid parentGrid) { if (parentGrid == null) { return; } animationAdjustX = 0; animationAdjustY = 0; Image screenGrab = VisualTree.FindChild <Image>(parentGrid, "imgScreenGrab"); if (screenGrab != null) { Border border = screenGrab.Parent as Border; if (border != null) { double deltaWidth = border.ActualWidth - screenGrab.ActualWidth; if (deltaWidth > 4.0) { animationAdjustX = deltaWidth / 2 - 4.0; } double deltaHeight = border.ActualHeight - screenGrab.ActualHeight; if (deltaHeight > 4.0) { animationAdjustY = deltaHeight / 2 - 4.0; } } } mouseImage = VisualTree.FindChild <Image>(parentGrid, "imgMouse"); if (mouseImage == null) { return; } mouseBeacon = VisualTree.FindChild <Ellipse>(parentGrid, "mouseBeacon"); if (mouseBeacon == null) { return; } mouseLightRingBeacon = VisualTree.FindChild <Ellipse>(parentGrid, "mouseLightRingBeacon"); if (mouseLightRingBeacon == null) { return; } mouseGrab = null; mouseImage.Visibility = Visibility.Hidden; mouseBeacon.Visibility = Visibility.Hidden; mouseLightRingBeacon.Visibility = Visibility.Hidden; ToolTip parentToolTip = VisualTree.GetParent <ToolTip>(parentGrid); if (parentToolTip == null) { return; } lock (animatingEventLocker) { mouseMoveEvent = parentToolTip.DataContext as MouseMoveEvent; mouseDownEvent = parentToolTip.DataContext as MouseDownEvent; if ((mouseMoveEvent == null || mouseMoveEvent.MidPoints.Count <= 0) && mouseDownEvent == null) { return; } MouseEvent mouseEvent = parentToolTip.DataContext as MouseEvent; List <ScreenGrab> allGrabs = mouseEvent.ScreenGrabs.AllGrabs; if (allGrabs.Count <= 0) { return; } mouseGrab = allGrabs[0]; mouseImage.Visibility = Visibility.Visible; if (mouseDownEvent != null) { mouseLightRingBeacon.Width = 0; mouseLightRingBeacon.Height = 0; mouseLightRingBeacon.Opacity = 0; mouseBeacon.Width = 0; mouseBeacon.Height = 0; mouseBeacon.Opacity = 0; QueueMouseAppearAnimation(mouseDownEvent.Position, QueueNextMouseDownAnimation); mouseBeacon.Visibility = Visibility.Visible; mouseLightRingBeacon.Visibility = Visibility.Visible; return; } midPointIndex = -1; QueueNextMouseMoveAnimation(null, null); } }