Create a gist now

Instantly share code, notes, and snippets.

Public Sub GetSomethingColor(ByVal IntVar1 As Integer, ByVal BoolVar2 As Boolean
, ByVal BoolVar3 As Boolean, ByVal BoolVar4 As Boolean
, ByVal IntVar5 As Integer, ByVal IntVar6 As Integer
, ByRef ClassVar7 As ClassType1, ByVal IntVar8 As Integer
, ByVal IntVar9 As Integer
, Optional ByVal BoolVar10 As Boolean = False)
Try
'' some comment
If BoolVar10 = True Then
ClassVar7.PortStatus = SomeColor.Mixed
If ClassVar7.ConnectedIntVar1_2 = -1 Then
ClassVar7.ConnectedIntVar1_2 = IntVar8
End If
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources.MixedLedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources.MixedLedOff()
End If
Else
If BoolVar2 AndAlso IntVar9 > 0 AndAlso (IntVar9 <> IntVar8) Then
ClassVar7.PortStatus = SomeColor.Mixed
ClassVar7.ConnectedIntVar1_2 = IntVar9
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources.MixedLedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources.MixedLedOff()
End If
Else
ClassVar7.ConnectedIntVar1_2 = -1
If BoolVar2 = False Then
If BoolVar3 Then
ClassVar7.PortStatus = SomeColor.PatchCordNo_DesignYes_DisconnectWONo
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._6LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._6LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar8
Else
Select Case IntVar5
Case -1 ' some comment
ClassVar7.PortStatus = SomeColor.SomethingColor
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._1LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._1LedOff()
End If
ClassVar7.ConnectedIntVar1 = 0
Case IntVar5.Invalid
ClassVar7.PortStatus = SomeColor.SomethingColor2
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._2LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._2LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
Case IntVar5.Valid
ClassVar7.PortStatus = SomeColor.SomethingColor3
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._3LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._3LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
Case IntVar5.Expired
ClassVar7.PortStatus = SomeColor.SomethingColor4
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._4LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._4LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
End Select
End If
Else
If BoolVar3 = False Then ' some comment
Select Case IntVar5
Case -1 ' some comment
ClassVar7.PortStatus = SomeColor.SomethingColor5
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._5LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._5LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar8
Case IntVar5.Invalid
If BoolVar4 = True Then
'ClassVar7.PortStatus = SomeColor.SomethingColor13
'If IntVar6 = True Then
' ClassVar7.Port.BackgroundImage = My.Resources._6LedOn
'Else
' ClassVar7.Port.BackgroundImage = My.Resources._6LedOff
'End If
'ClassVar7.ConnectedIntVar1 = IntVar9
Else ' Disconnect Work-Order in phase 1
ClassVar7.PortStatus = SomeColor.SomethingColor6
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._7LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._7LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
End If
Case IntVar5.Valid
' some comment
' some comment
ClassVar7.PortStatus = SomeColor.SomethingColor7
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._8LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._8LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
Case IntVar5.Expired
' some comment
' some comment
ClassVar7.PortStatus = SomeColor.SomethingColor8
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._13LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._13LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
End Select
Else ' some comment
Select Case IntVar5
Case -1 ' some comment
ClassVar7.PortStatus = SomeColor.SomethingColor9
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._9LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._9LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar8
Case IntVar5.Invalid
ClassVar7.PortStatus = SomeColor.SomethingColor10
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._10LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._10LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
Case IntVar5.Valid
ClassVar7.PortStatus = SomeColor.SomethingColor11
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._11LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._11LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
Case IntVar5.Expired
ClassVar7.PortStatus = SomeColor.SomethingColor12
If IntVar6 = 1 Then
ClassVar7.Port.BackgroundImage = My.Resources._12LedOn()
Else
ClassVar7.Port.BackgroundImage = My.Resources._12LedOff()
End If
ClassVar7.ConnectedIntVar1 = IntVar9
End Select
End If
End If
End If
End If
ClassVar7.IntVar1 = IntVar1
Catch
MsgBox(Err.Description, MsgBoxStyle.Critical, "Error in Coloring")
End Try
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment