Ejemplo n.º 1
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryText"]/*' />
        public virtual int GetEntryText(int combo, int entry, out string text)
        {
            text = null;
            DropDownMember member = GetMember(combo, entry);

            if (!Object.ReferenceEquals(member, null))
            {
                text = member.Label;
            }
            return(NativeMethods.S_OK);
        }
Ejemplo n.º 2
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryAttributes"]/*' />
        public virtual int GetEntryAttributes(int combo, int entry, out uint fontAttrs)
        {
            fontAttrs = (uint)DROPDOWNFONTATTR.FONTATTR_PLAIN;
            DropDownMember member = GetMember(combo, entry);

            if (!Object.ReferenceEquals(member, null))
            {
                fontAttrs = (uint)member.FontAttr;
            }
            return(NativeMethods.S_OK);
        }
Ejemplo n.º 3
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.GetEntryImage"]/*' />
        public virtual int GetEntryImage(int combo, int entry, out int imgIndex)
        {
            // this happens during drawing and has to be fast
            imgIndex = -1;
            DropDownMember member = GetMember(combo, entry);

            if (!Object.ReferenceEquals(member, null))
            {
                imgIndex = member.Glyph;
            }
            return(NativeMethods.S_OK);
        }
Ejemplo n.º 4
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="TypeAndMemberDropdownBars.OnItemChosen"]/*' />
        public virtual int OnItemChosen(int combo, int entry)
        {
            DropDownMember member = GetMember(combo, entry);

            if (!Object.ReferenceEquals(member, null))
            {
                if (this.textView != null)
                {
                    int line = member.Span.iStartLine;
                    int col  = member.Span.iStartIndex;
                    try {
                        // Here we don't want to throw or to check the return value.
                        textView.CenterLines(line, 16);
                    } catch (COMException) { }
                    NativeMethods.ThrowOnFailure(this.textView.SetCaretPos(line, col));
                    NativeMethods.SetFocus(this.textView.GetWindowHandle());
                    this.SynchronizeDropdowns(this.textView, line, col);
                }
            }
            return(NativeMethods.S_OK);
        }