示例#1
0
        //-------------------------------------------------------------------------

        /// <summary>
        /// The specified <see cref="Control"/> is bound to the custom caret.
        /// </summary>
        /// <param name="control">A control instance that uses a caret.</param>
        /// <param name="value"><code>true</code> if and only if the custom caret
        /// should be used by the control instance.</param>
        public void SetUseCaret(Control control, bool value)
        {
            if (DesignMode)
            {
                if (value)
                {
                    if (!controlSet.Contains(control))
                    {
                        controlSet.Add(control);
                    }
                }
                else
                {
                    controlSet.Remove(control);
                }
            }
            if (value)
            {
                Caret.ApplyBinding(control);
            }
            else
            {
                Caret.RemoveBinding(control);
            }
        }