Esempio n. 1
0
        internal BfMethod method_5(MethodReference methodReference_0)
        {
            BfAssembly bfAssembly;
            BfMethod   result;

            if (methodReference_0.DeclaringType.Scope is AssemblyNameReference)
            {
                bfAssembly = this.dictionary_0[((AssemblyNameReference)methodReference_0.DeclaringType.Scope).FullName];
            }
            else
            {
                if (!(methodReference_0.DeclaringType.Scope is ModuleDefinition))
                {
                    Logger.LogWarning("GetBfMethod1", "Couldn't find assembly for method: " + methodReference_0.ToString());
                    result = null;
                    return(result);
                }
                bfAssembly = this.dictionary_0[((ModuleDefinition)methodReference_0.DeclaringType.Scope).Assembly.Name.FullName];
            }
            string   text = BfMethod.smethod_0(methodReference_0);
            BfMethod bfMethod;

            bfAssembly.method_5().TryGetValue(text, out bfMethod);
            if (bfMethod == null)
            {
                BfType bfType = this.method_7(methodReference_0.DeclaringType);
                List <MethodDefinition> list = new List <MethodDefinition>();
                list.AddRange(bfType.method_2().Constructors.Cast <MethodDefinition>());
                list.AddRange(bfType.method_2().Methods.Cast <MethodDefinition>());
                foreach (MethodDefinition current in list)
                {
                    if (text == BfMethod.smethod_0(current))
                    {
                        bfMethod = new BfMethod(this, current, bfType);
                        this.methodCollection_0.method_1(bfMethod);
                        bfType.Methods.method_1(bfMethod);
                        bfAssembly.method_5().Add(bfMethod.UniqueName, bfMethod);
                        break;
                    }
                }
                if (bfMethod == null)
                {
                    Logger.LogWarning("GetBfMethod2", "Couldn't find: " + text);
                }
            }
            result = bfMethod;
            return(result);
        }
Esempio n. 2
0
		internal BfNamespace method_13(BfType bfType_0)
		{
			BfNamespace bfNamespace = null;
			string text = null;
			BfNamespace result;
			try
			{
				text = BfCache.smethod_4(bfType_0.method_2().FullName);
				if (!this.sortedDictionary_1.ContainsKey(text))
				{
					bfNamespace = new BfNamespace(this, text);
					this.sortedDictionary_1.Add(text, bfNamespace);
					this.namespaceCollection_0.method_1(bfNamespace);
				}
				else
				{
					bfNamespace = this.sortedDictionary_1[text];
				}
				if (bfNamespace.Types == null)
				{
					Logger.LogError("BfNamespace: '" + bfNamespace.FullName + "' had null collection - " + bfType_0.FullName);
					bfNamespace.Types = new TypeCollection();
				}
				bfNamespace.Types.method_1(bfType_0);
				result = bfNamespace;
			}
			catch (Exception)
			{
				Builder builder = new Builder("\r\n");
				try
				{
					builder.Append("type == null => " + (bfType_0 == null));
					builder.Append("type = " + bfType_0.ToString());
				}
				catch
				{
				}
				try
				{
					builder.Append("type.Assembly = " + bfType_0.Assembly.ToString());
				}
				catch
				{
				}
				try
				{
					builder.Append("type.TypeDef.Name = " + bfType_0.method_2().Name);
				}
				catch
				{
				}
				try
				{
					builder.Append("type.TypeDef == null => " + (bfType_0.method_2() == null));
					builder.Append("type.TypeDef = " + bfType_0.method_2().ToString());
				}
				catch
				{
				}
				try
				{
					builder.Append("type.TypeDef.FullName == null => " + (bfType_0.method_2().FullName == null));
					builder.Append("type.TypeDef.FullName = " + bfType_0.method_2().FullName.ToString());
				}
				catch
				{
				}
				try
				{
					builder.Append("myNamespace == null => " + (text == null));
					builder.Append("myNamespace = " + text.ToString());
				}
				catch
				{
				}
				try
				{
					builder.Append("_namespaceDictionary == null => " + (this.sortedDictionary_1 == null));
					builder.Append("_namespaceDictionary = " + this.sortedDictionary_1.Count<KeyValuePair<string, BfNamespace>>());
				}
				catch
				{
				}
				try
				{
					builder.Append("_namespaces == null => " + (this.namespaceCollection_0 == null));
					builder.Append("_namespaces = " + this.namespaceCollection_0.Count<BfNamespace>());
				}
				catch
				{
				}
				try
				{
					builder.Append("bfNamespace == null => " + (bfNamespace == null));
					builder.Append("bfNamespace = " + bfNamespace);
				}
				catch
				{
				}
				try
				{
					builder.Append("bfNamespace.Types == null => " + (bfNamespace.Types == null));
					builder.Append("bfNamespace.Types = " + bfNamespace.Types.Count<BfType>());
				}
				catch
				{
				}
				throw new NitriqException("NamespaceProblems", builder.ToString());
			}
			return result;
		}
