Ejemplo n.º 1
0
        private string GetDisplayText(uint index, VSTREETEXTOPTIONS textOptions)
        {
            var listItem = GetListItem(index);

            switch (textOptions)
            {
            case VSTREETEXTOPTIONS.TTO_SORTTEXT:
            case VSTREETEXTOPTIONS.TTO_DISPLAYTEXT:
                switch (_kind)
                {
                case ObjectListKind.BaseTypes:
                case ObjectListKind.Hierarchy:
                case ObjectListKind.Members:
                case ObjectListKind.Namespaces:
                case ObjectListKind.Projects:
                case ObjectListKind.References:
                case ObjectListKind.Types:
                    return(listItem.DisplayText);
                }

                break;
            }

            return(listItem.DisplayText);
        }
Ejemplo n.º 2
0
		protected override string GetTextWithOwnership(VSTREETEXTOPTIONS tto)
		{
			//if(tto == VSTREETEXTOPTIONS.TTO_DEFAULT)
			//	return string.Format("{0} {1} - ({2}, {3}) : {4}", Name, _gotoInfo.FilePath, _gotoInfo.Line, _gotoInfo.Column, Text);

			return null;
		}
Ejemplo n.º 3
0
        protected override void Text(VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            string descText = this.Name;

            switch (tto)
            {
            case VSTREETEXTOPTIONS.TTO_PREFIX2:
                //
                descText = nameSpace;
                break;

            case VSTREETEXTOPTIONS.TTO_PREFIX:
                //
                descText = className;
                break;

            default:
                if (nodeText != null)
                {
                    descText = nodeText;
                    // No description for Project
                    if ((tto == VSTREETEXTOPTIONS.TTO_SEARCHTEXT) && (this.NodeType == LibraryNodeType.Package))
                    {
                        descText = "";
                    }
                }
                break;
            }
            pbstrText = descText;
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Get a pointer to the main text for the list item.
        /// </summary>
        /// <param name="index"></param>
        /// <param name="tto"></param>
        /// <param name="pbstrText"></param>
        /// <returns></returns>
        public int GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
        {
            ArgumentValidation.CheckForOutOfRangeException(index, 0, _changeList.Count - 1);

            ppszText = _changeList[(int)index].DisplayText;
            return(VSConstants.S_OK);
        }
Ejemplo n.º 5
0
 public string GetTextRepresentation(VSTREETEXTOPTIONS options) {
     switch(options) {
         case VSTREETEXTOPTIONS.TTO_DISPLAYTEXT:
             return _name;
     }
     return null;
 }
Ejemplo n.º 6
0
 public override string GetTextRepresentation(VSTREETEXTOPTIONS options)
 {
     if (options == VSTREETEXTOPTIONS.TTO_DEFAULT)
     {
         return(_pathText + _lineText.Trim());
     }
     return(String.Empty);
 }
Ejemplo n.º 7
0
        protected override string GetTextWithOwnership(VSTREETEXTOPTIONS tto)
        {
            if (tto == VSTREETEXTOPTIONS.TTO_DEFAULT)
            {
                return(string.Format("{0} {1} - ({2}, {3}) : {4}", Name, _gotoInfo.FilePath, _gotoInfo.Line, _gotoInfo.Column, Text));
            }

            return(null);
        }
Ejemplo n.º 8
0
        protected override void Text(VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            string descText = this.Name;
            // ClassName & Namespace
            string nameSp    = "";
            string className = "";

            if (member != null)
            {
                if (member.Parent is XTypeDefinition)
                {
                    nameSp    = ((XTypeDefinition)member.Parent).Namespace;
                    className = ((XTypeDefinition)member.Parent).Name;
                }
                //
                switch (tto)
                {
                case VSTREETEXTOPTIONS.TTO_PREFIX2:
                    //
                    descText = nameSp;
                    break;

                case VSTREETEXTOPTIONS.TTO_PREFIX:
                    //
                    descText = className;
                    break;

                default:
                    descText = member.Name;
                    if (member is XMemberDefinition)
                    {
                        var tm = member as XMemberDefinition;
                        if (tm.Kind == Kind.Constructor)
                        {
                            descText = "Constructor";
                        }
                        else
                        {
                            descText = member.Name;
                        }
                        if (tm.HasParameters)
                        {
                            //
                            descText += "( " + tm.ParameterList + ")";
                        }
                    }
                    // No description for Project
                    if ((tto == VSTREETEXTOPTIONS.TTO_SEARCHTEXT) && (this.NodeType == LibraryNodeType.Package))
                    {
                        descText = "";
                    }
                    break;
                }
            }
            pbstrText = descText;
        }
 int IVsSimpleObjectList2.GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
 {
     // TODO: make use of the text option.
     if (index >= (uint)children.Count)
     {
         throw new ArgumentOutOfRangeException("index");
     }
     pbstrText = children[(int)index].name;
     return(VSConstants.S_OK);
 }
Ejemplo n.º 10
0
        int IVsSimpleObjectList2.GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            if (index >= GetItemCount())
            {
                pbstrText = null;
                return(VSConstants.E_INVALIDARG);
            }

            pbstrText = GetText(index, tto);
            return(VSConstants.S_OK);
        }
