private static Resource ResolveContent(string path) { if (string.IsNullOrEmpty(path) || ResourceResolve == null) { return(null); } ResourceResolveEventArgs args = new ResourceResolveEventArgs(path); try { ResourceResolve(null, args); } catch (Exception e) { Log.Core.WriteError("An error occurred in custom ResourceResolve code: {0}", Log.Exception(e)); } if (args.Handled) { if (string.IsNullOrEmpty(args.Result.Path)) { args.Result.Path = path; } AddContent(path, args.Result); return(args.Result); } else { return(null); } }