コード例 #1
0
        internal BfField method_6(FieldReference fieldReference_0)
        {
            BfAssembly bfAssembly;
            BfField    result;

            if (fieldReference_0.DeclaringType.Scope is AssemblyNameReference)
            {
                bfAssembly = this.dictionary_0[((AssemblyNameReference)fieldReference_0.DeclaringType.Scope).FullName];
            }
            else
            {
                if (!(fieldReference_0.DeclaringType.Scope is ModuleDefinition))
                {
                    Logger.LogWarning("GetBfField1", "Couldn't find assembly for field: " + fieldReference_0.ToString());
                    result = null;
                    return(result);
                }
                bfAssembly = this.dictionary_0[((ModuleDefinition)fieldReference_0.DeclaringType.Scope).Assembly.Name.FullName];
            }
            string key = BfCache.smethod_2(fieldReference_0.DeclaringType);
            BfType bfType;

            bfAssembly.method_4().TryGetValue(key, out bfType);
            if (bfType == null)
            {
                Logger.LogWarning("GetBfField2", "Couldn't find type for field: " + fieldReference_0.ToString());
                result = null;
            }
            else
            {
                foreach (BfField bfField in ((IEnumerable <BfField>)bfType.Fields))
                {
                    BfField bfField;
                    if (fieldReference_0.Name == bfField.Name)
                    {
                        result = bfField;
                        return(result);
                    }
                }
                foreach (FieldDefinition fieldDefinition in bfType.method_2().Fields)
                {
                    if (fieldDefinition.Name == fieldReference_0.Name)
                    {
                        BfField bfField = new BfField(this, fieldDefinition, bfType);
                        this.fieldCollection_0.method_1(bfField);
                        bfType.Fields.method_1(bfField);
                        result = bfField;
                        return(result);
                    }
                }
                Logger.LogWarning("GetBfField3", "Couldn't find field " + fieldReference_0.ToString() + " in type: " + bfType.FullName);
                result = null;
            }
            return(result);
        }
コード例 #2
0
ファイル: BfType.cs プロジェクト: seemantr/Source-Code-Nitriq
 internal void method_4()
 {
     if (this.bool_0)
     {
         Logger.LogWarning("Type.Populate1", "populate got called more than once");
     }
     else
     {
         this.bool_0 = true;
         if (this.IsInCoreAssembly)
         {
             this.bfType_0 = this.bfCache_0.method_7(this.typeDefinition_0.BaseType);
             if (this.bfType_0 != null && this.bfType_0.FullName != "System.Object")
             {
                 this.bfType_0.DerivedTypes.method_1(this);
             }
             foreach (TypeReference typeReference_ in this.typeDefinition_0.Interfaces)
             {
                 BfType bfType = this.bfCache_0.method_7(typeReference_);
                 this.typeCollection_0.method_1(bfType);
                 bfType.DerivedTypes.method_1(this);
             }
             foreach (FieldDefinition fieldDef in this.typeDefinition_0.Fields)
             {
                 BfField item = new BfField(this.bfCache_0, fieldDef, this);
                 this.fieldCollection_0.method_1(item);
             }
             foreach (MethodDefinition methodDef in this.typeDefinition_0.Methods)
             {
                 BfMethod bfMethod = new BfMethod(this.bfCache_0, methodDef, this);
                 this.methodCollection_0.method_1(bfMethod);
                 this.bfAssembly_0.method_5().Add(bfMethod.UniqueName, bfMethod);
             }
             foreach (MethodDefinition methodDef in this.typeDefinition_0.Constructors)
             {
                 BfMethod bfMethod = new BfMethod(this.bfCache_0, methodDef, this);
                 this.methodCollection_0.method_1(bfMethod);
                 this.bfAssembly_0.method_5().Add(bfMethod.UniqueName, bfMethod);
             }
             foreach (EventDefinition eventDef in this.typeDefinition_0.Events)
             {
                 BfEvent item2 = new BfEvent(this.bfCache_0, eventDef, this);
                 this.eventCollection_0.method_1(item2);
             }
             this.int_1 = this.typeDefinition_0.GenericParameters.Count;
             this.method_6();
             this.typeCollection_0.ClearHash();
             this.fieldCollection_0.ClearHash();
             this.methodCollection_0.ClearHash();
             this.eventCollection_0.ClearHash();
         }
     }
 }
