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


C# CSharp.PredefinedAttribute類代碼示例

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


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

示例1: GetAttributeUsage

		public AttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa)
		{
			throw new NotSupportedException ();
		}
開發者ID:Gobiner,項目名稱:ILSpy,代碼行數:4,代碼來源:import.cs

示例2: GetAttributeUsage

		public AttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa)
		{
			Attribute a = null;
			if (OptAttributes != null) {
				a = OptAttributes.Search (pa);
			}

			if (a == null)
				return null;

			return a.GetAttributeUsageAttribute ();
		}
開發者ID:fvalette,項目名稱:mono,代碼行數:12,代碼來源:class.cs

示例3: ResolveAssemblyAttribute

		public Attribute ResolveAssemblyAttribute (PredefinedAttribute a_type)
		{
			Attribute a = OptAttributes.Search ("assembly", a_type);
			if (a != null) {
				a.Resolve ();
			}
			return a;
		}
開發者ID:famousthom,項目名稱:monodevelop,代碼行數:8,代碼來源:roottypes.cs

示例4: PredefinedAttributes

		public PredefinedAttributes ()
		{
			ParamArray = new PredefinedAttribute ("System", "ParamArrayAttribute");
			Out = new PredefinedAttribute ("System.Runtime.InteropServices", "OutAttribute");

			Obsolete = new PredefinedAttribute ("System", "ObsoleteAttribute");
			DllImport = new PredefinedAttribute ("System.Runtime.InteropServices", "DllImportAttribute");
			MethodImpl = new PredefinedAttribute ("System.Runtime.CompilerServices", "MethodImplAttribute");
			MarshalAs = new PredefinedAttribute ("System.Runtime.InteropServices", "MarshalAsAttribute");
			In = new PredefinedAttribute ("System.Runtime.InteropServices", "InAttribute");
			IndexerName = new PredefinedAttribute ("System.Runtime.CompilerServices", "IndexerNameAttribute");
			Conditional = new PredefinedAttribute ("System.Diagnostics", "ConditionalAttribute");
			CLSCompliant = new PredefinedAttribute ("System", "CLSCompliantAttribute");
			Security = new PredefinedAttribute ("System.Security.Permissions", "SecurityAttribute");
			Required = new PredefinedAttribute ("System.Runtime.CompilerServices", "RequiredAttributeAttribute");
			Guid = new PredefinedAttribute ("System.Runtime.InteropServices", "GuidAttribute");
			AssemblyCulture = new PredefinedAttribute ("System.Reflection", "AssemblyCultureAttribute");
			AssemblyVersion = new PredefinedAttribute ("System.Reflection", "AssemblyVersionAttribute");
			AssemblyAlgorithmId = new PredefinedAttribute ("System.Reflection", "AssemblyAlgorithmIdAttribute");
			AssemblyFlags = new PredefinedAttribute ("System.Reflection", "AssemblyFlagsAttribute");
			ComImport = new PredefinedAttribute ("System.Runtime.InteropServices", "ComImportAttribute");
			CoClass = new PredefinedAttribute ("System.Runtime.InteropServices", "CoClassAttribute");
			AttributeUsage = new PredefinedAttribute ("System", "AttributeUsageAttribute");
			DefaultParameterValue = new PredefinedAttribute ("System.Runtime.InteropServices", "DefaultParameterValueAttribute");
			OptionalParameter = new PredefinedAttribute ("System.Runtime.InteropServices", "OptionalAttribute");

			DefaultCharset = new PredefinedAttribute ("System.Runtime.InteropServices", "DefaultCharSetAttribute");
			TypeForwarder = new PredefinedAttribute ("System.Runtime.CompilerServices", "TypeForwardedToAttribute");
			FixedBuffer = new PredefinedAttribute ("System.Runtime.CompilerServices", "FixedBufferAttribute");
			CompilerGenerated = new PredefinedAttribute ("System.Runtime.CompilerServices", "CompilerGeneratedAttribute");
			InternalsVisibleTo = new PredefinedAttribute ("System.Runtime.CompilerServices", "InternalsVisibleToAttribute");
			RuntimeCompatibility = new PredefinedAttribute ("System.Runtime.CompilerServices", "RuntimeCompatibilityAttribute");
			DebuggerHidden = new PredefinedAttribute ("System.Diagnostics", "DebuggerHiddenAttribute");
			UnsafeValueType = new PredefinedAttribute ("System.Runtime.CompilerServices", "UnsafeValueTypeAttribute");

			Extension = new PredefinedAttribute ("System.Runtime.CompilerServices", "ExtensionAttribute");

			Dynamic = new PredefinedAttribute ("System.Runtime.CompilerServices", "DynamicAttribute");
			DynamicTransform = new PredefinedAttribute ("System.Runtime.CompilerServices", "DynamicAttribute");

			DefaultMember = new PredefinedAttribute ("System.Reflection", "DefaultMemberAttribute");
			DecimalConstant = new PredefinedAttribute ("System.Runtime.CompilerServices", "DecimalConstantAttribute");
			StructLayout = new PredefinedAttribute ("System.Runtime.InteropServices", "StructLayoutAttribute");
			FieldOffset = new PredefinedAttribute ("System.Runtime.InteropServices", "FieldOffsetAttribute");
		}
