public static bool TryParse(Message message, out Message result)
 {
     try {
         result = new OldTighteningResultUpload(message);
         return true;
     } catch {
         result = null;
         return false;
     }
 }
예제 #2
0
 /////////////////////////////////////////////////////////////////////////////////////////// 
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 /////////////////////////////////////////////////////////////////////////////////////////// 
 public bool RequestOldTighteningResult(UInt32 tighteningID, out OldTighteningResultUpload result)
 {
     result = null;
     if (Connected && mCommunicationStarted) {
         //Send message to subscribe to last tightening result
         Message response = Send(new OldTighteningResultRequest(tighteningID), MessageType.OldTighteningResultUpload);
         if (response is OldTighteningResultUpload) {
             result = response as OldTighteningResultUpload;
             return true;
         //} else {
         //    Disconnect();
         }
     }
     return false;
 }