Ejemplo n.º 11
0
        protected override string GetTextWithOwnership(VSTREETEXTOPTIONS tto)
        {
            if (tto == VSTREETEXTOPTIONS.TTO_DEFAULT)
              {
            var r = _location.Range;
            // TODO: use SpanshotSpan if Spanshot avalable.
            return $"{Name} {Path} - ({r.StartLine}, {r.StartColumn}) : {Text}";
              }

              return null;
        }
Ejemplo n.º 12
0
        int IVsSimpleObjectList2.GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            // TODO: make use of the text option.
            if (index >= (uint)_children.Count)
            {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            pbstrText = _children[(int)index].GetTextWithOwnership(tto);
            return(pbstrText != null ? VSConstants.S_OK : VSConstants.E_NOTIMPL);
        }
Ejemplo n.º 13
0
        protected override string GetTextWithOwnership(VSTREETEXTOPTIONS tto)
        {
            if (tto == VSTREETEXTOPTIONS.TTO_DEFAULT)
            {
                var r = _location.Range;
                // TODO: use SpanshotSpan if Spanshot avalable.
                return($"{Name} {Path} - ({r.StartLine}, {r.StartColumn}) : {Text}");
            }

            return(null);
        }
Ejemplo n.º 14
0
        public override string GetTextRepresentation(VSTREETEXTOPTIONS options) {
            FunctionScopeNode funcScope = ScopeNode as FunctionScopeNode;
            if (funcScope != null) {
                StringBuilder sb = new StringBuilder();
                GetFunctionDescription(funcScope.Definition, (text, kind, arg) => {
                    sb.Append(text);
                });
                return sb.ToString();
            }

            return Name;
        }
Ejemplo n.º 15
0
 int IVsObjectList2.GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
 {
     if (index == NullIndex)
     {
         ppszText = this.UniqueName;
     }
     else
     {
         ppszText = children[(int)index].UniqueName;
     }
     return(VSConstants.S_OK);
 }
Ejemplo n.º 16
0
        public override string GetTextRepresentation(VSTREETEXTOPTIONS options)
        {
/*
 *          FunctionScopeNode funcScope = ScopeNode as FunctionScopeNode;
 *          if (funcScope != null) {
 *              StringBuilder sb = new StringBuilder();
 *              GetFunctionDescription(funcScope.Definition, (text, kind, arg) => {
 *                  sb.Append(text);
 *              });
 *              return sb.ToString();
 *          }
 */
            return(Name);
        }
Ejemplo n.º 17
0
        public override string GetTextRepresentation(VSTREETEXTOPTIONS options)
        {
            // TODO:
            //FunctionScopeNode funcScope = ScopeNode as FunctionScopeNode;
            //if (funcScope != null) {
            //    StringBuilder sb = new StringBuilder();
            //    GetFunctionDescription(funcScope.Definition, (text, kind, arg) => {
            //        sb.Append(text);
            //    });
            //    return sb.ToString();
            //}

            return(Name);
        }
Ejemplo n.º 18
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            var displayText = GetDisplayText();
            if (IsAddedReference)
            {
                pbstrText = ServicesVSResources.bracket_plus_bracket + displayText;
            }
            else
            {
                pbstrText = ServicesVSResources.bracket_bracket + displayText;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return VSConstants.S_OK;
        }
Ejemplo n.º 19
0
        protected override string GetText(uint index, VSTREETEXTOPTIONS tto)
        {
            var item = _items[(int)index];

            switch (tto)
            {
            case VSTREETEXTOPTIONS.TTO_DISPLAYTEXT:
                return(item.DisplayText);

            case VSTREETEXTOPTIONS.TTO_SORTTEXT:
                return(index.ToString("D5"));
            }

            return(string.Empty);
        }
Ejemplo n.º 20
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            var displayText = GetDisplayText();
            if (IsAddedReference)
            {
                pbstrText = ServicesVSResources.PreviewChangesAddedPrefix + displayText;
            }
            else
            {
                pbstrText = ServicesVSResources.PreviewChangesDeletedPrefix + displayText;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return VSConstants.S_OK;
        }
        int IVsSimpleObjectList2.GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            SQObjectLibraryNode node;

            if (GetChild(index, out node) && node._declaration != null)
            {
                pbstrText = node.Name;
                return(VSConstants.S_OK);
            }
            else
            {
                pbstrText = Name;
                return(VSConstants.S_OK);
            }
        }
