當前位置: 首頁>>代碼示例>>C#>>正文


C# PEAPI.Class類代碼示例

本文整理匯總了C#中PEAPI.Class的典型用法代碼示例。如果您正苦於以下問題:C# Class類的具體用法?C# Class怎麽用?C# Class使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Class類屬於PEAPI命名空間,在下文中一共展示了Class類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: IsEnum

		public static bool IsEnum (Class type)
		{
			return IsEnum (type.nameSpace, type.name);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:4,代碼來源:Metadata.cs

示例2: AddNestedClass

		/// <summary>
		/// Add a nested class to this class
		/// </summary>
		/// <param name="attrSet">attributes for this nested class</param>
		/// <param name="nsName">nested name space name</param>
		/// <param name="name">nested class name</param>
		/// <param name="sType">super type of this nested class</param>
		/// <returns>a descriptor for this new nested class</returns>
		public ClassDef AddNestedClass(TypeAttr attrSet, string nsName, 
				string name, Class sType) {
			ClassDef nClass = AddNestedClass (attrSet, nsName, name);
			nClass.SetSuper(sType);
			if (ClassDef.IsValueType (sType))
				nClass.MakeValueClass (ValueClass.ValueType);
			else
				if (ClassDef.IsEnum (sType))
					nClass.MakeValueClass (ValueClass.Enum);

			if (ClassDef.IsValueType (sType) || ClassDef.IsEnum (sType))
				nClass.SetTypeIndex (PrimitiveType.ValueType.GetTypeIndex ());

			nClass.typeIndexChecked = true;
			return (nClass);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:24,代碼來源:Metadata.cs

示例3: AddImplementedInterface

		/// <summary>
		/// Add an interface that is implemented by this class
		/// </summary>
		/// <param name="iFace">the interface that is implemented</param>
		public void AddImplementedInterface(Class iFace) 
		{
			metaData.AddToTable(MDTable.InterfaceImpl,new InterfaceImpl(this,iFace));
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:8,代碼來源:Metadata.cs

示例4: IsValueType

		public static bool IsValueType (Class type)
		{
			return IsValueType (type.nameSpace, type.name);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:4,代碼來源:Metadata.cs

示例5: ClassDef

 internal ClassDef(TypeAttr attrSet, string nsName, string name, 
                   MetaData md) : base(nsName, name, md) {
                     metaData = md;
   superType = metaData.mscorlib.GetSpecialSystemClass(PrimitiveType.Object);
   flags = (uint)attrSet;
   tabIx = MDTable.TypeDef;
 }
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:7,代碼來源:PEAPI.cs

示例6: ClassDef

		internal ClassDef(TypeAttr attrSet, string nsName, string name, 
				MetaData md) : base(nsName, name, md) 
		{
			metaData = md;
			if (! ((nsName == "" && name == "<Module>") || (nsName == "System" && name == "Object")) ) {
				superType = metaData.mscorlib.GetSpecialSystemClass(PrimitiveType.Object);
			}
			flags = (uint)attrSet;
			tabIx = MDTable.TypeDef;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:10,代碼來源:Metadata.cs

示例7: CustomModifiedType

		/// <summary>
		/// Create a new custom modifier for a type
		/// </summary>
		/// <param name="type">the type to be modified</param>
		/// <param name="cmod">the modifier</param>
		/// <param name="cmodType">the type reference to be associated with the type</param>
		public CustomModifiedType(Type type, CustomModifier cmod, Class cmodType)
			: base((byte)cmod) 
		{
			this.type = type;
			this.cmodType = cmodType;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:12,代碼來源:Metadata.cs

示例8: EndCatchBlock

		/// <summary>
		/// Mark this position as the end of the last started block and
		/// make it a catch block.  This catch block is associated with the
		/// specified try block.
		/// </summary>
		/// <param name="exceptType">the exception type to be caught</param>
		/// <param name="tryBlock">the try block associated with this catch block</param>
		public void EndCatchBlock(Class exceptType, TryBlock tryBlock) 
		{
			Catch catchBlock = new Catch(exceptType,(CILLabel)blockStack[0],
					NewCodedLabel());
			tryBlock.AddHandler(catchBlock);
		}
開發者ID:REALTOBIZ,項目名稱:mono,代碼行數:13,代碼來源:Code.cs

示例9: InterfaceImpl

		internal InterfaceImpl(ClassDef theClass, Class theInterface) 
		{
			this.theClass = theClass;
			this.theInterface = theInterface;
			tabIx = MDTable.InterfaceImpl;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:6,代碼來源:Metadata.cs

示例10: Catch

		/// <summary>
		/// Create a new catch clause
		/// </summary>
		/// <param name="except">the exception to be caught</param>
		/// <param name="handlerStart">start of the handler code</param>
		/// <param name="handlerEnd">end of the handler code</param>
		public Catch(Class except, CILLabel handlerStart, CILLabel handlerEnd)
			: base(handlerStart, handlerEnd)
		{
			exceptType = except;
		}
開發者ID:REALTOBIZ,項目名稱:mono,代碼行數:11,代碼來源:Code.cs

示例11: AddClass

 /// <summary>
 /// Add a class to this module
 /// </summary>
 /// <param name="attrSet">attributes of this class</param>
 /// <param name="nsName">name space name</param>
 /// <param name="name">class name</param>
 /// <param name="superType">super type of this class (extends)</param>
 /// <returns>a descriptor for this new class</returns>
 public ClassDef AddClass(TypeAttr attrSet, string nsName, string name, Class superType) {
   ClassDef aClass = new ClassDef(attrSet,nsName,name,metaData);
   aClass.SetSuper(superType);
   metaData.AddToTable(MDTable.TypeDef,aClass);
   return aClass;
 }
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:14,代碼來源:PEAPI.cs

示例12: SetSuper

 internal void SetSuper(Class sClass) {
   superType = sClass;
   if (sClass is ClassRef)
     typeIndex = superType.GetTypeIndex();
   else
     typeIndexChecked = false;
 }
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:7,代碼來源:PEAPI.cs

示例13: BuildTables

		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			if ((flags & (uint)TypeAttr.Interface) != 0) { superType = null; }
			// Console.WriteLine("Building tables for " + name);
			if (layout != null) md.AddToTable(MDTable.ClassLayout,layout);
			// Console.WriteLine("adding methods " + methods.Count);
			methodIx = md.TableIndex(MDTable.Method);
			for (int i=0; i < methods.Count; i++) {
				md.AddToTable(MDTable.Method,(MetaDataElement)methods[i]);
				((MethodDef)methods[i]).BuildTables(md);
			}
			// Console.WriteLine("adding fields");
			fieldIx = md.TableIndex(MDTable.Field);
			for (int i=0; i < fields.Count; i++) {
				md.AddToTable(MDTable.Field,(MetaDataElement)fields[i]);
				((FieldDef)fields[i]).BuildTables(md);
			}
			// Console.WriteLine("adding events and properties");
			if (events != null) { 
				for (int i=0; i < events.Count; i++) {
					md.AddToTable(MDTable.Event,(Event)events[i]);
					((Event)events[i]).BuildTables(md);
				}
				md.AddToTable(MDTable.EventMap,
						new MapElem(this,((Event)events[0]).Row,MDTable.Event));
			}
			if (properties != null) { 
				for (int i=0; i < properties.Count; i++) {
					md.AddToTable(MDTable.Property,(Property)properties[i]);
					((Property)properties[i]).BuildTables(md);
				}
				md.AddToTable(MDTable.PropertyMap,new MapElem(this,
							((Property)properties[0]).Row,MDTable.Property));
			}
			// Console.WriteLine("End of building tables");
			done = true;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:38,代碼來源:Metadata.cs

示例14: SetSuper

		internal void SetSuper(Class sClass) 
		{
			superType = sClass;
			if (! (sClass is GenericTypeInst))
				typeIndexChecked = false;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:6,代碼來源:Metadata.cs

示例15: ClassType

		public ClassType(Class classDesc) 
		{
			desc = classDesc;
			type = PrimitiveType.ClassType;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:5,代碼來源:Metadata.cs


注:本文中的PEAPI.Class類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。