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

C# IUnresolvedMember类代码示例

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

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



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

示例1: CreateEventCreationCompletionData

 public ICompletionData CreateEventCreationCompletionData(string varName, IType delegateType, IEvent evt,
                                                          string parameterDefinition,
                                                          IUnresolvedMember currentMember,
                                                          IUnresolvedTypeDefinition currentType)
 {
     return new CompletionData(varName);
 }
开发者ID:CSRedRat,项目名称:Omnisharp,代码行数:7,代码来源:CompletionDataFactory.cs


示例2: Update

		/// <summary>
		/// Updates the member model with the specified new member.
		/// </summary>
		public void Update(IUnresolvedMember newMember)
		{
			if (newMember == null)
				throw new ArgumentNullException("newMember");
			this.member = newMember;
			RaisePropertyChanged();
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:10,代码来源:MemberModel.cs


示例3: MemberModel

		public MemberModel(IEntityModelContext context, IUnresolvedMember member)
		{
			if (context == null)
				throw new ArgumentNullException("context");
			if (member == null)
				throw new ArgumentNullException("member");
			this.context = context;
			this.member = member;
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:9,代码来源:MemberModel.cs


示例4: NewPartialCompletionData

 public NewPartialCompletionData(int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember member)
 {
     DeclarationBeginningIndex = declarationBegin;
     Type = type;
     Member = member;
     // check this:
     DeclarationCategory = type.SymbolKind.ResolveDeclarationCategoryFromSymbolKind();
     SetDefaultText(member.Name);
 }
开发者ID:uluhonolulu,项目名称:QCCodingServices.NET,代码行数:9,代码来源:NewPartialCompletionData.cs


示例5: Node

        /// <summary>
        ///   Initializes a new instance with no child nodes for the
        ///   given member.
        /// </summary>
        public Node(IUnresolvedMember member, IDocument document) {
            this.ChildNodes = null;
            this.Location = QuickFix.ForNonBodyRegion(member, document);

            // Fields' BodyRegion does not include their name for some
            // reason. To prevent the field's name missing, include
            // the whole region for them.
			if (member.SymbolKind == SymbolKind.Field)
                this.Location.Text += member.Name;
        }
开发者ID:Reese-D,项目名称:my_emacs,代码行数:14,代码来源:Node.cs


示例6: EventCreationCompletionData

		public EventCreationCompletionData(string handlerName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret)
		{
			if (string.IsNullOrEmpty(handlerName)) {
				handlerName = (evt != null ? evt.Name : "Handle");
			}
			this.handlerName = handlerName;
			this.DisplayText = "<Create " + handlerName + ">";
			this.delegateTypeReference = delegateType.ToTypeReference();
			this.isStatic = callingMember != null && callingMember.IsStatic;
		}
开发者ID:fanyjie,项目名称:SharpDevelop,代码行数:10,代码来源:EventCreationCompletionData.cs


示例7: EventCreationCompletionData

		public EventCreationCompletionData(string handlerName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret)
		{
			if (string.IsNullOrEmpty(handlerName)) {
				handlerName = (evt != null ? evt.Name : "Handle");
			}
			this.handlerName = handlerName;
			this.DisplayText = StringParser.Parse("${res:CSharpBinding.Refactoring.EventCreation.EventHandlerText}", new[] { new StringTagPair("HandlerName", handlerName) });
			this.delegateTypeReference = delegateType.ToTypeReference();
			this.isStatic = callingMember != null && callingMember.IsStatic;
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:10,代码来源:EventCreationCompletionData.cs


示例8: EventCompletionData

            public EventCompletionData(string varName, IType delegateType, IEvent evt, string parameterDefinition, IUnresolvedMember currentMember, IUnresolvedTypeDefinition currentType)
            {
                SetDefaultText(varName);
                DeclarationCategory = DeclarationCategory.Event;
                // what should we do with parameterDefinition???
                DelegateType = delegateType;
                CurrentMember = currentMember;
                CurrentType = currentType;

                //Description = currentMember
            }
开发者ID:uluhonolulu,项目名称:QCCodingServices.NET,代码行数:11,代码来源:EventCompletionData.cs


示例9: EventCreationCompletionData

		public EventCreationCompletionData(string varName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret) : base(evt)
		{
			if (string.IsNullOrEmpty(varName)) {
				this.DisplayText = "Create handler for " + (evt != null ? evt.Name : "");
			}
			else {
				this.DisplayText = "Create handler for " + char.ToUpper(varName[0]) + varName.Substring(1) + (evt != null ? evt.Name : "");
			}
			
			this.DisplayText = "<" + this.DisplayText + ">";
			this.eventDefinition = evt;
			this.delegateType = delegateType;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:13,代码来源:EventCreationCompletionData.cs


示例10: GetLocalVariableTypes

			public IReadOnlyList<ITypeReference> GetLocalVariableTypes(IUnresolvedMember member)
			{
				rwLock.EnterReadLock();
				try {
					ITypeReference[] result;
					if (localVariableTypes.TryGetValue(member, out result))
						return result;
					else
						return EmptyList<ITypeReference>.Instance;
				} finally {
					rwLock.ExitReadLock();
				}
			}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:13,代码来源:TypeSystemExtensions.cs


示例11: CanMatch

		bool CanMatch(IUnresolvedMember member)
		{
			switch (member.SymbolKind) {
				case SymbolKind.Field:
					return memberType == 'F';
				case SymbolKind.Property:
				case SymbolKind.Indexer:
					return memberType == 'P';
				case SymbolKind.Event:
					return memberType == 'E';
				case SymbolKind.Method:
				case SymbolKind.Operator:
				case SymbolKind.Constructor:
				case SymbolKind.Destructor:
					return memberType == 'M';
				default:
					throw new NotSupportedException(member.SymbolKind.ToString());
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:19,代码来源:IdStringMemberReference.cs


示例12: CanMatch

		bool CanMatch(IUnresolvedMember member)
		{
			switch (member.EntityType) {
				case EntityType.Field:
					return memberType == 'F';
				case EntityType.Property:
				case EntityType.Indexer:
					return memberType == 'P';
				case EntityType.Event:
					return memberType == 'E';
				case EntityType.Method:
				case EntityType.Operator:
				case EntityType.Constructor:
				case EntityType.Destructor:
					return memberType == 'M';
				default:
					throw new NotSupportedException(member.EntityType.ToString());
			}
		}
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:19,代码来源:IdStringMemberReference.cs


示例13: EventCreationCompletionData

		public EventCreationCompletionData (CSharpCompletionTextEditorExtension ext, string varName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType) : base (null)
		{
			if (string.IsNullOrEmpty (varName)) {
				this.DisplayText   = "Handle" + (evt != null ? evt.Name : "");
			} else {
				this.DisplayText   = "Handle" + Char.ToUpper (varName[0]) + varName.Substring (1) + (evt != null ? evt.Name : "");
			}
			
			if (declaringType != null && declaringType.Members.Any (m => m.Name == this.DisplayText)) {
				for (int i = 1; i < 10000; i++) {
					if (!declaringType.Members.Any (m => m.Name == this.DisplayText + i)) {
						this.DisplayText = this.DisplayText + i.ToString ();
						break;
					}
				}
			}
			this.editor        = ext.TextEditorData;
			this.parameterList = parameterList;
			this.callingMember = callingMember;
			this.Icon          = "md-newmethod";
			this.initialOffset = editor.Caret.Offset;
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:22,代码来源:EventCreationCompletionData.cs


示例14: AddNewMember

		public static void AddNewMember (ITypeDefinition type, IUnresolvedTypeDefinition part, IUnresolvedMember newMember, bool implementExplicit = false)
		{
			bool isOpen;
			var data = TextFileProvider.Instance.GetTextEditorData (part.Region.FileName, out isOpen);
			var parsedDocument = TypeSystemService.ParseFile (data.FileName, data.MimeType, data.Text);
			
			var insertionPoints = GetInsertionPoints (data, parsedDocument, part);
			
			var suitableInsertionPoint = GetSuitableInsertionPoint (insertionPoints, part, newMember);
			
			var generator = CreateCodeGenerator (data, type.Compilation);

			generator.IndentLevel = CalculateBodyIndentLevel (parsedDocument.GetInnermostTypeDefinition (type.Region.Begin));
			var generatedCode = generator.CreateMemberImplementation (type, part, newMember, implementExplicit);
			suitableInsertionPoint.Insert (data, generatedCode.Code);
			if (!isOpen) {
				try {
					File.WriteAllText (type.Region.FileName, data.Text);
				} catch (Exception e) {
					LoggingService.LogError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName), e);
					MessageService.ShowError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName));
				}
			}
		}
开发者ID:dodev,项目名称:monodevelop,代码行数:24,代码来源:CodeGenerationService.cs


示例15: GetCurrentMembers

		public void GetCurrentMembers(int offset, out IUnresolvedTypeDefinition currentType, out IUnresolvedMember currentMember)
		{
			//var document = engine.document;
			var location = document.GetLocation(offset);
			
			currentType = null;
			
			foreach (var type in unresolvedFile.TopLevelTypeDefinitions) {
				if (type.Region.Begin < location)
					currentType = type;
			}
			currentType = FindInnerType (currentType, location);
			
			// location is beyond last reported end region, now we need to check, if the end region changed
			if (currentType != null && currentType.Region.End < location) {
				if (!IsInsideType (currentType, location))
					currentType = null;
			}
			currentMember = null;
			if (currentType != null) {
				foreach (var member in currentType.Members) {
					if (member.Region.Begin < location && (currentMember == null || currentMember.Region.Begin < member.Region.Begin))
						currentMember = member;
				}
			}
			
			// location is beyond last reported end region, now we need to check, if the end region changed
			// NOTE: Enums are a special case, there the "last" field needs to be treated as current member
			if (currentMember != null && currentMember.Region.End < location && currentType.Kind != TypeKind.Enum) {
				if (!IsInsideType (currentMember, location))
					currentMember = null;
			}/*
			var stack = GetBracketStack (engine.GetMemberTextToCaret ().Item1);
			if (stack.Count == 0)
				currentMember = null;*/
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:36,代码来源:ICompletionContextProvider.cs


示例16: MemberSearchResult

		public MemberSearchResult (string match, string matchedString, int rank, ITypeDefinition declaringType, IUnresolvedMember member, bool useFullName) : base (match, matchedString, rank)
		{
			this.declaringType = declaringType;
			this.member = member;
			this.useFullName = useFullName;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:6,代码来源:SearchResult.cs


示例17: CreateMemberImplementation

		public override CodeGeneratorMemberResult CreateMemberImplementation (ITypeDefinition implementingType,
		                                                                      IUnresolvedTypeDefinition part,
		                                                                      IUnresolvedMember member,
		                                                                      bool explicitDeclaration)
		{
			SetIndentTo (part);
			var options = new CodeGenerationOptions () {
				ExplicitDeclaration = explicitDeclaration,
				ImplementingType = implementingType,
				Part = part
			};
			ITypeResolveContext ctx;

			var doc = IdeApp.Workbench.GetDocument (part.Region.FileName);
			ctx = new CSharpTypeResolveContext (implementingType.Compilation.MainAssembly, null, implementingType, null);
			options.Document = doc;

			if (member is IUnresolvedMethod)
				return GenerateCode ((IMethod) ((IUnresolvedMethod)member).CreateResolved (ctx), options);
			if (member is IUnresolvedProperty)
				return GenerateCode ((IProperty) ((IUnresolvedProperty)member).CreateResolved (ctx), options);
			if (member is IUnresolvedField)
				return GenerateCode ((IField) ((IUnresolvedField)member).CreateResolved (ctx), options);
			if (member is IUnresolvedEvent)
				return GenerateCode ((IEvent) ((IUnresolvedEvent)member).CreateResolved (ctx), options);
			throw new NotSupportedException ("member " +  member + " is not supported.");
		}
开发者ID:ConorMurph1991,项目名称:monodevelop,代码行数:27,代码来源:CSharpCodeGenerator.cs


示例18: GetSuitableInsertionPoint

		static InsertionPoint GetSuitableInsertionPoint (IEnumerable<InsertionPoint> points, IUnresolvedTypeDefinition cls, IUnresolvedMember member)
		{
			var mainPart = cls;
			switch (member.EntityType) {
			case EntityType.Field:
				return GetNewFieldPosition (points, mainPart);
			case EntityType.Method:
			case EntityType.Constructor:
			case EntityType.Destructor:
			case EntityType.Operator:
				return GetNewMethodPosition (points, mainPart);
			case EntityType.Event:
				return GetNewEventPosition (points, mainPart);
			case EntityType.Property:
				return GetNewPropertyPosition (points, mainPart);
			}
			throw new InvalidOperationException ("Invalid member type: " + member.EntityType);
		}
开发者ID:dodev,项目名称:monodevelop,代码行数:18,代码来源:CodeGenerationService.cs


示例19: CreateNewPartialCompletionData

			public ICompletionData CreateNewPartialCompletionData (int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember m)
			{
				return new CompletionData (m.Name);
			}
开发者ID:cohenw,项目名称:NRefactory,代码行数:4,代码来源:CodeCompletionBugTests.cs


示例20: CreateMemberImplementation

		public override CodeGeneratorMemberResult CreateMemberImplementation (ITypeDefinition implementingType,
		                                                                      IUnresolvedTypeDefinition part,
		                                                                      IUnresolvedMember member,
		                                                                      bool explicitDeclaration)
		{
			SetIndentTo (part);
			var options = new CodeGenerationOptions () {
				ExplicitDeclaration = explicitDeclaration,
				ImplementingType = implementingType,
				Part = part
			};
			if (member is IMethod)
				return GenerateCode ((IMethod)member, options);
			if (member is IProperty)
				return GenerateCode ((IProperty)member, options);
			if (member is IField)
				return GenerateCode ((IField)member, options);
			if (member is IEvent)
				return GenerateCode ((IEvent)member, options);
			throw new NotSupportedException ("member " +  member + " is not supported.");
		}
开发者ID:sparek,项目名称:monodevelop,代码行数:21,代码来源:CSharpCodeGenerator.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IUnresolvedTypeDefinition类代码示例发布时间:2022-05-24
下一篇:
C# IUnresolvedEntity类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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