Skip to content

Commit

Permalink
Merge pull request #2 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Pulling changes updated by Stephen
  • Loading branch information
deaspo committed Nov 9, 2015
2 parents 6e2d9cb + 1c95c93 commit 9e2271c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 45 deletions.
48 changes: 26 additions & 22 deletions instat/ucrReceiverMultiple.vb
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
Public Class ucrReceiverMultiple
Public Overrides Sub AddSelected()
Dim objItem As Object
Dim tempObjects(Selector.lstAvailableVariable.SelectedItems.Count - 1) As Object

Selector.lstAvailableVariable.SelectedItems.CopyTo(tempObjects, 0)
For Each objItem In tempObjects
lstSelectedVariables.Items.Add(objItem)
Selector.lstAvailableVariable.Items.Remove(objItem)
Next
End Sub

Public Overrides Sub RemoveSelected()
Dim objItem As Object
Dim tempObjects(lstSelectedVariables.SelectedItems.Count - 1) As Object

lstSelectedVariables.SelectedItems.CopyTo(tempObjects, 0)
For Each objItem In tempObjects
Selector.lstAvailableVariable.Items.Add(objItem)
lstSelectedVariables.Items.Remove(objItem)
Next
End Sub
Public Class ucrReceiverMultiple
Public Overrides Sub AddSelected()
Dim objItem As Object
Dim tempObjects(Selector.lstAvailableVariable.SelectedItems.Count - 1) As Object

Selector.lstAvailableVariable.SelectedItems.CopyTo(tempObjects, 0)
For Each objItem In tempObjects
lstSelectedVariables.Items.Add(objItem)
Selector.lstAvailableVariable.Items.Remove(objItem)
Next
End Sub

Public Overrides Sub RemoveSelected()
Dim objItem As Object
Dim tempObjects(lstSelectedVariables.SelectedItems.Count - 1) As Object

If lstSelectedVariables.SelectedItems.Count > 0 Then
lstSelectedVariables.SelectedItems.CopyTo(tempObjects, 0)
For Each objItem In tempObjects
Selector.lstAvailableVariable.Items.Add(objItem)
lstSelectedVariables.Items.Remove(objItem)
Next
Else
MsgBox("There is nothing to remove", vbInformation, "Selection message")
End If
End Sub
End Class
55 changes: 32 additions & 23 deletions instat/ucrReceiverSingle.vb
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
Public Class ucrReceiverSingle
Public Overrides Sub AddSelected()
Dim objItem As Object
Dim tempObjects(Selector.lstAvailableVariable.SelectedItems.Count - 1) As Object
Public Class ucrReceiverSingle
Public Overrides Sub AddSelected()
Dim objItem As Object
If txtReceiverSingle.Text = "" Then
Dim tempObjects(Selector.lstAvailableVariable.SelectedItems.Count - 1) As Object

Selector.lstAvailableVariable.SelectedItems.CopyTo(tempObjects, 0)
For Each objItem In tempObjects
txtReceiverSingle.Text = objItem
Selector.lstAvailableVariable.Items.Remove(objItem)
Next
Else
MsgBox("Receiver takes only one variable", vbInformation, "Selection message")

End If
End Sub

Public Overrides Sub RemoveSelected()
Dim objItem As Object
Dim tempObjects(0) As Object

If txtReceiverSingle.Text <> "" Then
tempObjects(0) = txtReceiverSingle.Text
For Each objItem In tempObjects
Selector.lstAvailableVariable.Items.Add(objItem)
txtReceiverSingle.Text = Nothing
Next
Else
MsgBox("There is nothing to remove", vbInformation, "Selection message")
End If
End Sub
End Class

Selector.lstAvailableVariable.SelectedItems.CopyTo(tempObjects, 0)
For Each objItem In tempObjects
txtReceiverSingle.Text = objItem
Selector.lstAvailableVariable.Items.Remove(objItem)
Next
End Sub

Public Overrides Sub RemoveSelected()
Dim objItem As Object
Dim tempObjects(0) As Object
If txtReceiverSingle.Text <> "" Then
tempObjects(0) = txtReceiverSingle.Text
For Each objItem In tempObjects
Selector.lstAvailableVariable.Items.Add(objItem)
txtReceiverSingle.Text = Nothing
Next
End If
End Sub
End Class

0 comments on commit 9e2271c

Please sign in to comment.