PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers/EventHelper.cs

https://github.com/mjhuangzk/WeiXinMPSDK
C# | 21 lines | 19 code | 2 blank | 0 comment | 0 complexity | 602f60695d595fe2ba4fdb157daa8f78 MD5 | raw file
Possible License(s): BSD-2-Clause, BSD-3-Clause
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Xml.Linq;
  6. namespace Senparc.Weixin.MP.Helpers
  7. {
  8. public class EventHelper
  9. {
  10. public static Event GetEventType(XDocument doc)
  11. {
  12. return GetEventType(doc.Root.Element("Event").Value);
  13. }
  14. public static Event GetEventType(string str)
  15. {
  16. return (Event)Enum.Parse(typeof(Event), str, true);
  17. }
  18. }
  19. }