Ejemplo n.º 22
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            var displayText = GetDisplayText();

            if (IsAddedReference)
            {
                pbstrText = ServicesVSResources.PreviewChangesAddedPrefix + displayText;
            }
            else
            {
                pbstrText = ServicesVSResources.PreviewChangesDeletedPrefix + displayText;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return(VSConstants.S_OK);
        }
Ejemplo n.º 23
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            var displayText = GetDisplayText();

            if (IsAddedReference)
            {
                pbstrText = ServicesVSResources.bracket_plus_bracket + displayText;
            }
            else
            {
                pbstrText = ServicesVSResources.bracket_bracket + displayText;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return(VSConstants.S_OK);
        }
Ejemplo n.º 24
0
        public override string GetTextRepresentation(VSTREETEXTOPTIONS options)
        {
            StringBuilder res = new StringBuilder();

            foreach (var value in _value.Values)
            {
                bool isAlias = false;
                foreach (var desc in value.description)
                {
                    if (desc.kind == "name")
                    {
                        if (desc.text != Name)
                        {
                            isAlias = true;
                        }
                    }
                }

                if (isAlias)
                {
                    res.Append(Name);
                    res.Append(" (alias of ");
                }

                foreach (var desc in value.description)
                {
                    if (desc.kind == "enddecl")
                    {
                        break;
                    }
                    res.Append(desc.text);
                }

                if (isAlias)
                {
                    res.Append(")");
                }
            }

            if (res.Length == 0)
            {
                return(Name);
            }
            return(res.ToString());
        }
Ejemplo n.º 25
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            if (_left == null)
            {
                pbstrText = ServicesVSResources.bracket_plus_bracket + _right.Name;
            }
            else if (_right == null)
            {
                pbstrText = ServicesVSResources.bracket_bracket + _left.Name;
            }
            else
            {
                pbstrText = _right.Name;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return(VSConstants.S_OK);
        }
Ejemplo n.º 26
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            if (_left == null)
            {
                pbstrText = ServicesVSResources.PreviewChangesAddedPrefix + _right.Name;
            }
            else if (_right == null)
            {
                pbstrText = ServicesVSResources.PreviewChangesDeletedPrefix + _left.Name;
            }
            else
            {
                pbstrText = _right.Name;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return(VSConstants.S_OK);
        }
Ejemplo n.º 27
0
        public override string GetTextRepresentation(VSTREETEXTOPTIONS options)
        {
            StringBuilder res = new StringBuilder();

            foreach (var value in _value.Values)
            {
                bool isAlias = false;
                foreach (var desc in value.description)
                {
                    if (desc.kind == "name")
                    {
                        if (desc.text != Name)
                        {
                            isAlias = true;
                        }
                    }
                }

                var descriptions = new StringBuilder();
                foreach (var desc in value.description)
                {
                    if (desc.kind == "enddecl")
                    {
                        break;
                    }
                    descriptions.Append(desc.text);
                }

                if (isAlias)
                {
                    res.Append(Strings.LibraryNodeAliasOf.FormatUI(Name, descriptions));
                }
                else
                {
                    res.Append(descriptions);
                }
            }

            if (res.Length == 0)
            {
                return(Name);
            }
            return(res.ToString());
        }
Ejemplo n.º 28
0
        public override string GetTextRepresentation(VSTREETEXTOPTIONS options) {
            StringBuilder res = new StringBuilder();
            foreach (var value in _value.Values) {
                bool isAlias = false;
                foreach (var desc in value.description) {
                    if (desc.kind == "name") {
                        if (desc.text != Name) {
                            isAlias = true;
                        }
                    }
                }

                if (isAlias) {
                    res.Append(Name);
                    res.Append(" (alias of ");
                }

                foreach (var desc in value.description) {
                    if (desc.kind == "enddecl") {
                        break;
                    }
                    res.Append(desc.text);
                }

                if (isAlias) {
                    res.Append(")");
                }
            }

            if (res.Length == 0) {
                return Name;
            }
            return res.ToString();
        }
Ejemplo n.º 29
0
 public virtual string GetTextRepresentation(VSTREETEXTOPTIONS options) {
     return Name;
 }
Ejemplo n.º 30
0
 public abstract int GetText(out VSTREETEXTOPTIONS tto, out string ppszText);
Ejemplo n.º 31
0
 public override int GetText(out VSTREETEXTOPTIONS tto, out string ppszText)
 {
     tto      = VSTREETEXTOPTIONS.TTO_DEFAULT;
     ppszText = ServicesVSResources.No_Changes;
     return(VSConstants.S_OK);
 }
