예제 #1
0
 private void InitDataMembers()
 {
     if (this.dataMembers == null)
     {
         lock (this.locktarget)
         {
             if (this.dataMembers == null)
             {
                 List <MetaDataMember> dMembers = new List <MetaDataMember>();
                 int          ordinal           = 0;
                 BindingFlags flags             = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy;
                 foreach (FieldInfo fi in this.type.GetFields(flags))
                 {
                     MetaDataMember mm = new UnmappedDataMember(this, fi, ordinal);
                     dMembers.Add(mm);
                     ordinal++;
                 }
                 foreach (PropertyInfo pi in this.type.GetProperties(flags))
                 {
                     MetaDataMember mm = new UnmappedDataMember(this, pi, ordinal);
                     dMembers.Add(mm);
                     ordinal++;
                 }
                 this.dataMembers = dMembers.AsReadOnly();
             }
         }
     }
 }
 private void InitDataMembers() {
     if (this.dataMembers == null) {
         lock (this.locktarget) {
             if (this.dataMembers == null) {
                 List<MetaDataMember> dMembers = new List<MetaDataMember>();
                 int ordinal = 0;
                 BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy;
                 foreach (FieldInfo fi in this.type.GetFields(flags)) {
                     MetaDataMember mm = new UnmappedDataMember(this, fi, ordinal);
                     dMembers.Add(mm);
                     ordinal++;
                 }
                 foreach (PropertyInfo pi in this.type.GetProperties(flags)) {
                     MetaDataMember mm = new UnmappedDataMember(this, pi, ordinal);
                     dMembers.Add(mm);
                     ordinal++;
                 }
                 this.dataMembers = dMembers.AsReadOnly();
             }
         }
     }
 }