Ejemplo n.º 1
0
        internal override void PollForStateAndUpdateInternal()
        {
            // Poll for this Tab's Command
            // A Group is automatically enabled if it does not have a command defined
            bool enabled = string.IsNullOrEmpty(Command) ? true :
                           Ribbon.PollForCommandState(Command, null, null);

            Enabled = enabled;

            // If this Tab is disabled, then everything underneath it is also disabled
            if (enabled)
            {
                LastPollTime = DateTime.Now;
                base.PollForStateAndUpdateInternal();
            }

            // We do this here because for performance reasons.  When a user is
            // switching between tabs, and the application has not told the ribbon
            // to poll, we only need to have the tab poll again if it was not polled since
            // the ribbon last was.  However, if we only need the tab to poll, then we don't
            // need the ribbon to poll (for the titles, contextual groups etc).  So, for this
            // case (where the tab polls but not the ribbon) we need to remove the disabling
            // css class that is over the tabcontainer element since we have not sucessfully
            // polled for this tab.
            Ribbon.EnsureTabContainerGlobalDisablingRemoved();
        }