PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/ThinkEmailFomatter/Utilities/Extensions/ViewExt.cs

https://bitbucket.org/nicdao/frg-think-emailformatter
C# | 21 lines | 20 code | 1 blank | 0 comment | 1 complexity | 536808bb4efa9825e15078e8a7640986 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.IO;
  6. using System.Xml;
  7. using System.Xml.Linq;
  8. using ThinkEmailFormatter.Models;
  9. using System.Web.Mvc;
  10. namespace ThinkEmailFormatter.Models.Extensions
  11. {
  12. public static class ViewExt
  13. {
  14. public static bool ViewExist(this ControllerContext controllerContext, string templateName)
  15. {
  16. ViewEngineResult result = ViewEngines.Engines.FindView(controllerContext, templateName, null);
  17. return (result.View != null);
  18. }
  19. }
  20. }