Example #1
0
        public override bool Equals(object obj)
        {
            if (System.Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            TMTErrorBase convertedObj = obj as TMTErrorBase;

            if (convertedObj == null)
            {
                return(false);
            }

            return(Code == convertedObj.Code);
        }
Example #2
0
 protected TMTException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if (info != null)
     {
         try
         {
             int errorCode = info.GetInt32("errorCode");
             if (errorCode != 0)
             {
                 string message = info.GetString("errorMessage");
                 this._tmtError = new TMTErrorBase(errorCode, message);
             }
             this._additionalInfo = (KeyValuePair <string, string>[])info.GetValue("additionalInfo", typeof(KeyValuePair <string, string>[]));
         }
         catch
         {
         }
     }
 }
Example #3
0
 public TMTException(string message, TMTErrorBase tmtError, KeyValuePair <string, string>[] additionalInfo)
     : base(message)
 {
     this._additionalInfo = additionalInfo;
     this._tmtError       = tmtError;
 }
Example #4
0
 public TMTException(string message, int tmtErrorCode)
     : base(message)
 {
     this._additionalInfo = null;
     this._tmtError       = new TMTErrorBase(tmtErrorCode, message);
 }
Example #5
0
 public TMTException(string message, TMTErrorBase tmtError)
     : base(message)
 {
     this._additionalInfo = null;
     this._tmtError       = tmtError;
 }
Example #6
0
 public TMTException(TMTErrorBase tmtError)
     : base(tmtError.Message)
 {
     this._additionalInfo = null;
     this._tmtError       = tmtError;
 }