Ejemplo n.º 32
0
        /// <summary>
        ///     Get a pointer to the main text for the list item.
        /// </summary>
        /// <param name="index"></param>
        /// <param name="tto"></param>
        /// <param name="pbstrText"></param>
        /// <returns></returns>
        public int GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
        {
            ArgumentValidation.CheckForOutOfRangeException(index, 0, _changeList.Count - 1);

            ppszText = _changeList[(int)index].DisplayText;
            return VSConstants.S_OK;
        }
Ejemplo n.º 33
0
 /// <summary>
 /// Returns the text representations for the requested tree list item.
 /// </summary>
 /// <param name="index"></param>
 /// <param name="tto"></param>
 /// <param name="pbstrText"></param>
 /// <returns></returns>
 public int GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
 {
     //Logger.Log("ResultList GetTextWithOwnership");
     pbstrText = children[(int)index].symbolText;
     return VSConstants.S_OK;
 }
Ejemplo n.º 34
0
 int IVsLiteTreeList.GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 35
0
 public override int GetText(out VSTREETEXTOPTIONS tto, out string ppszText)
 {
     tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
     ppszText = ServicesVSResources.No_Changes;
     return VSConstants.S_OK;
 }
Ejemplo n.º 36
0
        public int GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
        {
            ppszText = _items[index].GetText(tto);

            return(VSConstants.S_OK);
        }
Ejemplo n.º 37
0
        public int GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText) {
            ppszText = _items[index].GetText(tto);

            return VSConstants.S_OK;
        }
Ejemplo n.º 38
0
 int IVsSimpleObjectList2.GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
 {
     // TODO: make use of the text option.
     if (index >= (uint)children.Count) {
         throw new ArgumentOutOfRangeException("index");
     }
     pbstrText = children[(int)index].name;
     return VSConstants.S_OK;
 }
Ejemplo n.º 39
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            if (_left == null)
            {
                pbstrText = ServicesVSResources.bracket_plus_bracket + _right.Name;
            }
            else if (_right == null)
            {
                pbstrText = ServicesVSResources.bracket_bracket + _left.Name;
            }
            else
            {
                pbstrText = _right.Name;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return VSConstants.S_OK;
        }
Ejemplo n.º 40
0
 protected virtual string GetTextWithOwnership(VSTREETEXTOPTIONS tto)
 {
     return(Name);
 }
Ejemplo n.º 41
0
 int IVsObjectList2.GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
 {
     if (index == NullIndex)
         ppszText = this.UniqueName;
     else
         ppszText = children[(int)index].UniqueName;
     return VSConstants.S_OK;
 }
Ejemplo n.º 42
0
 public int GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
 {
     return Changes[index].GetText(out tto, out ppszText);
 }
Ejemplo n.º 43
0
 protected virtual string GetTextWithOwnership(VSTREETEXTOPTIONS tto)
 {
     return Name;
 }
Ejemplo n.º 44
0
 public int GetText(uint index, VSTREETEXTOPTIONS tto, out string ppszText)
 {
     return(Changes[index].GetText(out tto, out ppszText));
 }
Ejemplo n.º 45
0
        int IVsSimpleObjectList2.GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            // TODO: make use of the text option.
            if (index >= (uint)_children.Count)
                throw new ArgumentOutOfRangeException("index");

            pbstrText = _children[(int)index].GetTextWithOwnership(tto);
            return pbstrText != null ? VSConstants.S_OK : VSConstants.E_NOTIMPL;
        }
Ejemplo n.º 46
0
 public virtual string GetTextRepresentation(VSTREETEXTOPTIONS options)
 {
     return(Name);
 }
Ejemplo n.º 47
0
 /// <summary>
 /// Returns the text representations for the requested tree list item.
 /// </summary>
 /// <param name="index"></param>
 /// <param name="tto"></param>
 /// <param name="pbstrText"></param>
 /// <returns></returns>
 public int GetTextWithOwnership(uint index, VSTREETEXTOPTIONS tto, out string pbstrText)
 {
     pbstrText = children[(int)index].symbolText;
     return(VSConstants.S_OK);
 }
Ejemplo n.º 48
0
 protected override string GetText(uint index, VSTREETEXTOPTIONS tto)
 {
     return(GetDisplayText(index, tto));
 }
Ejemplo n.º 49
0
 public abstract int GetText(out VSTREETEXTOPTIONS tto, out string ppszText);
Ejemplo n.º 50
0
 public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
 {
     pbstrText = _text;
     tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
     return VSConstants.S_OK;
 }
Ejemplo n.º 51
0
        public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
        {
            if (_left == null)
            {
                pbstrText = ServicesVSResources.PreviewChangesAddedPrefix + _right.Name;
            }
            else if (_right == null)
            {
                pbstrText = ServicesVSResources.PreviewChangesDeletedPrefix + _left.Name;
            }
            else
            {
                pbstrText = _right.Name;
            }

            tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
            return VSConstants.S_OK;
        }