Exemplo n.º 1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="CaptureClick" /> class.
        /// </summary>
        /// 
        public CaptureClick()
        {
            context = new NativeMouseContext();
            context.MouseUp += thread_MouseUp;
            context.MouseDown += thread_MouseDown;
            context.MouseMove += thread_MouseMove;

            penOuter = new Pen(Brushes.Black, 2);
            penInner = new Pen(Color.FromArgb(150, Color.White), 5);

            Radius = 50;
            StepSize = 16;
            Threshold = 12;
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// 
        /// <param name="disposing"><c>true</c> to release both managed
        /// and unmanaged resources; <c>false</c> to release only unmanaged
        /// resources.</param>
        ///
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // free managed resources
                if (context != null)
                {
                    context.Dispose();
                    context = null;
                }

                if (penOuter != null)
                {
                    penOuter.Dispose();
                    penInner.Dispose();

                    penOuter = null;
                    penInner = null;
                }
            }
        }