public
Created

  • Download Gist
gistfile1.vb
Visual Basic
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.