Hi Sailung
isaddremovecompleted is set to true when the modemlistchanged event fires.
Private Sub fax_ModemsListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs)
' ctrlModems_Load has an add handler call in it for this.
' apparently thats the only way the HANDLES FAXMAN1.Modems.ListChanged can be trapped.
' MessageBox.Show("Have received Modem List Changed Event.")
' this gets hit first on remove
BeginInvoke(New myModemListChangedDelegate(AddressOf ModemListChanged), New Object() {sender, e})
End Sub
Private Sub ModemListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs)
' MessageBox.Show("ListChangeEvent: " & e.ListChangedType)
' this is being fired on btnModemRemoved. 04/22/08
isaddremovecompleted = True
Select Case e.ListChangedType
Case ListChangedType.ItemDeleted
Case ListChangedType.ItemAdded
End Select
End Sub
Pause Faxing, in one of the later version of faxman 4.x a pause method was added.
This will allow any faxes currently being sent or received to finsh and not allow any new
faxes to be received or sent.
PauseFaxing calls that PauseFaxActivity which does the faxman function to stop faxing.
It then waits until for the faxmodems to go inactive, displaying a message screen while waiting.
The Operation parameter (REMOVE) in this case is just a string to display in the message screen as to what is happening.
Private Sub PauseFaxing(ByVal Operation As String)
btnModemAutoDetect.Enabled = False
Me.btnFindModem.Enabled = False
Me.btnRemoveModem.Enabled = False
fm.PauseFaxActivity(True)
' wait for activity to stop.
Dim myform As New dlgModemDetect(Operation)
myform.fmain = fmain
Result = DialogResult.OK
' only display this if FAXING is active
If fmain.objStatus.IsFaxActive = True Then
Result = myform.ShowDialog
End If
End Sub
Public Function PauseFaxActivity(ByVal value As Boolean) As Boolean
Dim Result As Boolean
'Using Fax As New FaxMan
If isFaxManActive Then
Select Case value
Case True
myFaxMan.Server.Item("ServerStatus") = "Paused"
PVI.Utility.LogHistory(fMain_Manager.objStatus.lvStatus, _
"Info - Server Status Paused", PVI.Utility.AppLogFileFullPath)
Case False
myFaxMan.Server.Item("ServerStatus") = "Running"
PVI.Utility.LogHistory(fMain_Manager.objStatus.lvStatus, _
"Info - Server Status Running", _
PVI.Utility.AppLogFileFullPath)
End Select
Result = True
End If
'End Using
End Function
isFaxManActive just checks the status of the faxman service.
Cannot Pause Faxing if service is not active.
''' <summary>
''' Used to check to see if the FAXMAN service is active (running)
''' </summary>
''' <value></value>
''' <returns>
''' True = Service is running
''' False = Service is either not installed or is not running.
''' </returns>
''' <remarks></remarks>
Public ReadOnly Property isFaxManActive() As Boolean
Get
init_Controller()
Dim _servicestatus As String = Nothing
Try
_servicestatus = controller.Status.ToString
Catch ex As System.InvalidOperationException
_servicestatus = "Disabled"
Finally
Select Case _servicestatus
Case "Running"
isFaxManActive = True
Case "Stopped", "Disabled"
isFaxManActive = False
End Select
End Try
End Get
End Property
PVI.Utility.pause(1) is just a delay(1 second) to allow the remove action to complete.
Public Shared Sub pause(ByVal seconds As Int32)
Dim starttime As DateTime = DateTime.Now
Do Until DateTime.Now > starttime.AddSeconds(seconds)
Application.DoEvents()
Loop
End Sub