• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Dom.ExpressionResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MathModuleExpressionShouldNotHaveAnyCompletionItemsSinceMathModuleIsNotImported

		public void MathModuleExpressionShouldNotHaveAnyCompletionItemsSinceMathModuleIsNotImported()
		{
			ExpressionResult result = new ExpressionResult("math", ExpressionContext.Default);
			resolveResult = resolver.Resolve(result, parseInfo, GetPythonScript());
			
			Assert.IsNull(resolveResult);
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:7,代码来源:ResolveSysModuleTestFixture.cs


示例2: Resolve

		public ResolveResult Resolve(ExpressionResult expressionResult, ParseInformation parseInfo, string fileContent)
		{
			if (parseInfo == null || (string.IsNullOrEmpty(fileContent) && !(expressionResult.Context is XamlContext)))
				return null;
			
			this.resolveExpression = expressionResult.Expression;
			this.caretLine = expressionResult.Region.BeginLine;
			this.caretColumn = expressionResult.Region.BeginColumn;
			this.callingClass = parseInfo.CompilationUnit.GetInnermostClass(caretLine, caretColumn);
			this.context = expressionResult.Context as XamlContext ?? CompletionDataHelper.ResolveContext(fileContent, parseInfo.CompilationUnit.FileName, Utils.GetOffsetFromFilePos(fileContent, caretLine, caretColumn));
			
			switch (this.context.Description) {
				case XamlContextDescription.AtTag:
				case XamlContextDescription.None:
					return ResolveElementName(resolveExpression);
				case XamlContextDescription.InTag:
					return ResolveAttribute(resolveExpression) ?? ResolveElementName(resolveExpression);
				case XamlContextDescription.InAttributeValue:
					MemberResolveResult mrr = ResolveAttribute(context.Attribute.Name);
					if (mrr != null) {
						var rr = ResolveAttributeValue(mrr.ResolvedMember, resolveExpression) ?? mrr;
						return rr;
					}
					break;
				case XamlContextDescription.InMarkupExtension:
					return ResolveMarkupExtension(resolveExpression);
			}
			
			return null;
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:30,代码来源:XamlResolver.cs


示例3: Resolve

		public ResolveResult Resolve(string expression)
		{
			ExpressionResult expressionResult = new ExpressionResult(expression);
			PythonResolverContext context = new PythonResolverContext(ParseInfo, expressionResult, String.Empty);
			ResolveResult = Resolver.Resolve(context);
			return ResolveResult;
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:PythonResolverTestsHelper.cs


示例4: ResolvePropertyExpression

		void ResolvePropertyExpression(string expression)
		{
			PythonResolverContext context = new PythonResolverContext(parseInfo);
			ExpressionResult expressionResult = new ExpressionResult(expression);
			
			PythonResolver resolver = new PythonResolver();
			result = resolver.Resolve(context, expressionResult);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:ResolveClassPropertyTests.cs


示例5: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			IClass matchingClass = GetClass(resolverContext, expressionResult.Expression);
			if (matchingClass != null) {
				return CreateTypeResolveResult(matchingClass);
			}
			return null;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:PythonClassResolver.cs


示例6: PythonResolverContext

		public PythonResolverContext(ParseInformation parseInfo, ExpressionResult expressionResult, string fileContent)
		{
			this.fileContent = fileContent;
			this.expressionResult = expressionResult;
			GetCompilationUnit(parseInfo);
			GetProjectContent();
			GetCallingMember();
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:8,代码来源:PythonResolverContext.cs


示例7: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			ResolveResult resolveResult = dotNetMethodResolver.Resolve(resolverContext, expressionResult);
			if (resolveResult != null) {
				return resolveResult;
			}
			return standardModuleMethodResolver.Resolve(resolverContext, expressionResult);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:PythonMethodResolver.cs


示例8: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			IProperty property = FindProperty(resolverContext, expressionResult.Expression);
			if (property != null) {
				return CreateMemberResolveResult(property);
			}
			return null;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:PythonPropertyResolver.cs


示例9: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			PythonStandardModuleType type = GetStandardModuleTypeIfImported(resolverContext, expressionResult.Expression);
			if (type != null) {
				return new PythonStandardModuleResolveResult(type);
			}
			return null;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:PythonStandardModuleResolver.cs


示例10: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			MemberName memberName = new MemberName(expressionResult.Expression);
			IClass matchingClass = classResolver.GetClass(resolverContext, memberName.Type);
			if (matchingClass != null) {
				return new PythonMethodGroupResolveResult(matchingClass, memberName.Name);
			}
			return null;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:PythonDotNetMethodResolver.cs


示例11: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			if (resolverContext.HasCallingClass) {
				if (IsSelfExpression(expressionResult)) {
					return CreateResolveResult(resolverContext);
				}
			}
			return null;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:PythonSelfResolver.cs


示例12: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			this.resolverContext = resolverContext;
			this.expressionResult = expressionResult;
			
			if (resolverContext.HasImport(expressionResult.Expression)) {
				return ResolveFullNamespace();
			}
			return ResolvePartialNamespaceMatch();
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:10,代码来源:PythonNamespaceResolver.cs


示例13: RefactoringMenuContext

		public RefactoringMenuContext(ITextEditor editor, ExpressionResult expressionResult,
		                              ResolveResult resolveResult, bool isDefinition,
		                              IProjectContent projectContent, ICompilationUnit compilationUnit)
		{
			this.Editor = editor;
			this.ExpressionResult = expressionResult;
			this.ResolveResult = resolveResult;
			this.IsDefinition = isDefinition;
			this.ProjectContent = projectContent;
			this.CompilationUnit = compilationUnit;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:11,代码来源:RefactoringMenuBuilder.cs


示例14: ProvideInsight

		public override IInsightItem[] ProvideInsight(ExpressionResult expressionResult, ResolveResult result)
		{
			if (result == null)
				return null;
			IReturnType type = result.ResolvedType;
			if (type == null)
				return null;
			return (from p in type.GetProperties()
			        where p.IsIndexer
			        select new MethodInsightItem(p)
			       ).ToArray();
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:12,代码来源:IndexerInsightProvider.cs


示例15: Resolve

		/// <summary>
		/// Tries to find a resource reference in the specified expression.
		/// </summary>
		/// <param name="expressionResult">The ExpressionResult for the expression.</param>
		/// <param name="expr">The AST representation of the full expression.</param>
		/// <param name="resolveResult">SharpDevelop's ResolveResult for the expression.</param>
		/// <param name="caretLine">The 0-based line where the expression is located.</param>
		/// <param name="caretColumn">The 0-based column where the expression is located.</param>
		/// <param name="fileName">The name of the source file where the expression is located.</param>
		/// <param name="fileContent">The content of the source file where the expression is located.</param>
		/// <param name="expressionFinder">The ExpressionFinder for the file.</param>
		/// <param name="charTyped">The character that has been typed at the caret position but is not yet in the buffer (this is used when invoked from code completion), or <c>null</c>.</param>
		/// <returns>A ResourceResolveResult describing the referenced resource, or <c>null</c>, if this expression does not reference a resource using the ICSharpCode.Core.ResourceService class.</returns>
		public ResourceResolveResult Resolve(ExpressionResult expressionResult, Expression expr, ResolveResult resolveResult, int caretLine, int caretColumn, string fileName, string fileContent, IExpressionFinder expressionFinder, char? charTyped)
		{
			IMember member = null;
			
			// "ResourceService.GetString(..." may be a MemberResolveResult or
			// MethodResolveResult, dependent on how much of the expression
			// has already been typed.
			MemberResolveResult mrr = resolveResult as MemberResolveResult;
			if (mrr != null) {
				
				// If it is a MemberResolveResult, this indicates that
				// the complete expression is already in the buffer.
				// So we only assign the member if Resolve is not invoked
				// from code completion to prevent the code completion window
				// from opening when typing something like:
				// ResourceService.GetString(...)[
				if (charTyped == null) {
					member = mrr.ResolvedMember;
				}
				
			} else {
				
				MethodGroupResolveResult methrr = resolveResult as MethodGroupResolveResult;
				if (methrr != null) {
					
					// If it is a MethodResolveResult, the expression is incomplete.
					// Accept only if '(' has been typed.
					if (charTyped == '(') {
						member = methrr.GetMethodIfSingleOverload();
					}
					
				}
				
			}
			
			if (member is IMethod &&
			    LanguageProperties.CSharp.NameComparer.Equals(member.FullyQualifiedName, "ICSharpCode.Core.ResourceService.GetString")
			   ) {
				
				#if DEBUG
				LoggingService.Debug("ResourceToolkit: ICSharpCodeCoreNRefactoryResourceResolver: ResourceService resource access detected");
				#endif
				
				string key = GetKeyFromExpression(expr);
				
				// TODO: Add information about return type (of the resource, if present).
				return new ResourceResolveResult(resolveResult.CallingClass, resolveResult.CallingMember, null, ICSharpCodeCoreResourceResolver.ResolveICSharpCodeCoreResourceSet(key, fileName), key);
				
			}
			
			return null;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:65,代码来源:ICSharpCodeCoreNRefactoryResourceResolver.cs


示例16: Resolve

		public ResolveResult Resolve(ExpressionResult expressionResult, ParseInformation parseInfo, string fileContent)
		{
			if (String.IsNullOrEmpty(fileContent)) {
				return null;
			}
			
			resolverContext = new PythonResolverContext(parseInfo);
			if (!resolverContext.GetCallingMember(expressionResult.Region)) {
				return null;
			}
			
			return Resolve(resolverContext, expressionResult);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:13,代码来源:PythonResolver.cs


示例17: Resolve

		public ResolveResult Resolve(ExpressionResult expressionResult, ParseInformation parseInfo, string fileContent)
		{
			if (String.IsNullOrEmpty(fileContent)) {
				return null;
			}
			
			resolverContext = new PythonResolverContext(parseInfo, expressionResult, fileContent);
			if (!resolverContext.HasProjectContent) {
				return null;
			}
			
			return Resolve(resolverContext);
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:13,代码来源:PythonResolver.cs


示例18: Resolve

		public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
		{
			MemberName memberName = new MemberName(expressionResult.Expression);
			MethodGroupResolveResult result = ResolveMethodFromImportedNames(resolverContext, memberName);
			if (result != null) {
				return result;
			}
			result = ResolveIfMethodIsImported(resolverContext, memberName);
			if (result != null) {
				return result;
			}
			return ResolveMethodFromModulesThatImportEverything(resolverContext, memberName);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:13,代码来源:PythonStandardModuleMethodResolver.cs


示例19: InitBase

		public void InitBase()
		{
			projectContent = new MockProjectContent();
			PythonParser parser = new PythonParser();
			string fileName = @"C:\projects\test\test.py";
			compilationUnit = parser.Parse(projectContent, fileName, GetPythonScript());
			parseInfo = new ParseInformation(compilationUnit);
			
			resolver = new PythonResolver();
			
			expressionResult = GetExpressionResult();
			resolveResult = resolver.Resolve(expressionResult, parseInfo, GetPythonScript());
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:13,代码来源:ResolveTestsBase.cs


示例20: SetupDataProvider

		protected override void SetupDataProvider(string fileName, IDocument document, ExpressionResult expressionResult, int caretLineNumber, int caretColumn)
		{
			ResolveResult result = ParserService.Resolve(expressionResult, caretLineNumber, caretColumn, fileName, document.TextContent);
			if (result == null)
				return;
			IReturnType type = result.ResolvedType;
			if (type == null)
				return;
			foreach (IProperty i in type.GetProperties()) {
				if (i.IsIndexer) {
					methods.Add(i);
				}
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:14,代码来源:IndexerInsightDataProvider.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Dom.LanguageProperties类代码示例发布时间:2022-05-26
下一篇:
C# SharpDevelop.OpenedFile类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap