public HelperForm(IController controller) { this.controller = controller; InitializeComponent(); var bound = Screen.PrimaryScreen.Bounds; commonTop = bound.Height - Height; Location = new Point((bound.Width - Width) / 2, commonTop); StartPosition = FormStartPosition.Manual; CheckForIllegalCrossThreadCalls = false; defaultSize = Size; pinned = Settings.Default.fix; checkPinBoxImage(); controller.ToolSelectionChanged += Controller_ToolSelectionChanged; controller.SlideShowChanged += Controller_SlideShowChanged; foreach (Control ctr in Controls) { GestureUtils.AddSlideDownGesture(ctr); } GestureUtils.AddSlideDownGesture(this); controller.Focus(); }
private void rightBox_Click(object sender, EventArgs e) { if (GestureUtils.IsInvolved(sender as Control)) { GestureUtils.Reject(sender as Control); return; } if (!IsUp()) { SlipUp(); return; } if (!skipToolShown) { controller.Next(); if ((DateTime.Now - lastRightBoxClicked).TotalMilliseconds <= 700) { countRightBoxClicked++; } if (countRightBoxClicked >= 3) { ShowSkipTool(); countRightBoxClicked = 0; } lastRightBoxClicked = DateTime.Now; controller.Focus(); } else { HideSkipTool(); controller.Switch(); } }
private void pictureBox1_Click(object sender, EventArgs e) { if (GestureUtils.IsInvolved(sender as Control)) { GestureUtils.Reject(sender as Control); return; } if (!IsUp()) { SlipUp(); return; } controller.Exit(); }
private void leftBox_Click(object sender, EventArgs e) { if (GestureUtils.IsInvolved(sender as Control)) { GestureUtils.Reject(sender as Control); return; } if (!IsUp()) { SlipUp(); return; } controller.Previous(); controller.Focus(); }