예제 #1
0
파일: mdp.cs 프로젝트: lw000/zmq_guide
 /// <summary>
 /// Parse hex value to MdpwCmd, if parsing fails, return 0
 /// </summary>
 /// <param name="hexval">hex string</param>
 /// <returns>MdpwCmd, return 0 if parsing failed</returns>
 public static MdpCommon.MdpwCmd ToMdCmd(this string hexval)
 {
     try
     {
         MdpCommon.MdpwCmd cmd = (MdpCommon.MdpwCmd) byte.Parse(hexval, NumberStyles.AllowHexSpecifier);
         return(cmd);
     }
     catch (FormatException)
     {
         return(0);
     }
 }
예제 #2
0
파일: mdp.cs 프로젝트: lw000/zmq_guide
 public static string ToHexString(this MdpCommon.MdpwCmd cmd)
 {
     return(cmd.ToString("X"));
 }
예제 #3
0
파일: mdp.cs 프로젝트: lw000/zmq_guide
 public static bool StrHexEq(this ZFrame zfrm, MdpCommon.MdpwCmd cmd)
 {
     return(zfrm.ToString().ToMdCmd().Equals(cmd));
 }