mCore™ .NET SMS Library 1.2

mCore.SMS.DebugMode Property

Description:

The DebugMode property gets or sets a boolean value to define if a error message box is displayed (before throwing a exception) whenever a error occurs. The message box displays the ErrorCode and ErrorDescription properties of the current error as well as the previous error. If DebugMode property is set to False, no message box is displayed, however, ErrorCode and ErrorDescription properties still indicate the error and can be checked using IsError (even if the exception thrown has been handled).

Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)

Exceptions:

mCore.GeneralException

Usage Example:

Visual Basic
Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS

   Public Sub ModemConnect()
      Dim strError As String

      Try
         objSMS.DebugMode = True
         objSMS.Port = "COM1"
         objSMS.BaudRate = mCore.BaudRate.BaudRate_19200
         objSMS.DataBits = mCore.DataBits.Eight
         objSMS.StopBits = mCore.StopBits.One
         objSMS.Parity = mCore.Parity.None
         objSMS.FlowControl = mCore.FlowControl.RTS_CTS
         objSMS.Connect()

      Catch ex As mCore.GeneralException

      Catch ex As Exception

      End Try

      If objSMS.IsError() Then

         strError = "ERROR " & objSMS.ErrorCode.ToString() & ": " & objSMS.ErrorDescription

         MsgBox(strError, MsgBoxStyle.Critical, "mCore Demo")
      End If

   End Function
End Class

 
C#
class MyClass
{
   public mCore.SMS objSMS = new mCore.SMS();
   public static void ModemConnect()
   {
      string strError = "";
      try
      {
         objSMS.DebugMode = true;
         objSMS.Port = "COM1";
         objSMS.BaudRate = mCore.BaudRate.BaudRate_19200;
         objSMS.DataBits = mCore.DataBits.Eight;
         objSMS.StopBits = mCore.StopBits.One;
         objSMS.Parity = mCore.Parity.None;
         objSMS.FlowControl = mCore.FlowControl.RTS_CTS;
         objSMS.Connect();
      }

      catch (mCore.GeneralException e)
      {
      }
      catch (Exception e)
      {
      }

      If (objSMS.IsError())
      {
         strError = "ERROR " + objSMS.ErrorCode.ToString() + ": " + objSMS.ErrorDescription;
         MessageBox.Show(strError);
      }
   }
}

See Also:

mCore.SMS.ErrorCode Property
mCore.SMS.ErrorDescription Property
mCore.SMS.LogType Property
mCore.SMS.IsError Method

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved