protected override string?GetNameCore()
        {
            var result = base.GetNameCore();

            if (result is null && Owner.Header is string header)
            {
                result = AccessText.RemoveAccessKeyMarker(header);
            }

            return(result);
        }
        /// <summary>Gets the text label of the <see cref="T:System.Windows.ContentElement" /> that is associated with this <see cref="T:System.Windows.Automation.Peers.ContentElementAutomationPeer" />. Called by <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetName" />.</summary>
        /// <returns>The string that contains the label.</returns>
        // Token: 0x060026E2 RID: 9954 RVA: 0x000B83F4 File Offset: 0x000B65F4
        protected override string GetNameCore()
        {
            string nameCore = base.GetNameCore();

            if (!string.IsNullOrEmpty(nameCore))
            {
                GroupBox groupBox = (GroupBox)base.Owner;
                if (groupBox.Header is string)
                {
                    return(AccessText.RemoveAccessKeyMarker(nameCore));
                }
            }
            return(nameCore);
        }
示例#3
0
        /// <summary>Gets the text label of the <see cref="T:System.Windows.Controls.TabItem" /> that is associated with this <see cref="T:System.Windows.Automation.Peers.TabItemAutomationPeer" />. Called by <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetName" />.</summary>
        /// <returns>The string that contains the label. If set, this method returns the value of the <see cref="P:System.Windows.Automation.AutomationProperties.Name" /> property; otherwise this method will return the value of the <see cref="P:System.Windows.Controls.HeaderedContentControl.Header" /> property.</returns>
        // Token: 0x06002814 RID: 10260 RVA: 0x000BB764 File Offset: 0x000B9964
        protected override string GetNameCore()
        {
            string nameCore = base.GetNameCore();

            if (!string.IsNullOrEmpty(nameCore))
            {
                TabItem tabItem = base.GetWrapper() as TabItem;
                if (tabItem != null && tabItem.Header is string)
                {
                    return(AccessText.RemoveAccessKeyMarker(nameCore));
                }
            }
            return(nameCore);
        }
        /// <summary>Gets the text label of the <see cref="T:System.Windows.Controls.Label" /> that is associated with this <see cref="T:System.Windows.Automation.Peers.LabelAutomationPeer" />. This method is called by <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetName" />.</summary>
        /// <returns>The string that contains the label.</returns>
        // Token: 0x06002766 RID: 10086 RVA: 0x000B9F74 File Offset: 0x000B8174
        protected override string GetNameCore()
        {
            string nameCore = base.GetNameCore();

            if (!string.IsNullOrEmpty(nameCore))
            {
                Label label = (Label)base.Owner;
                if (label.Content is string)
                {
                    return(AccessText.RemoveAccessKeyMarker(nameCore));
                }
            }
            return(nameCore);
        }
示例#5
0
        /// <summary>Gets the text label of the <see cref="T:System.Windows.Controls.MenuItem" /> that is associated with this <see cref="T:System.Windows.Automation.Peers.MenuItemAutomationPeer" />. Called by <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetName" />.</summary>
        /// <returns>The string that contains the label.</returns>
        // Token: 0x06002791 RID: 10129 RVA: 0x000BA4DC File Offset: 0x000B86DC
        protected override string GetNameCore()
        {
            string nameCore = base.GetNameCore();

            if (!string.IsNullOrEmpty(nameCore))
            {
                MenuItem menuItem = (MenuItem)base.Owner;
                if (menuItem.Header is string)
                {
                    return(AccessText.RemoveAccessKeyMarker(nameCore));
                }
            }
            return(nameCore);
        }
        // Return the base without the AccessKey character
        ///
        override protected string GetNameCore()
        {
            string result = base.GetNameCore();

            if (!string.IsNullOrEmpty(result))
            {
                GroupBox groupBox = (GroupBox)Owner;
                if (groupBox.Header is string)
                {
                    return(AccessText.RemoveAccessKeyMarker(result));
                }
            }

            return(result);
        }
        // Return the base without the AccessKey character
        ///
        override protected string GetNameCore()
        {
            string result = base.GetNameCore();

            if (!string.IsNullOrEmpty(result))
            {
                MenuItem menuItem = (MenuItem)Owner;
                if (menuItem.Header is string)
                {
                    return(AccessText.RemoveAccessKeyMarker(result));
                }
            }

            return(result);
        }
        // Return the base without the AccessKey character
        ///
        override protected string GetNameCore()
        {
            string result = base.GetNameCore();

            if (!string.IsNullOrEmpty(result))
            {
                TabItem tabItem = GetWrapper() as TabItem;
                if ((tabItem != null) && (tabItem.Header is string))
                {
                    return(AccessText.RemoveAccessKeyMarker(result));
                }
            }

            return(result);
        }
示例#9
0
        // Return the base without the AccessKey character
        ///
        override protected string GetNameCore()
        {
            string result = base.GetNameCore();

            if (!string.IsNullOrEmpty(result))
            {
                Label label = (Label)Owner;
                if (label.Content is string)
                {
                    return(AccessText.RemoveAccessKeyMarker(result));
                }
            }

            return(result);
        }
        // Return the base without the AccessKey character
        ///
        override protected string GetNameCore()
        {
            string     result = base.GetNameCore();
            ButtonBase bb     = (ButtonBase)Owner;

            if (!string.IsNullOrEmpty(result))
            {
                if (bb.Content is string)
                {
                    result = AccessText.RemoveAccessKeyMarker(result);
                }
            }
            else
            {
                RoutedUICommand uiCommand = bb.Command as RoutedUICommand;
                if (uiCommand != null && !string.IsNullOrEmpty(uiCommand.Text))
                {
                    result = uiCommand.Text;
                }
            }
            return(result);
        }
        /// <summary>Gets the name of the class of the element associated with this <see cref="T:System.Windows.Automation.Peers.ButtonBaseAutomationPeer" />. Called by <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetName" />.</summary>
        /// <returns>A string that contains the class name, minus the accelerator key.</returns>
        // Token: 0x06002523 RID: 9507 RVA: 0x000B3088 File Offset: 0x000B1288
        protected override string GetNameCore()
        {
            string     text       = base.GetNameCore();
            ButtonBase buttonBase = (ButtonBase)base.Owner;

            if (!string.IsNullOrEmpty(text))
            {
                if (buttonBase.Content is string)
                {
                    text = AccessText.RemoveAccessKeyMarker(text);
                }
            }
            else
            {
                RoutedUICommand routedUICommand = buttonBase.Command as RoutedUICommand;
                if (routedUICommand != null && !string.IsNullOrEmpty(routedUICommand.Text))
                {
                    text = routedUICommand.Text;
                }
            }
            return(text);
        }