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


C# IUnresolvedEntity类代码示例

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


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

示例1: AddMember

			public void AddMember(IUnresolvedEntity entity, Mono.Cecil.MemberReference cecilObject)
			{
				rwLock.EnterWriteLock();
				try {
					uint token = cecilObject.MetadataToken.ToUInt32();
					metadataTokens[entity] = token;
					
					var cecilMethod = cecilObject as Mono.Cecil.MethodDefinition;
					if (cecilMethod != null) {
						IUnresolvedMethod method = (IUnresolvedMethod)entity;
						tokenToMethod[token] = method;
						if (cecilMethod.HasBody) {
							var locals = cecilMethod.Body.Variables;
							if (locals.Count > 0) {
								localVariableTypes[method] = locals.Select(v => typeRefLoader.ReadTypeReference(v.VariableType)).ToArray();
							}
							if (cecilMethod.RVA != 0) {
								// The method was loaded from image - we can free the memory for the body
								// because Cecil will re-initialize it on demand
								cecilMethod.Body = null;
							}
						}
					}
				} finally {
					rwLock.ExitWriteLock();
				}
			}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:27,代码来源:TypeSystemExtensions.cs

示例2: EntityBookmark

		public EntityBookmark(IUnresolvedEntity entity, IDocument document)
		{
			this.entity = entity;
			int lineNr = entity.Region.BeginLine;
			if (document != null && lineNr > 0 && lineNr < document.LineCount) {
				this.line = document.GetLineByNumber(lineNr);
			}
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:8,代码来源:EntityBookmark.cs

示例3: AbstractResolvedEntity

		protected AbstractResolvedEntity(IUnresolvedEntity unresolved, ITypeResolveContext parentContext)
		{
			if (unresolved == null)
				throw new ArgumentNullException("unresolved");
			if (parentContext == null)
				throw new ArgumentNullException("parentContext");
			this.unresolved = unresolved;
			this.parentContext = parentContext;
			this.Attributes = unresolved.Attributes.CreateResolvedAttributes(parentContext);
		}
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:10,代码来源:AbstractResolvedEntity.cs

示例4: GetString

		string GetString (Ambience amb, IUnresolvedEntity x)
		{
			var ctx = new SimpleTypeResolveContext (Document.Compilation.MainAssembly);
			IEntity rx = null;
			if (x is IUnresolvedMember)
				rx = ((IUnresolvedMember)x).CreateResolved (ctx);
			
			if (tag is IUnresolvedFile)
				return amb.GetString (rx, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.UseFullInnerTypeName | OutputFlags.ReformatDelegates);
			return amb.GetString (rx, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:11,代码来源:DataProvider.cs

示例5: ForNonBodyRegion

        /// <summary>
        ///   Creates a new QuickFix representing the non-bodyRegion
        ///   of the given region. Can be used to create QuickFixes
        ///   for AST members. The resulting QuickFix will then
        ///   contain the name and type signature of the member.
        /// </summary>
        /// <example>
        ///   For the region containing a "public string GetText(...)
        ///   {return null}" this method will return a QuickFix whose
        ///   Text is "public string GetText(...) ". So the returned
        ///   Text contains the type signature and not the body.
        /// </example>
        public static QuickFix ForNonBodyRegion(IUnresolvedEntity entity, IDocument document)
        {
            var text = GetNonBodyRegion
                (entity.Region, document, entity.BodyRegion);

            return new QuickFix
                { FileName = entity.Region.FileName
                , Line     = entity.Region.BeginLine
                , Column   = entity.Region.BeginColumn
                , Text     = text};
        }
开发者ID:jchannon,项目名称:OmniSharpServer,代码行数:23,代码来源:QuickFix.cs

示例6: GetCecilObject

		MemberReference GetCecilObject(IUnresolvedEntity entity)
		{
			object cecilObj;
			if (unresolvedTypeSystemToCecilDict.TryGetValue(entity, out cecilObj)) {
				return cecilObj as MemberReference;
			} else {
				return null;
			}
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:9,代码来源:AssemblyAnalyzer.cs

示例7: AddAttributes

 void AddAttributes(PropertyInfo propertyDefinition, IUnresolvedEntity targetEntity)
 {
     AddCustomAttributes(propertyDefinition.CustomAttributes, targetEntity.Attributes);
 }
开发者ID:jlyonsmith,项目名称:NRefactory,代码行数:4,代码来源:IkvmLoader.cs

示例8: GetFormattedReturnType

        static string GetFormattedReturnType(IUnresolvedEntity entity)
        {
            string returnSignature = string.Empty;
            var method = entity as AbstractUnresolvedMember;

            if (method != null && method.ReturnType.ToString () != "void") {
                returnSignature = string.Format (" : {0}", method.ReturnType);
            }

            return returnSignature;
        }
开发者ID:prashantvc,项目名称:EditorComfortAddin,代码行数:11,代码来源:MemberListWindow.cs

示例9: GetCompletionImage

		/// <summary>
		/// Gets the CompletionImage instance for the specified entity.
		/// Returns null when no image is available for the entity type.
		/// </summary>
		public static CompletionImage GetCompletionImage(IUnresolvedEntity entity)
		{
			if (entity == null)
				throw new ArgumentNullException("entity");
			switch (entity.SymbolKind) {
                case SymbolKind.TypeDefinition:
					return GetCompletionImageForType(((IUnresolvedTypeDefinition)entity).Kind, entity.IsStatic);
                case SymbolKind.Field:
					IUnresolvedField field = (IUnresolvedField)entity;
					if (field.IsConst) {
						if (field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum)
							return imageEnumValue;
						else
							return imageLiteral;
					}
					return field.IsReadOnly ? imageFieldReadOnly : imageField;
                case SymbolKind.Method:
					IUnresolvedMethod method = (IUnresolvedMethod)entity;
					return method.IsOverridable ? imageVirtualMethod : imageMethod;
                case SymbolKind.Property:
					return imageProperty;
                case SymbolKind.Indexer:
					return imageIndexer;
                case SymbolKind.Event:
					return imageEvent;
                case SymbolKind.Operator:
                case SymbolKind.Destructor:
					return imageOperator;
                case SymbolKind.Constructor:
					return imageConstructor;
				default:
					return null;
			}
		}
开发者ID:AkshayVats,项目名称:SuperShell,代码行数:38,代码来源:CompletionImage.cs

示例10: SearchMember

		ITreeNavigator SearchMember (IUnresolvedEntity member)
		{
			return SearchMember (GetIdString (member));
		}
开发者ID:alexrp,项目名称:monodevelop,代码行数:4,代码来源:AssemblyBrowserWidget.cs

示例11: SearchMember

		ITreeNavigator SearchMember (IUnresolvedEntity member, bool expandNode = true)
		{
			return SearchMember (GetIdString (member), expandNode);
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:4,代码来源:AssemblyBrowserWidget.cs

示例12: GetGlobal

		static string GetGlobal (IUnresolvedEntity entity)
		{
			switch (entity.SymbolKind) {
			case SymbolKind.Field:
				var field = (IUnresolvedField)entity;
				return field.IsStatic && !field.IsConst ? "static-" : "";
			case SymbolKind.Method:
			case SymbolKind.Constructor:
			case SymbolKind.Destructor:
			case SymbolKind.Operator:
			case SymbolKind.Property:
			case SymbolKind.Indexer:
				return entity.IsStatic ? "static-" : "";
			}
			return "";
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:16,代码来源:NRefactoryStock.cs

示例13: GetMetadataToken

			public uint GetMetadataToken(IUnresolvedEntity entity)
			{
				rwLock.EnterReadLock();
				try {
					return metadataTokens[entity];
				} finally {
					rwLock.ExitReadLock();
				}
			}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:9,代码来源:TypeSystemExtensions.cs

示例14: NeedsDocumentation

		static bool NeedsDocumentation (TextEditorData data, IUnresolvedEntity member)
		{
			int lineNr = member.Region.BeginLine - 1;
			DocumentLine line;
			do {
				line = data.Document.GetLine (lineNr--);
			} while (lineNr > 0 && data.Document.GetLineIndent (line).Length == line.Length);
			return !data.Document.GetTextAt (line).TrimStart ().StartsWith ("///", StringComparison.Ordinal);
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:9,代码来源:Commands.cs

示例15: GetCompletionImage

		/// <summary>
		/// Gets the CompletionImage instance for the specified entity.
		/// Returns null when no image is available for the entity type.
		/// </summary>
		public static CompletionImage GetCompletionImage(IUnresolvedEntity entity)
		{
			if (entity == null)
				throw new ArgumentNullException("entity");
			switch (entity.SymbolKind) {
				case SymbolKind.TypeDefinition:
					return GetCompletionImageForType(((IUnresolvedTypeDefinition)entity).Kind, entity.IsStatic);
				case SymbolKind.Field:
					IUnresolvedField field = (IUnresolvedField)entity;
					if (field.IsConst) {
						if (field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum)
							return imageEnumValue;
						else
							return imageLiteral;
					}
					return field.IsReadOnly ? imageFieldReadOnly : imageField;
				case SymbolKind.Method:
					IUnresolvedMethod method = (IUnresolvedMethod)entity;
					// We cannot reliably detect extension methods in the unresolved type system (e.g. in VB we need to resolve an attribute),
					// but at least we can do it for C#:
					var defMethod = method as DefaultUnresolvedMethod;
					if (defMethod != null && defMethod.IsExtensionMethod)
						return imageExtensionMethod;
					return method.IsOverridable ? imageVirtualMethod : imageMethod;
				case SymbolKind.Property:
					return imageProperty;
				case SymbolKind.Indexer:
					return imageIndexer;
				case SymbolKind.Event:
					return imageEvent;
				case SymbolKind.Operator:
				case SymbolKind.Destructor:
					return imageOperator;
				case SymbolKind.Constructor:
					return imageConstructor;
				default:
					return null;
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:43,代码来源:CompletionImage.cs


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