Esempio n. 3
0
        internal BfNamespace method_13(BfType bfType_0)
        {
            BfNamespace bfNamespace = null;
            string      text        = null;
            BfNamespace result;

            try
            {
                text = BfCache.smethod_4(bfType_0.method_2().FullName);
                if (!this.sortedDictionary_1.ContainsKey(text))
                {
                    bfNamespace = new BfNamespace(this, text);
                    this.sortedDictionary_1.Add(text, bfNamespace);
                    this.namespaceCollection_0.method_1(bfNamespace);
                }
                else
                {
                    bfNamespace = this.sortedDictionary_1[text];
                }
                if (bfNamespace.Types == null)
                {
                    Logger.LogError("BfNamespace: '" + bfNamespace.FullName + "' had null collection - " + bfType_0.FullName);
                    bfNamespace.Types = new TypeCollection();
                }
                bfNamespace.Types.method_1(bfType_0);
                result = bfNamespace;
            }
            catch (Exception)
            {
                Builder builder = new Builder("\r\n");
                try
                {
                    builder.Append("type == null => " + (bfType_0 == null));
                    builder.Append("type = " + bfType_0.ToString());
                }
                catch
                {
                }
                try
                {
                    builder.Append("type.Assembly = " + bfType_0.Assembly.ToString());
                }
                catch
                {
                }
                try
                {
                    builder.Append("type.TypeDef.Name = " + bfType_0.method_2().Name);
                }
                catch
                {
                }
                try
                {
                    builder.Append("type.TypeDef == null => " + (bfType_0.method_2() == null));
                    builder.Append("type.TypeDef = " + bfType_0.method_2().ToString());
                }
                catch
                {
                }
                try
                {
                    builder.Append("type.TypeDef.FullName == null => " + (bfType_0.method_2().FullName == null));
                    builder.Append("type.TypeDef.FullName = " + bfType_0.method_2().FullName.ToString());
                }
                catch
                {
                }
                try
                {
                    builder.Append("myNamespace == null => " + (text == null));
                    builder.Append("myNamespace = " + text.ToString());
                }
                catch
                {
                }
                try
                {
                    builder.Append("_namespaceDictionary == null => " + (this.sortedDictionary_1 == null));
                    builder.Append("_namespaceDictionary = " + this.sortedDictionary_1.Count <KeyValuePair <string, BfNamespace> >());
                }
                catch
                {
                }
                try
                {
                    builder.Append("_namespaces == null => " + (this.namespaceCollection_0 == null));
                    builder.Append("_namespaces = " + this.namespaceCollection_0.Count <BfNamespace>());
                }
                catch
                {
                }
                try
                {
                    builder.Append("bfNamespace == null => " + (bfNamespace == null));
                    builder.Append("bfNamespace = " + bfNamespace);
                }
                catch
                {
                }
                try
                {
                    builder.Append("bfNamespace.Types == null => " + (bfNamespace.Types == null));
                    builder.Append("bfNamespace.Types = " + bfNamespace.Types.Count <BfType>());
                }
                catch
                {
                }
                throw new NitriqException("NamespaceProblems", builder.ToString());
            }
            return(result);
        }