internal static BuildResult CreateBuildResultFromCode(BuildResultTypeCode code, System.Web.VirtualPath virtualPath) { BuildResult result = null; switch (code) { case BuildResultTypeCode.BuildResultCompiledAssembly: result = new BuildResultCompiledAssembly(); break; case BuildResultTypeCode.BuildResultCompiledType: result = new BuildResultCompiledType(); break; case BuildResultTypeCode.BuildResultCompiledTemplateType: result = new BuildResultCompiledTemplateType(); break; case BuildResultTypeCode.BuildResultCustomString: result = new BuildResultCustomString(); break; case BuildResultTypeCode.BuildResultMainCodeAssembly: result = new BuildResultMainCodeAssembly(); break; case BuildResultTypeCode.BuildResultCodeCompileUnit: result = new BuildResultCodeCompileUnit(); break; case BuildResultTypeCode.BuildResultCompiledGlobalAsaxType: result = new BuildResultCompiledGlobalAsaxType(); break; case BuildResultTypeCode.BuildResultResourceAssembly: result = new BuildResultResourceAssembly(); break; default: return(null); } result.VirtualPath = virtualPath; result._nextUpToDateCheck = DateTime.MinValue; return(result); }
#pragma warning restore 0649 internal static BuildResult CreateBuildResultFromCode(BuildResultTypeCode code, VirtualPath virtualPath) { BuildResult ret = null; switch (code) { case BuildResultTypeCode.BuildResultCompiledAssembly: ret = new BuildResultCompiledAssembly(); break; case BuildResultTypeCode.BuildResultCompiledType: ret = new BuildResultCompiledType(); break; case BuildResultTypeCode.BuildResultCompiledTemplateType: ret = new BuildResultCompiledTemplateType(); break; case BuildResultTypeCode.BuildResultCompiledGlobalAsaxType: ret = new BuildResultCompiledGlobalAsaxType(); break; case BuildResultTypeCode.BuildResultCustomString: ret = new BuildResultCustomString(); break; case BuildResultTypeCode.BuildResultMainCodeAssembly: ret = new BuildResultMainCodeAssembly(); break; case BuildResultTypeCode.BuildResultResourceAssembly: ret = new BuildResultResourceAssembly(); break; case BuildResultTypeCode.BuildResultCodeCompileUnit: ret = new BuildResultCodeCompileUnit(); break; default: Debug.Assert(false, "code=" + code); return null; } ret.VirtualPath = virtualPath; // Set _nextUpToDateCheck to MinValue, to make sure the next call to IsUpToDate() // actually makes the check ret._nextUpToDateCheck = DateTime.MinValue; return ret; }