Example #1
0
        /// <summary>
        /// Sends a request to activate the control and to initiate its single,
        /// unambiguous action.
        /// </summary>
        void IInvokeProvider.Invoke()
        {
            if (EnsureSelection())
            {
                OwningCalendar.SelectedDates.Clear();

                DateTime?date = OwningCalendarDayButton.GetDateNullable();
                if (date != null)
                {
                    OwningCalendar.SelectedDates.Add(date.Value);
                    OwningCalendar.OnDayClick(date.Value);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Returns the string that describes the functionality of the
        /// GlobalCalendarDayButton that is associated with this
        /// GlobalCalendarDayButtonAutomationPeer.  This method is called by
        /// GetHelpText.
        /// </summary>
        /// <returns>
        /// The help text, or String.Empty if there is no help text.
        /// </returns>
        protected override string GetHelpTextCore()
        {
            GlobalCalendarDayButton button = OwningCalendarDayButton;

            if (button != null && button.DataContext is DateTime)
            {
                DateTime date = OwningCalendarDayButton.GetDate();
                string   text = OwningCalendar.Info.DateToLongString(date);

                return(!button.IsBlackout ?
                       text :
                       string.Format(
                           OwningCalendar.Info.DateFormatInfo,
                           System.Windows.Controls.Properties.Resources.CalendarAutomationPeer_BlackoutDayHelpText,
                           text));
            }

            return(base.GetHelpTextCore());
        }