当前位置: 首页>>代码示例>>C#>>正文


C# CodeCompletion.TooltipInformation类代码示例

本文整理汇总了C#中MonoDevelop.Ide.CodeCompletion.TooltipInformation的典型用法代码示例。如果您正苦于以下问题:C# TooltipInformation类的具体用法?C# TooltipInformation怎么用?C# TooltipInformation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TooltipInformation类属于MonoDevelop.Ide.CodeCompletion命名空间,在下文中一共展示了TooltipInformation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateTooltipInformation

 public override TooltipInformation CreateTooltipInformation(bool smartWrap)
 {
     TooltipInformation tmpTooltip = new TooltipInformation ();
     tmpTooltip.SummaryMarkup = Description;
     tmpTooltip.SignatureMarkup = "<b>" + DisplayText + "</b>";
     return tmpTooltip;
 }
开发者ID:profelis,项目名称:md-haxebinding,代码行数:7,代码来源:HaxeCompletionData.cs

示例2: CreateTooltipInformation

		public virtual Task<TooltipInformation> CreateTooltipInformation (bool smartWrap, CancellationToken cancelToken)
		{
			var tt = new TooltipInformation ();
			if (!string.IsNullOrEmpty (Description))
				tt.AddCategory (null, Description);
			return Task.FromResult (tt);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:CompletionData.cs

示例3: Generate

        public static TooltipInformation Generate(DMethod dm, bool isTemplateParamInsight=false, int currentParam=-1)
        {
            var tti = new TooltipInformation();
            var sb = new StringBuilder();

            sb.Append ("<i>(");
            string name;
            switch (dm.SpecialType) {
                case DMethod.MethodType.Constructor:
                    sb.Append ("Constructor");
                    name = dm.Parent.Name;
                    break;
                case DMethod.MethodType.Destructor:
                    sb.Append ("Destructor");
                    name = dm.Parent.Name;
                    break;
                case DMethod.MethodType.Allocator:
                    sb.Append ("Allocator");
                    name = dm.Parent.Name;
                    break;
                default:
                    sb.Append ("Method");
                    name = dm.Name;
                    break;
            }
            sb.Append (")</i> ");

            if (dm.Type != null)
            {
                sb.Append(dm.Type.ToString(true));
                sb.Append(" ");
            }
            else if (dm.Attributes != null && dm.Attributes.Count != 0)
            {
                foreach (var attr in dm.Attributes)
                {
                    var m = attr as Modifier;
                    if (m != null && DTokens.StorageClass[m.Token])
                    {
                        sb.Append(DTokens.GetTokenString(m.Token));
                        sb.Append(" ");
                        break;
                    }
                }
            }

            sb.Append(name);

            /*TODO: Show attributes?
            if (dm.Attributes != null && dm.Attributes.Count > 0)
                s = dm.AttributeString + ' ';
            */

            RenderParamtersAndFooters (tti, dm, sb, isTemplateParamInsight, currentParam);

            return tti;
        }
开发者ID:Geod24,项目名称:Mono-D,代码行数:57,代码来源:TooltipInfoGenerator.cs

示例4: CreateTooltipInformation

		public override TooltipInformation CreateTooltipInformation (bool smartWrap)
		{
			var tooltipInfo = new TooltipInformation ();
			var resolver = ext.CSharpUnresolvedFile.GetResolver (ext.Compilation, ext.Document.Editor.Caret.Location);
			var sig = new SignatureMarkupCreator (resolver, ext.FormattingPolicy.CreateOptions ());
			sig.BreakLineAfterReturnType = smartWrap;
			tooltipInfo.SignatureMarkup = sig.GetLocalVariableMarkup (Variable);
			return tooltipInfo;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:9,代码来源:VariableCompletionData.cs

示例5: CreateTooltipBody

		static void CreateTooltipBody(TooltipMarkupGen markupGen, DNode dn, TooltipInformation tti)
		{
			string summary;
			Dictionary<string,string> categories;

			markupGen.GenToolTipBody (dn, out summary, out categories);

			tti.SummaryMarkup = summary;
			if (categories != null)
				foreach (var kv in categories)
					tti.AddCategory (kv.Key, kv.Value);
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:12,代码来源:TooltipInfoGen.cs

示例6: Create

		public static TooltipInformation Create(DNode dn, ColorScheme st, bool templateParamCompletion = false, int currentMethodParam = -1)
		{
			var markupGen = new TooltipMarkupGen (st);

			var tti = new TooltipInformation { 
				SignatureMarkup = markupGen.GenTooltipSignature(dn, templateParamCompletion, currentMethodParam)
			};

			CreateTooltipBody (markupGen, dn, tti);

			return tti;
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:12,代码来源:TooltipInfoGen.cs

示例7: CreateTooltipInformation

		public override TooltipInformation CreateTooltipInformation (int overload, int currentParameter, bool smartWrap)
		{
			var tooltipInfo = new TooltipInformation ();
			var file = ext.CSharpUnresolvedFile;
			var compilation = ext.UnresolvedFileCompilation;
			var textEditorData = ext.TextEditorData;
			var formattingPolicy = ext.FormattingPolicy;
			var resolver = file.GetResolver (compilation, textEditorData.Caret.Location);
			var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
			sig.HighlightParameter = currentParameter;
			tooltipInfo.SignatureMarkup = sig.GetArrayIndexerMarkup (arrayType);
			return tooltipInfo;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:13,代码来源:ArrayTypeParameterDataProvider.cs

示例8: AddOverload

		public void AddOverload (TooltipInformation tooltipInformation)
		{
			if (tooltipInformation == null || tooltipInformation.IsEmpty)
				return;
			overloads.Add (tooltipInformation);

			if (overloads.Count > 1) {
				Theme.DrawPager = true;
				Theme.NumPages = overloads.Count;
			}

			ShowOverload ();
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:13,代码来源:TooltipInformationWindow.cs

示例9: AddOverload

		public void AddOverload (TooltipInformation tooltipInformation)
		{
			if (tooltipInformation == null || string.IsNullOrEmpty (tooltipInformation.SignatureMarkup))
				return;
			overloads.Add (tooltipInformation);

			if (overloads.Count > 1) {
				Theme.DrawPager = true;
				Theme.NumPages = overloads.Count;
			}

			ShowOverload ();
		}
开发者ID:hippiehunter,项目名称:monodevelop,代码行数:13,代码来源:TooltipInformationWindow.cs

示例10: Generate

        public static TooltipInformation Generate(DelegateDeclaration dd, int currentParam = -1)
        {
            var sb = new StringBuilder("<i>(Delegate)</i> ");

            if (dd.ReturnType != null)
                sb.Append(dd.ReturnType.ToString(true)).Append(' ');

            if (dd.IsFunction)
                sb.Append("function");
            else
                sb.Append("delegate");

            sb.Append('(');
            if (dd.Parameters != null && dd.Parameters.Count != 0)
            {
                for (int i = 0; i < dd.Parameters.Count; i++)
                {
                    var p = dd.Parameters[i] as DNode;
                    if (i == currentParam)
                    {
                        sb.Append("<u>");
                        sb.Append(p.ToString(false));
                        sb.Append("</u>,");
                    }
                    else
                        sb.Append(p.ToString(false)).Append(',');
                }

                sb.Remove(sb.Length - 1, 1);
            }
            sb.Append(')');

            var tti = new TooltipInformation();
            tti.SignatureMarkup = sb.ToString();

            return tti;
        }
开发者ID:simendsjo,项目名称:Mono-D,代码行数:37,代码来源:TooltipInfoGenerator.cs

示例11: GetExternAliasTooltip

		public TooltipInformation GetExternAliasTooltip (ExternAliasDirectiveSyntax externAliasDeclaration, DotNetProject project)
		{
			var result = new TooltipInformation ();
			result.SignatureMarkup = Highlight ("extern ", colorStyle.KeywordModifiers) + Highlight ("alias ", colorStyle.KeywordNamespace) + externAliasDeclaration.Identifier;
			if (project == null)
				return result;
			foreach (var r in project.References) {
				if (string.IsNullOrEmpty (r.Aliases))
					continue;
				foreach (var alias in r.Aliases.Split (',', ';')) {
					if (alias == externAliasDeclaration.Identifier.ToFullString ())
						result.AddCategory (GettextCatalog.GetString ("Reference"), r.StoredReference);
				}
			}

			return result;
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:17,代码来源:SignatureMarkupCreator.cs

示例12: GetTypeOfTooltip

		public TooltipInformation GetTypeOfTooltip (TypeOfExpressionSyntax typeOfExpression, ITypeSymbol resolveResult)
		{
			var result = new TooltipInformation ();
			if (resolveResult == null) {
				result.SignatureMarkup = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (typeOfExpression.Type.ToString ());
			} else {
				result.SignatureMarkup = GetTypeMarkup (resolveResult, true);
			}
			return result;
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:10,代码来源:SignatureMarkupCreator.cs

示例13: GetConstraintTooltip

		public TooltipInformation GetConstraintTooltip (SyntaxToken keyword)
		{
			var result = new TooltipInformation ();

			var color = AlphaBlend (colorStyle.PlainText.Foreground, colorStyle.PlainText.Background, optionalAlpha);
			var colorString = MonoDevelop.Components.HelperMethods.GetColorString (color);

			var keywordSign = "<span foreground=\"" + colorString + "\"> " + GettextCatalog.GetString ("(keyword)") + "</span>";

			result.SignatureMarkup = Highlight (keyword.ToFullString (), colorStyle.KeywordTypes) + keywordSign;

			switch (keyword.Parent.Kind ()) {
			case SyntaxKind.ClassConstraint:
				result.AddCategory (GettextCatalog.GetString ("Constraint"), GettextCatalog.GetString ("The type argument must be a reference type; this applies also to any class, interface, delegate, or array type."));
				break;
			case SyntaxKind.ConstructorConstraint:
				result.AddCategory (GettextCatalog.GetString ("Constraint"), GettextCatalog.GetString ("The type argument must have a public parameterless constructor. When used together with other constraints, the new() constraint must be specified last."));
				break;
			case SyntaxKind.StructConstraint:
				result.AddCategory (GettextCatalog.GetString ("Constraint"), GettextCatalog.GetString ("The type argument must be a value type. Any value type except Nullable can be specified. See Using Nullable Types (C# Programming Guide) for more information."));
				break;
			}

			return result;
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:25,代码来源:SignatureMarkupCreator.cs

示例14: ShowTooltip

		async void ShowTooltip ()
		{
			var currentSelectedItem = selectedItem;
			if (currentSelectedItem == null || currentSelectedItem.DataSource == null) {
				HideTooltip ();
				return;
			}
			var i = currentSelectedItem.Item;
			if (i < 0 || i >= currentSelectedItem.DataSource.Count)
				return;

			if (tooltipSrc != null)
				tooltipSrc.Cancel ();
			tooltipSrc = new CancellationTokenSource ();
			var token = tooltipSrc.Token;

			try {
				currentTooltip = await currentSelectedItem.DataSource [i].GetTooltipInformation (token);
			} catch (OperationCanceledException) {
				HideTooltip ();
				return;
			} catch (Exception e) {
				LoggingService.LogError ("Error while creating search popup window tooltip", e);
				HideTooltip ();
				return;
			}
			if (currentTooltip == null || string.IsNullOrEmpty (currentTooltip.SignatureMarkup) || token.IsCancellationRequested) {
				HideTooltip ();
				return;
			}
			
			declarationviewwindow.Clear ();
			declarationviewwindow.AddOverload (currentTooltip);
			declarationviewwindow.CurrentOverload = 0;
			declarationviewwindow.ShowArrow = true;
			var rect = SelectedItemRectangle;
			declarationviewwindow.ShowPopup (this, new Gdk.Rectangle (0, (int)rect.Y - 5, Allocation.Width, (int)rect.Height), PopupPosition.Right);
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:38,代码来源:SearchPopupWindow.cs

示例15: CreateTooltip

		TooltipInformation CreateTooltip (ToolTipData data, int offset, Ambience ambience)
		{
			ResolveResult result = data.Result;
			var doc = IdeApp.Workbench.ActiveDocument;
			if (doc == null)
				return null;
			try {

				if (result is AliasNamespaceResolveResult) {
					var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
					var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
					sig.BreakLineAfterReturnType = false;
					return sig.GetAliasedNamespaceTooltip ((AliasNamespaceResolveResult)result);
				}
				
				if (result is AliasTypeResolveResult) {
					var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
					var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
					sig.BreakLineAfterReturnType = false;
					return sig.GetAliasedTypeTooltip ((AliasTypeResolveResult)result);
				}
				
				if (data.Node is TypeOfExpression) {
					var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
					var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
					sig.BreakLineAfterReturnType = false;
					return sig.GetTypeOfTooltip ((TypeOfExpression)data.Node, result as TypeOfResolveResult);
				}
				if (data.Node is PrimitiveType && data.Node.Parent is Constraint) {
					var t = (PrimitiveType)data.Node;
					if (t.Keyword == "class" || t.Keyword == "new" || t.Keyword == "struct") {
						var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
						var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
						sig.BreakLineAfterReturnType = false;
						return sig.GetConstraintTooltip (t.Keyword);
					}
					return null;
				}
				if (data.Node is ExternAliasDeclaration) {
					var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
					var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
					sig.BreakLineAfterReturnType = false;
					return sig.GetExternAliasTooltip ((ExternAliasDeclaration)data.Node, doc.Project as DotNetProject);
				}
				if (result == null && data.Node is CSharpTokenNode) {
					var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
					var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
					sig.BreakLineAfterReturnType = false;
					return sig.GetKeywordTooltip (data.Node);
				}
				if (data.Node is PrimitiveType && ((PrimitiveType)data.Node).KnownTypeCode == KnownTypeCode.Void) {
					var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
					var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
					sig.BreakLineAfterReturnType = false;
					return sig.GetKeywordTooltip ("void", null);
				}

				if (result is UnknownIdentifierResolveResult) {
					return new TooltipInformation () {
						SignatureMarkup = string.Format ("error CS0103: The name `{0}' does not exist in the current context", ((UnknownIdentifierResolveResult)result).Identifier)
					};
				} else if (result is UnknownMemberResolveResult) {
					var ur = (UnknownMemberResolveResult)result;
					if (ur.TargetType.Kind != TypeKind.Unknown) {
						return new TooltipInformation () {
							SignatureMarkup = string.Format ("error CS0117: `{0}' does not contain a definition for `{1}'", ur.TargetType.FullName, ur.MemberName)
						};
					}
				} else if (result.IsError) {
					return new TooltipInformation () {
						SignatureMarkup = "Unknown resolve error."
					};
				}
				if (result is LocalResolveResult) {
					var lr = (LocalResolveResult)result;
					var tooltipInfo = new TooltipInformation ();
					var resolver = (doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile).GetResolver (doc.Compilation, doc.Editor.Caret.Location);
					var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
					sig.BreakLineAfterReturnType = false;
					tooltipInfo.SignatureMarkup = sig.GetLocalVariableMarkup (lr.Variable);
					return tooltipInfo;
				} else if (result is MethodGroupResolveResult) {
					var mrr = (MethodGroupResolveResult)result;
					var allMethods = new List<IMethod> (mrr.Methods);
					foreach (var l in mrr.GetExtensionMethods ()) {
						allMethods.AddRange (l);
					}
				
					var method = allMethods.FirstOrDefault ();
					if (method != null) {
						return MemberCompletionData.CreateTooltipInformation (
						doc.Compilation,
						doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile,
						doc.Editor,
						doc.GetFormattingPolicy (),
						method, 
						false);
					}
				} else if (result is CSharpInvocationResolveResult) {
					var member = ((CSharpInvocationResolveResult)result).ReducedMethod ?? (IMethod)((CSharpInvocationResolveResult)result).Member;
//.........这里部分代码省略.........
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:101,代码来源:LanguageItemTooltipProvider.cs


注:本文中的MonoDevelop.Ide.CodeCompletion.TooltipInformation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。