コード例 #3
0
		internal BfField method_6(FieldReference fieldReference_0)
		{
			BfAssembly bfAssembly;
			BfField result;
			if (fieldReference_0.DeclaringType.Scope is AssemblyNameReference)
			{
				bfAssembly = this.dictionary_0[((AssemblyNameReference)fieldReference_0.DeclaringType.Scope).FullName];
			}
			else
			{
				if (!(fieldReference_0.DeclaringType.Scope is ModuleDefinition))
				{
					Logger.LogWarning("GetBfField1", "Couldn't find assembly for field: " + fieldReference_0.ToString());
					result = null;
					return result;
				}
				bfAssembly = this.dictionary_0[((ModuleDefinition)fieldReference_0.DeclaringType.Scope).Assembly.Name.FullName];
			}
			string key = BfCache.smethod_2(fieldReference_0.DeclaringType);
			BfType bfType;
			bfAssembly.method_4().TryGetValue(key, out bfType);
			if (bfType == null)
			{
				Logger.LogWarning("GetBfField2", "Couldn't find type for field: " + fieldReference_0.ToString());
				result = null;
			}
			else
			{
				foreach (BfField bfField in ((IEnumerable<BfField>)bfType.Fields))
				{
					BfField bfField;
					if (fieldReference_0.Name == bfField.Name)
					{
						result = bfField;
						return result;
					}
				}
				foreach (FieldDefinition fieldDefinition in bfType.method_2().Fields)
				{
					if (fieldDefinition.Name == fieldReference_0.Name)
					{
						BfField bfField = new BfField(this, fieldDefinition, bfType);
						this.fieldCollection_0.method_1(bfField);
						bfType.Fields.method_1(bfField);
						result = bfField;
						return result;
					}
				}
				Logger.LogWarning("GetBfField3", "Couldn't find field " + fieldReference_0.ToString() + " in type: " + bfType.FullName);
				result = null;
			}
			return result;
		}
コード例 #4
0
		internal void method_4()
		{
			if (this.bool_0)
			{
				Logger.LogWarning("Type.Populate1", "populate got called more than once");
			}
			else
			{
				this.bool_0 = true;
				if (this.IsInCoreAssembly)
				{
					this.bfType_0 = this.bfCache_0.method_7(this.typeDefinition_0.BaseType);
					if (this.bfType_0 != null && this.bfType_0.FullName != "System.Object")
					{
						this.bfType_0.DerivedTypes.method_1(this);
					}
					foreach (TypeReference typeReference_ in this.typeDefinition_0.Interfaces)
					{
						BfType bfType = this.bfCache_0.method_7(typeReference_);
						this.typeCollection_0.method_1(bfType);
						bfType.DerivedTypes.method_1(this);
					}
					foreach (FieldDefinition fieldDef in this.typeDefinition_0.Fields)
					{
						BfField item = new BfField(this.bfCache_0, fieldDef, this);
						this.fieldCollection_0.method_1(item);
					}
					foreach (MethodDefinition methodDef in this.typeDefinition_0.Methods)
					{
						BfMethod bfMethod = new BfMethod(this.bfCache_0, methodDef, this);
						this.methodCollection_0.method_1(bfMethod);
						this.bfAssembly_0.method_5().Add(bfMethod.UniqueName, bfMethod);
					}
					foreach (MethodDefinition methodDef in this.typeDefinition_0.Constructors)
					{
						BfMethod bfMethod = new BfMethod(this.bfCache_0, methodDef, this);
						this.methodCollection_0.method_1(bfMethod);
						this.bfAssembly_0.method_5().Add(bfMethod.UniqueName, bfMethod);
					}
					foreach (EventDefinition eventDef in this.typeDefinition_0.Events)
					{
						BfEvent item2 = new BfEvent(this.bfCache_0, eventDef, this);
						this.eventCollection_0.method_1(item2);
					}
					this.int_1 = this.typeDefinition_0.GenericParameters.Count;
					this.method_6();
					this.typeCollection_0.ClearHash();
					this.fieldCollection_0.ClearHash();
					this.methodCollection_0.ClearHash();
					this.eventCollection_0.ClearHash();
				}
			}
		}
コード例 #5
0
		private static double smethod_12(BfField bfField_0)
		{
			return (double)((BfField)bfField_0).TypesUsed.Count;
		}
コード例 #6
0
		private static double smethod_11(BfField bfField_0)
		{
			return (double)((BfField)bfField_0).SetByMethods.Count;
		}
コード例 #7
0
		private static bool smethod_14(BfField bfField_0)
		{
			return !bfField_0.IsInCoreAssembly;
		}