Update refresh method.
This commit is contained in:
parent
f5ee32631d
commit
3dc79eb13a
@ -216,54 +216,54 @@ Public Partial Class MainForm
|
|||||||
While exec And runf
|
While exec And runf
|
||||||
If m = Mode.Open Then
|
If m = Mode.Open Then
|
||||||
contrvis(False)
|
contrvis(False)
|
||||||
Me.Invoke(Sub() lblstat.Text = "Opening...")
|
eq_vd(Sub() lblstat.Text = "Opening...")
|
||||||
Me.Invoke(Sub() pbstat.Style = ProgressBarStyle.Marquee)
|
eq_vd(Sub() pbstat.Style = ProgressBarStyle.Marquee)
|
||||||
If File.Exists(filepath) Then
|
If File.Exists(filepath) Then
|
||||||
Me.Invoke(Sub() txtbxname.Text = Path.GetFileName(filepath))
|
eq_vd(Sub() txtbxname.Text = Path.GetFileName(filepath))
|
||||||
Me.Invoke(Sub() txtbxname.DeselectAll())
|
eq_vd(Sub() txtbxname.DeselectAll())
|
||||||
unsetSafe()
|
unsetSafe()
|
||||||
setCancel()
|
setCancel()
|
||||||
Dim data As String = File.ReadAllText(filepath)
|
Dim data As String = File.ReadAllText(filepath)
|
||||||
unsetCancel()
|
unsetCancel()
|
||||||
setSafe()
|
setSafe()
|
||||||
Me.Invoke(Sub() txtbx.Text = data)
|
eq_vd(Sub() txtbx.Text = data)
|
||||||
Me.Invoke(Sub() txtbx.DeselectAll())
|
eq_vd(Sub() txtbx.DeselectAll())
|
||||||
End If
|
End If
|
||||||
filepath = ""
|
filepath = ""
|
||||||
Me.Invoke(Sub() pbstat.Style = ProgressBarStyle.Continuous)
|
eq_vd(Sub() pbstat.Style = ProgressBarStyle.Continuous)
|
||||||
Me.Invoke(Sub() lblstat.Text = "")
|
eq_vd(Sub() lblstat.Text = "")
|
||||||
contrvis(True)
|
contrvis(True)
|
||||||
m = Mode.None
|
m = Mode.None
|
||||||
ElseIf m = Mode.Save Then
|
ElseIf m = Mode.Save Then
|
||||||
contrvis(False)
|
contrvis(False)
|
||||||
Me.Invoke(Sub() lblstat.Text = "Saving...")
|
eq_vd(Sub() lblstat.Text = "Saving...")
|
||||||
Me.Invoke(Sub() pbstat.Style = ProgressBarStyle.Marquee)
|
eq_vd(Sub() pbstat.Style = ProgressBarStyle.Marquee)
|
||||||
unsetSafe()
|
unsetSafe()
|
||||||
setCancel()
|
setCancel()
|
||||||
File.WriteAllText(filepath, txtbx.Text)
|
File.WriteAllText(filepath, txtbx.Text)
|
||||||
unsetCancel()
|
unsetCancel()
|
||||||
setSafe()
|
setSafe()
|
||||||
filepath = ""
|
filepath = ""
|
||||||
Me.Invoke(Sub() pbstat.Style = ProgressBarStyle.Continuous)
|
eq_vd(Sub() pbstat.Style = ProgressBarStyle.Continuous)
|
||||||
Me.Invoke(Sub() lblstat.Text = "")
|
eq_vd(Sub() lblstat.Text = "")
|
||||||
contrvis(True)
|
contrvis(True)
|
||||||
m = Mode.None
|
m = Mode.None
|
||||||
ElseIf m = Mode.Clear Then
|
ElseIf m = Mode.Clear Then
|
||||||
contrvis(False)
|
contrvis(False)
|
||||||
Me.Invoke(Sub() lblstat.Text = "Clearing...")
|
eq_vd(Sub() lblstat.Text = "Clearing...")
|
||||||
Me.Invoke(Sub() pbstat.Style = ProgressBarStyle.Marquee)
|
eq_vd(Sub() pbstat.Style = ProgressBarStyle.Marquee)
|
||||||
Me.Invoke(Sub() txtbxname.Text = "")
|
eq_vd(Sub() txtbxname.Text = "")
|
||||||
Me.Invoke(Sub() txtbxname.DeselectAll())
|
eq_vd(Sub() txtbxname.DeselectAll())
|
||||||
Me.Invoke(Sub() txtbx.Text = "")
|
eq_vd(Sub() txtbx.Text = "")
|
||||||
Me.Invoke(Sub() txtbx.DeselectAll())
|
eq_vd(Sub() txtbx.DeselectAll())
|
||||||
Me.Invoke(Sub() pbstat.Style = ProgressBarStyle.Continuous)
|
eq_vd(Sub() pbstat.Style = ProgressBarStyle.Continuous)
|
||||||
Me.Invoke(Sub() lblstat.Text = "")
|
eq_vd(Sub() lblstat.Text = "")
|
||||||
contrvis(True)
|
contrvis(True)
|
||||||
m = Mode.None
|
m = Mode.None
|
||||||
ElseIf m = Mode.Upload Then
|
ElseIf m = Mode.Upload Then
|
||||||
contrvis(False)
|
contrvis(False)
|
||||||
Me.Invoke(Sub() lblstat.Text = "Receiving...")
|
eq_vd(Sub() lblstat.Text = "Receiving...")
|
||||||
Me.Invoke(Sub() lblstat.Text = "Receiving : Sending Handshake...")
|
eq_vd(Sub() lblstat.Text = "Receiving : Sending Handshake...")
|
||||||
setCancel()
|
setCancel()
|
||||||
stage = 1
|
stage = 1
|
||||||
If canc Then
|
If canc Then
|
||||||
@ -273,8 +273,8 @@ Public Partial Class MainForm
|
|||||||
Else
|
Else
|
||||||
sendHandshake("1".ToCharArray()(0))
|
sendHandshake("1".ToCharArray()(0))
|
||||||
End If
|
End If
|
||||||
Me.Invoke(Sub() pbstat.Value = CType(1*(100/3), integer))
|
eq_vd(Sub() pbstat.Value = CType(1*(100/3), integer))
|
||||||
Me.Invoke(Sub() lblstat.Text = "Receiving : Waiting For Data...")
|
eq_vd(Sub() lblstat.Text = "Receiving : Waiting For Data...")
|
||||||
stage = 2
|
stage = 2
|
||||||
While r_q.Count = 0 And SocketConnected(client_sock) And Not canc
|
While r_q.Count = 0 And SocketConnected(client_sock) And Not canc
|
||||||
Thread.Sleep(100)
|
Thread.Sleep(100)
|
||||||
@ -300,8 +300,8 @@ Public Partial Class MainForm
|
|||||||
GoTo fu
|
GoTo fu
|
||||||
End If
|
End If
|
||||||
unsetCancel()
|
unsetCancel()
|
||||||
Me.Invoke(Sub() pbstat.Value = CType(2*(100/3), integer))
|
eq_vd(Sub() pbstat.Value = CType(2*(100/3), integer))
|
||||||
Me.Invoke(Sub() lblstat.Text = "Receiving : Processing Data...")
|
eq_vd(Sub() lblstat.Text = "Receiving : Processing Data...")
|
||||||
stage = 3
|
stage = 3
|
||||||
Dim bts As Byte() = r_q.Dequeue()
|
Dim bts As Byte() = r_q.Dequeue()
|
||||||
Dim str As String = System.Text.Encoding.ASCII.GetString(bts)
|
Dim str As String = System.Text.Encoding.ASCII.GetString(bts)
|
||||||
@ -311,12 +311,12 @@ Public Partial Class MainForm
|
|||||||
If str.Contains(ControlChars.Lf) And Not str.Contains(ControlChars.Cr) Then
|
If str.Contains(ControlChars.Lf) And Not str.Contains(ControlChars.Cr) Then
|
||||||
str = str.Replace(ControlChars.Lf, ControlChars.CrLf)
|
str = str.Replace(ControlChars.Lf, ControlChars.CrLf)
|
||||||
End If
|
End If
|
||||||
Me.Invoke(Sub() txtbxname.Text = "")
|
eq_vd(Sub() txtbxname.Text = "")
|
||||||
Me.Invoke(Sub() txtbxname.DeselectAll())
|
eq_vd(Sub() txtbxname.DeselectAll())
|
||||||
Me.Invoke(Sub() txtbx.Text = str)
|
eq_vd(Sub() txtbx.Text = str)
|
||||||
Me.Invoke(Sub() txtbx.DeselectAll())
|
eq_vd(Sub() txtbx.DeselectAll())
|
||||||
Me.Invoke(Sub() pbstat.Value = CType(3*(100/3), integer))
|
eq_vd(Sub() pbstat.Value = CType(3*(100/3), integer))
|
||||||
Me.Invoke(Sub() lblstat.Text = "Receiving : Sending Handshake...")
|
eq_vd(Sub() lblstat.Text = "Receiving : Sending Handshake...")
|
||||||
setCancel()
|
setCancel()
|
||||||
stage = 4
|
stage = 4
|
||||||
If canc Then
|
If canc Then
|
||||||
@ -328,14 +328,14 @@ Public Partial Class MainForm
|
|||||||
fu:
|
fu:
|
||||||
unsetCancel()
|
unsetCancel()
|
||||||
stage = 0
|
stage = 0
|
||||||
Me.Invoke(Sub() pbstat.Value = 0)
|
eq_vd(Sub() pbstat.Value = 0)
|
||||||
Me.Invoke(Sub() lblstat.Text = "")
|
eq_vd(Sub() lblstat.Text = "")
|
||||||
contrvis(True)
|
contrvis(True)
|
||||||
m = Mode.None
|
m = Mode.None
|
||||||
ElseIf m = Mode.Download Then
|
ElseIf m = Mode.Download Then
|
||||||
contrvis(False)
|
contrvis(False)
|
||||||
Me.Invoke(Sub() lblstat.Text = "Sending...")
|
eq_vd(Sub() lblstat.Text = "Sending...")
|
||||||
Me.Invoke(Sub() lblstat.Text = "Sending : Sending Handshake...")
|
eq_vd(Sub() lblstat.Text = "Sending : Sending Handshake...")
|
||||||
setCancel()
|
setCancel()
|
||||||
stage = 1
|
stage = 1
|
||||||
If canc Then
|
If canc Then
|
||||||
@ -345,8 +345,8 @@ Public Partial Class MainForm
|
|||||||
Else
|
Else
|
||||||
sendHandshake("1".ToCharArray()(0))
|
sendHandshake("1".ToCharArray()(0))
|
||||||
End If
|
End If
|
||||||
Me.Invoke(Sub() pbstat.Value = ctype(1*(100/3), integer))
|
eq_vd(Sub() pbstat.Value = ctype(1*(100/3), integer))
|
||||||
Me.Invoke(Sub() lblstat.Text = "Sending : Waiting For Handshake...")
|
eq_vd(Sub() lblstat.Text = "Sending : Waiting For Handshake...")
|
||||||
stage = 2
|
stage = 2
|
||||||
While r_q.Count = 0 And SocketConnected(client_sock) And Not canc
|
While r_q.Count = 0 And SocketConnected(client_sock) And Not canc
|
||||||
Thread.Sleep(100)
|
Thread.Sleep(100)
|
||||||
@ -389,8 +389,8 @@ Public Partial Class MainForm
|
|||||||
r_q.Clear()
|
r_q.Clear()
|
||||||
GoTo fd
|
GoTo fd
|
||||||
End If
|
End If
|
||||||
Me.Invoke(Sub() pbstat.Value = ctype(2*(100/3), integer))
|
eq_vd(Sub() pbstat.Value = ctype(2*(100/3), integer))
|
||||||
Me.Invoke(Sub() lblstat.Text = "Sending : Sending Data...")
|
eq_vd(Sub() lblstat.Text = "Sending : Sending Data...")
|
||||||
stage = 3
|
stage = 3
|
||||||
If Not canc Then
|
If Not canc Then
|
||||||
Dim bts As Byte() = System.Text.Encoding.ASCII.GetBytes(txtbx.Text)
|
Dim bts As Byte() = System.Text.Encoding.ASCII.GetBytes(txtbx.Text)
|
||||||
@ -411,8 +411,8 @@ Public Partial Class MainForm
|
|||||||
r_q.Clear()
|
r_q.Clear()
|
||||||
GoTo fd
|
GoTo fd
|
||||||
End If
|
End If
|
||||||
Me.Invoke(Sub() pbstat.Value = ctype(3*(100/3), integer))
|
eq_vd(Sub() pbstat.Value = ctype(3*(100/3), integer))
|
||||||
Me.Invoke(Sub() lblstat.Text = "Sending : Waiting For Handshake...")
|
eq_vd(Sub() lblstat.Text = "Sending : Waiting For Handshake...")
|
||||||
stage = 4
|
stage = 4
|
||||||
While r_q.Count = 0 And SocketConnected(client_sock) And canc
|
While r_q.Count = 0 And SocketConnected(client_sock) And canc
|
||||||
Thread.Sleep(100)
|
Thread.Sleep(100)
|
||||||
@ -443,8 +443,8 @@ Public Partial Class MainForm
|
|||||||
fd:
|
fd:
|
||||||
unsetCancel()
|
unsetCancel()
|
||||||
stage = 0
|
stage = 0
|
||||||
Me.Invoke(Sub() pbstat.Value = 0)
|
eq_vd(Sub() pbstat.Value = 0)
|
||||||
Me.Invoke(Sub() lblstat.Text = "")
|
eq_vd(Sub() lblstat.Text = "")
|
||||||
contrvis(True)
|
contrvis(True)
|
||||||
m = Mode.None
|
m = Mode.None
|
||||||
Else
|
Else
|
||||||
@ -702,7 +702,7 @@ Public Partial Class MainForm
|
|||||||
|
|
||||||
Private Sub contrvis(ByVal vis As Boolean, Optional ByVal vm As Vism = Vism.server_stats or Vism.program_management or Vism.textbox or Vism.state)
|
Private Sub contrvis(ByVal vis As Boolean, Optional ByVal vm As Vism = Vism.server_stats or Vism.program_management or Vism.textbox or Vism.state)
|
||||||
If Me.InvokeRequired Then
|
If Me.InvokeRequired Then
|
||||||
Me.Invoke(Sub() contrvis(vis,vm))
|
eq_vd(Sub() contrvis(vis,vm))
|
||||||
Else
|
Else
|
||||||
If vm.HasFlag(Vism.server_stats) Then
|
If vm.HasFlag(Vism.server_stats) Then
|
||||||
dudsa.Enabled = vis
|
dudsa.Enabled = vis
|
||||||
|
Loading…
Reference in New Issue
Block a user