コード例 #1
0
ファイル: FieldBuilder.cs プロジェクト: l1183479157/coreclr
        [System.Security.SecurityCritical]  // auto-generated
        internal FieldBuilder(TypeBuilder typeBuilder, String fieldName, Type type, 
            Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes)
        {
            if (fieldName == null)
                throw new ArgumentNullException("fieldName");

            if (fieldName.Length == 0)
                throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), "fieldName");

            if (fieldName[0] == '\0')
                throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), "fieldName");

            if (type == null)
                throw new ArgumentNullException("type");

            if (type == typeof(void))
                throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldType"));
            Contract.EndContractBlock();

            m_fieldName = fieldName;
            m_typeBuilder = typeBuilder;
            m_fieldType = type;
            m_Attributes = attributes & ~FieldAttributes.ReservedMask;
            
            SignatureHelper sigHelp = SignatureHelper.GetFieldSigHelper(m_typeBuilder.Module);
            sigHelp.AddArgument(type, requiredCustomModifiers, optionalCustomModifiers);

            int sigLength;
            byte[] signature = sigHelp.InternalGetSignature(out sigLength);
            
            m_fieldTok = TypeBuilder.DefineField(m_typeBuilder.GetModuleBuilder().GetNativeHandle(),
                typeBuilder.TypeToken.Token, fieldName, signature, sigLength, m_Attributes);

            m_tkField = new FieldToken(m_fieldTok, type);
        }
コード例 #2
0
 internal FieldBuilder(TypeBuilder typeBuilder, string fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes)
 {
     int num;
     if (fieldName == null)
     {
         throw new ArgumentNullException("fieldName");
     }
     if (fieldName.Length == 0)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), "fieldName");
     }
     if (fieldName[0] == '\0')
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), "fieldName");
     }
     if (type == null)
     {
         throw new ArgumentNullException("type");
     }
     if (type == typeof(void))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldType"));
     }
     this.m_fieldName = fieldName;
     this.m_typeBuilder = typeBuilder;
     this.m_fieldType = type;
     this.m_Attributes = attributes & ~FieldAttributes.ReservedMask;
     SignatureHelper fieldSigHelper = SignatureHelper.GetFieldSigHelper(this.m_typeBuilder.Module);
     fieldSigHelper.AddArgument(type, requiredCustomModifiers, optionalCustomModifiers);
     byte[] signature = fieldSigHelper.InternalGetSignature(out num);
     this.m_fieldTok = TypeBuilder.DefineField(this.m_typeBuilder.GetModuleBuilder().GetNativeHandle(), typeBuilder.TypeToken.Token, fieldName, signature, num, this.m_Attributes);
     this.m_tkField = new FieldToken(this.m_fieldTok, type);
 }
コード例 #3
0
ファイル: FieldToken.cs プロジェクト: jack-pappas/mono
		public bool Equals (FieldToken obj)
		{
			return (this.tokValue == obj.tokValue);
		}
コード例 #4
0
 public bool Equals(FieldToken obj)
 {
     return obj.m_fieldTok == m_fieldTok && obj.m_class == m_class;
 }
コード例 #5
0
 public bool Equals(FieldToken obj)
 {
   return default(bool);
 }
コード例 #6
0
ファイル: FieldToken.cs プロジェクト: lodejard/AllNetCore
 public bool Equals(FieldToken obj)
 {
     return(obj.m_fieldTok == m_fieldTok && obj.m_class == m_class);
 }
コード例 #7
0
 public bool Equals(FieldToken obj)
 {
     return(this.tokValue == obj.tokValue);
 }
コード例 #8
0
		static FieldToken ()
		{
			Empty = new FieldToken ();
		}
コード例 #9
0
ファイル: FieldToken.cs プロジェクト: yonder/mono
 static FieldToken()
 {
     Empty = new FieldToken();
 }
コード例 #10
0
 // Summary:
 //     Indicates whether the current instance is equal to the specified System.Reflection.Emit.FieldToken.
 //
 // Parameters:
 //   obj:
 //     The System.Reflection.Emit.FieldToken to compare to the current instance.
 //
 // Returns:
 //     true if the value of obj is equal to the value of the current instance; otherwise,
 //     false.
 extern public bool Equals(FieldToken obj);
コード例 #11
0
ファイル: fieldbuilder.cs プロジェクト: ArildF/masters
        internal FieldBuilder(TypeBuilder typeBuilder, String fieldName, Type type, FieldAttributes attributes)
        {
            if (fieldName==null)
                throw new ArgumentNullException("fieldName");
			if (fieldName.Length == 0)
				throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), "fieldName");
            if (fieldName[0] == '\0')
                throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), "fieldName");
            if (type==null)
                throw new ArgumentNullException("type");
            if (type == SystemVoid)
                throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldType"));
    
            m_fieldName = fieldName;
            m_typeBuilder = typeBuilder;
            m_fieldType = type;
            m_Attributes = attributes;
            
            SignatureHelper sigHelp = SignatureHelper.GetFieldSigHelper(m_typeBuilder.Module);
            sigHelp.AddArgument(type);
    
            int sigLength;
            byte[] signature = sigHelp.InternalGetSignature(out sigLength);
            
            m_tkField = new FieldToken(TypeBuilder.InternalDefineField(
                typeBuilder.TypeToken.Token, 
                fieldName, 
                signature, 
                sigLength, 
                attributes, 
                m_typeBuilder.Module), type);
        }
コード例 #12
0
 public bool Equals(FieldToken obj)
 {
     return(default(bool));
 }
コード例 #13
0
 public bool Equals(FieldToken obj)
 {
     return((obj.m_fieldTok == this.m_fieldTok) && (obj.m_class == this.m_class));
 }
コード例 #14
0
ファイル: FieldToken.cs プロジェクト: PlumpMath/CIL2Java
 /// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.FieldToken" />.</summary><returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns><param name="obj">The <see cref="T:System.Reflection.Emit.FieldToken" /> to compare to the current instance.</param>
 public bool Equals(FieldToken obj)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
 public bool Equals(FieldToken obj)
 {
     return ((obj.m_fieldTok == this.m_fieldTok) && (obj.m_class == this.m_class));
 }