本文整理汇总了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 ();
}
示例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 ();
}
示例3: ResolveAssemblyAttribute
public Attribute ResolveAssemblyAttribute (PredefinedAttribute a_type)
{
Attribute a = OptAttributes.Search ("assembly", a_type);
if (a != null) {
a.Resolve ();
}
return a;
}
示例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");
}
示例5: ResolveAttribute
Attribute ResolveAttribute(PredefinedAttribute a_type)
{
Attribute a = OptAttributes.Search (a_type);
if (a != null) {
a.Resolve ();
}
return a;
}
示例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 ();
}
示例7: Contains
public bool Contains (PredefinedAttribute t)
{
return Search (t) != null;
}
示例8: Search
public Attribute Search (PredefinedAttribute t)
{
foreach (Attribute a in Attrs) {
if (a.ResolveType () == t)
return a;
}
return null;
}
示例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;
}
}
}
示例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[];
}
示例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 ();
}
示例12: EmitPredefined
public void EmitPredefined (PredefinedAttribute pa, Location loc)
{
if (builder != null)
pa.EmitAttribute (builder, loc);
}