開發者ID:alisci01,項目名稱:mono,代碼行數:45,代碼來源:attribute.cs

示例5: ResolveAttribute

 Attribute ResolveAttribute(PredefinedAttribute a_type)
 {
     Attribute a = OptAttributes.Search (a_type);
     if (a != null) {
         a.Resolve ();
     }
     return a;
 }
開發者ID:speier,項目名稱:shake,代碼行數:8,代碼來源:roottypes.cs

示例6: SearchMulti

		/// <summary>
		/// Returns all attributes of type 't'. Use it when attribute is AllowMultiple = true
		/// </summary>
		public Attribute[] SearchMulti (PredefinedAttribute t)
		{
			List<Attribute> ar = null;

			foreach (Attribute a in Attrs) {
				if (a.ResolveType () == t) {
					if (ar == null)
						ar = new List<Attribute> (Attrs.Count);
					ar.Add (a);
				}
			}

			return ar == null ? null : ar.ToArray ();
		}
開發者ID:alisci01,項目名稱:mono,代碼行數:17,代碼來源:attribute.cs

示例7: Contains

		public bool Contains (PredefinedAttribute t)
		{
			return Search (t) != null;
		}
開發者ID:alisci01,項目名稱:mono,代碼行數:4,代碼來源:attribute.cs

示例8: Search

		public Attribute Search (PredefinedAttribute t)
		{
			foreach (Attribute a in Attrs) {
				if (a.ResolveType () == t)
					return a;
			}
			return null;
		}
開發者ID:alisci01,項目名稱:mono,代碼行數:8,代碼來源:attribute.cs

示例9: ResolveGlobalAttributes

		/// <summary>
		/// It is called very early therefore can resolve only predefined attributes
		/// </summary>
		void ResolveGlobalAttributes ()
		{
			if (OptAttributes == null)
				return;

			if (!OptAttributes.CheckTargets ())
				return;

			// FIXME: Define is wrong as the type may not exist yet
			var DefaultCharSet_attr = new PredefinedAttribute (this, "System.Runtime.InteropServices", "DefaultCharSetAttribute");
			DefaultCharSet_attr.Define ();
			Attribute a = ResolveModuleAttribute (DefaultCharSet_attr);
			if (a != null) {
				has_default_charset = true;
				DefaultCharSet = a.GetCharSetValue ();
				switch (DefaultCharSet) {
				case CharSet.Ansi:
				case CharSet.None:
					break;
				case CharSet.Auto:
					DefaultCharSetType = TypeAttributes.AutoClass;
					break;
				case CharSet.Unicode:
					DefaultCharSetType = TypeAttributes.UnicodeClass;
					break;
				default:
					Report.Error (1724, a.Location, "Value specified for the argument to `{0}' is not valid", 
						DefaultCharSet_attr.GetSignatureForError ());
					break;
				}
			}
		}
開發者ID:hindlemail,項目名稱:mono,代碼行數:35,代碼來源:roottypes.cs

示例10: SearchMulti

		/// <summary>
		/// Returns all attributes of type 't'. Use it when attribute is AllowMultiple = true
		/// </summary>
		public Attribute[] SearchMulti (PredefinedAttribute t)
		{
			ArrayList ar = null;

			foreach (Attribute a in Attrs) {
				if (a.ResolveType () == t) {
					if (ar == null)
						ar = new ArrayList ();
					ar.Add (a);
				}
			}

			return ar == null ? null : ar.ToArray (typeof (Attribute)) as Attribute[];
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:17,代碼來源:attribute.cs

示例11: GetAttributeUsage

        public AttributeUsageAttribute GetAttributeUsage(PredefinedAttribute pa)
        {
            Attribute a = null;
            if (OptAttributes != null) {
                a = OptAttributes.Search (pa);
            }

            if (a == null) {
                if (BaseType != TypeManager.attribute_type)
                    return BaseType.GetAttributeUsage (pa);

                return null;
            }

            return a.GetAttributeUsageAttribute ();
        }
開發者ID:speier,項目名稱:shake,代碼行數:16,代碼來源:class.cs

示例12: EmitPredefined

		public void EmitPredefined (PredefinedAttribute pa, Location loc)
		{
			if (builder != null)
				pa.EmitAttribute (builder, loc);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:5,代碼來源:parameter.cs


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