public DistanceTool(StretchMode stretch, IScreenServiceHost host) : base(host)
        {
            this.StretchMode = stretch;

            this.screenshot = this.Host.CurrentScreen;

            this.InitializeComponent();

            if (this.StretchMode == StretchMode.EastWest)
            {
                this.N.Visibility = Visibility.Collapsed;
                this.S.Visibility = Visibility.Collapsed;
            }
            else if (this.StretchMode == StretchMode.NorthSouth)
            {
                this.E.Visibility = Visibility.Collapsed;
                this.W.Visibility = Visibility.Collapsed;
            }
#if !DEBUG
			this.Cursor = Cursors.None;
#endif

            this.Dimensions.CloseClicked += delegate
            {
                this.CloseService();
            };

            this.Loaded += delegate
            {
                this.Update();
            };
        }
示例#2
0
        public Magnifier(IScreenServiceHost host)
            : base(host)
        {
            this.InitializeComponent();

            new Dragger(this);

            this.Focusable = true;

            this.Scale = 8;

            DispatcherTimer timer = new DispatcherTimer() {
                Interval = TimeSpan.FromSeconds(.03),
                IsEnabled = true,
            };
            timer.Tick += this.HandleTick;

            this.Loaded += delegate {
                this.Focus();
            };

            this.InputBindings.Add(new InputBinding(Magnifier.CopyCommand, new KeyGesture(Key.C, ModifierKeys.Control)));
            this.CommandBindings.Add(new CommandBinding(Magnifier.CopyCommand, this.CopyCommandExecuted));

            this.InputBindings.Add(new InputBinding(Magnifier.SetBasePointCommand, new KeyGesture(Key.Enter)));
            this.CommandBindings.Add(new CommandBinding(Magnifier.SetBasePointCommand, this.SetBasePointExecuted));
        }
示例#3
0
        public Magnifier(IScreenServiceHost host) : base(host)
        {
            this.InitializeComponent();

            new Dragger(this);

            this.Focusable = true;

            this.Scale = 8;

            DispatcherTimer timer = new DispatcherTimer()
            {
                Interval  = TimeSpan.FromSeconds(.03),
                IsEnabled = true,
            };

            timer.Tick += this.HandleTick;

            this.Loaded += delegate
            {
                this.Focus();
            };

            this.InputBindings.Add(new InputBinding(Magnifier.CopyCommand, new KeyGesture(Key.C, ModifierKeys.Control)));
            this.CommandBindings.Add(new CommandBinding(Magnifier.CopyCommand, this.CopyCommandExecuted));

            this.InputBindings.Add(new InputBinding(Magnifier.SetBasePointCommand, new KeyGesture(Key.Enter)));
            this.CommandBindings.Add(new CommandBinding(Magnifier.SetBasePointCommand, this.SetBasePointExecuted));
        }
示例#4
0
        public DistanceTool(StretchMode stretch, IScreenServiceHost host) : base(host)
        {
            StretchMode = stretch;

            screenshot = Host.CurrentScreen;

            InitializeComponent();

            if (StretchMode == StretchMode.EastWest)
            {
                N.Visibility = Visibility.Collapsed;
                S.Visibility = Visibility.Collapsed;
            }
            else if (StretchMode == StretchMode.NorthSouth)
            {
                E.Visibility = Visibility.Collapsed;
                W.Visibility = Visibility.Collapsed;
            }
#if !DEBUG
            this.Cursor = Cursors.None;
#endif

            Dimensions.CloseClicked += delegate
            {
                CloseService();
                OnDimensionsCloseClicked(new EventArgs());
            };

            Loaded += delegate
            {
                Update();
            };
        }
示例#5
0
文件: Tool.cs 项目: zygissd/rooler
        public Tool(IScreenServiceHost host)
        {
            this.Host      = host;
            this.Focusable = true;

            this.HorizontalContentAlignment = HorizontalAlignment.Stretch;
            this.VerticalContentAlignment   = VerticalAlignment.Stretch;

            this.Loaded += delegate {
                this.Focus();
            };
        }
示例#6
0
文件: Tool.cs 项目: RSchwoerer/rooler
        public Tool(IScreenServiceHost host)
        {
            this.Host = host;
            this.Focusable = true;

            this.HorizontalContentAlignment = HorizontalAlignment.Stretch;
            this.VerticalContentAlignment = VerticalAlignment.Stretch;

            this.Loaded += delegate {
                this.Focus();
            };
        }
示例#7
0
        public Tool(IScreenServiceHost host)
        {
            Host      = host;
            Focusable = true;

            HorizontalContentAlignment = HorizontalAlignment.Stretch;
            VerticalContentAlignment   = VerticalAlignment.Stretch;

            Loaded += delegate
            {
                Focus();
            };
        }
示例#8
0
        public BoundsTool(IScreenServiceHost host) : base(host)
        {
            this.screenshot = this.Host.CurrentScreen;

            InitializeComponent();

            this.BoundsWidth.Width     = new GridLength(0, GridUnitType.Pixel);
            this.BoundsHeight.Height   = new GridLength(0, GridUnitType.Pixel);
            this.Dimensions.Visibility = Visibility.Collapsed;

            this.Dimensions.CloseClicked += delegate {
                this.CloseService();
            };
        }
示例#9
0
        public Settings(IScreenServiceHost host) : base(host)
        {
            this.InitializeComponent();
            new Dragger(this);

            this.Focusable = true;

            this.ToleranceSlider.Value = ScreenCoordinates.ColorTolerance;

            this.ToleranceSlider.ValueChanged += delegate
            {
                ScreenCoordinates.ColorTolerance = this.ToleranceSlider.Value;
            };
        }
示例#10
0
        public Capture(IScreenServiceHost host) : base(host)
        {
            InitializeComponent();

            this.InputBindings.Add(new InputBinding(Capture.CopyCommand, new KeyGesture(Key.C, ModifierKeys.Control)));
            this.CommandBindings.Add(new CommandBinding(Capture.CopyCommand, this.HandleCopy));

            this.BoundsWidth.Width     = new GridLength(0, GridUnitType.Pixel);
            this.BoundsHeight.Height   = new GridLength(0, GridUnitType.Pixel);
            this.Dimensions.Visibility = Visibility.Collapsed;

            this.Dimensions.CloseClicked += delegate {
                this.CloseService();
            };
        }
示例#11
0
        public Capture(IScreenServiceHost host)
            : base(host)
        {
            InitializeComponent();

            this.InputBindings.Add(new InputBinding(Capture.CopyCommand, new KeyGesture(Key.C, ModifierKeys.Control)));
            this.CommandBindings.Add(new CommandBinding(Capture.CopyCommand, this.HandleCopy));

            this.BoundsWidth.Width = new GridLength(0, GridUnitType.Pixel);
            this.BoundsHeight.Height = new GridLength(0, GridUnitType.Pixel);
            this.Dimensions.Visibility = Visibility.Collapsed;

            this.Dimensions.CloseClicked += delegate {
                this.CloseService();
            };
        }
 public FlyoutTool(IScreenServiceHost host) : base(host)
 {
 }