src/Misc/EFTools/XmlCore/UI/Views/Explorer/ExplorerTreeViewItem.cs
/// <summary>
///     Returns back the name of the selected TreeViewItem that accessibility narration will read aloud.
/// </summary>
/// <returns></returns>
Returns back the name of the selected TreeViewItem that accessibility narration will read aloud.
Returns back the name of the selected TreeViewItem that accessibility narration will read aloud .
protected override string GetNameCore()
        {
            var owner = Owner as ExplorerTreeViewItem;
            Debug.Assert(owner != null, "Where is the ExplorerTreeViewItem for the automation peer?");
            if (owner != null)
            {
                var element = owner.Header as ExplorerEFElement;
                var elementstr = owner.Header as string;
                if (element != null)
                {
                    var sb = new StringBuilder();
                    if (element.ModelItem != null)
                    {
                        sb.Append(element.ModelItem.GetType().Name);
                        sb.Append(" ");
                    }
                    sb.Append(element.Name);
                    return sb.ToString();
                }
                else if (!String.IsNullOrEmpty(elementstr))
                {
                    return elementstr;
                }
            }
            return base.GetNameCore();
        }
protected override string GetNameCore ( ) { var owner = Owner as ExplorerTreeViewItem ; Debug . Assert ( owner != null , " " ) ; if ( owner != null ) { var element = owner . Header as ExplorerEFElement ; var elementstr = owner . Header as string ; if ( element != null ) { var sb = new StringBuilder ( ) ; if ( element . ModelItem != null ) { sb . Append ( element . ModelItem . GetType ( ) . Name ) ; sb . Append ( " " ) ; } sb . Append ( element . Name ) ; return sb . ToString ( ) ; } else if ( ! String . IsNullOrEmpty ( elementstr ) ) { return elementstr ; } } return base . GetNameCore ( ) ; }
Returns back the name of the selected TreeViewItem that accessibility narration will read aloud.
Returns back the name of the selected TreeViewItem that accessibility narration will read aloud .
// sometimes the label is stored as a string "Model2.edmx" or as an ExplorerEFElement // if the currently selected node is not a 'ghost node' (e.g. Entity Sets), we'll also tack on the name
None