System.Web.Compilation.AssemblyBuilder.CheckForPartialTypes C# (CSharp) Method

CheckForPartialTypes() private method

private CheckForPartialTypes ( CodeUnit codeUnit ) : CodeUnit
codeUnit CodeUnit
return CodeUnit
		CodeUnit CheckForPartialTypes (CodeUnit codeUnit)
		{
			CodeTypeDeclarationCollection types;
			CompileUnitPartialType partialType;
			string partialTypeName;
			List <CompileUnitPartialType> tmp;
			Dictionary <string, List <CompileUnitPartialType>> partialTypes = PartialTypes;
			
			foreach (CodeNamespace ns in codeUnit.Unit.Namespaces) {
				if (ns == null)
					continue;
				types = ns.Types;
				if (types == null || types.Count == 0)
					continue;

				foreach (CodeTypeDeclaration type in types) {
					if (type == null)
						continue;

					if (type.IsPartial) {
						partialType = new CompileUnitPartialType (codeUnit.Unit, ns, type);
						partialTypeName = partialType.TypeName;
						
						if (!partialTypes.TryGetValue (partialTypeName, out tmp)) {
							tmp = new List <CompileUnitPartialType> (1);
							partialTypes.Add (partialTypeName, tmp);
						}
						tmp.Add (partialType);
					}
				}
			}
						
			return codeUnit;
		}