I am working in a tool that commit dcm files in multiple folders . Now i am trying to add a checkbox that manage the exact folder you want to commit so if i want to include files in subfolders i will press the check box if not i will leave unchecked . Now the problem is that i can not exclude the subfolders from being loaded even when the checkbox is unchecked
this the function i am working on :
Sub CheckBox1CheckedChanged()
If IO.Directory.GetDirectories(CWPathTB.Text).Length > 1 AndAlso checkBox1.Checked= False Then
'how to clear the subfolders and make them unseen in this condition
LoadChangedFiles2()
Else
FilesGrid.Rows.Clear()
LoadChangedFiles()
End If
End Sub
your help is highly appreciated :)
......
the function :
Public Sub LoadChangedFiles2()
'loading all the modified , added and removed files only in the top directory into files grid
Dim b,j As Integer
Dim PushokClientt As New PushOkSvn.SVNClient
Dim ModiFiles As New ArrayList
Dim ConflFiles As New ArrayList
FileLocalPos1.Clear()
FileList1.Clear()
ModFileArr1.Clear()
ConfFileArr1.Clear()
AddedFileArr1.Clear()
RemovedFileArr1.Clear()
Dim LocDir As New IO.DirectoryInfo(CWPath)
Dim ignorSharcc As Boolean = False
Dim FInfoLoc() As IO.FileInfo = LocDir.GetFiles("*.dcm",IO.SearchOption.TopDirectoryOnly)
Dim FileInfoLoc As IO.FileInfo
For Each FileInfoLoc In FInfoLoc
If FileInfoLoc.FullName.Substring(FileInfoLoc.FullName.Length - 4 , 4 ) = ".dcm" Then
If Not FileInfoLoc.FullName.Contains("sharcc") Then
Dim TempFileName() As String
Dim FileName As String
TempFileName = FileInfoLoc.FullName.Split("\")
FileName = TempFileName(TempFileName.Length - 1)
If Not FileLocalPos1.Contains(FileName)Then
FileLocalPos1.Add(FileInfoLoc.FullName , FileName )
FileList1.Add(FileName)
Else
MsgBox("In Pfad exist two .dcm files with the same name . Choose an exacter Pfad . ")
Exit Sub
End If
Else
ignorSharcc = True
End If
End If
Next
If ignorSharcc = True Then
MsgBox("Sharcc folder has been ignored.")
End If
Call checkStatus2(CWPath, PushokClientt)
j=0
For b = 0 To ModFileArr1.Count - 1
Dim Filerow1 As String() = {False, ModFileArr1.Item(b).ToString, "Modified", FileLocalPos1.Item(ModFileArr1.Item(b).ToString)}
DcmComm.FilesGrid.Rows.Add(Filerow1)
j = j + 1
Next
For b = 0 To ConfFileArr.Count - 1
Dim Filerow1 As String() = {False, ConfFileArr1.Item(b).ToString, "Conflicted", FileLocalPos1.Item(ConfFileArr1.Item(b).ToString)}
DcmComm.FilesGrid.Rows.Add(Filerow1)
DcmComm.FilesGrid.Rows(j).DefaultCellStyle.BackColor = Color.DarkGray
DcmComm.FilesGrid.Rows(j).ReadOnly = True
MsgBox(ConfFileArr1.Item(b).ToString & " is out of date! Please update first! ")
j = j + 1
Next
For b = 0 To AddedFileArr1.Count - 1
Dim row1 As String() = {False, AddedFileArr1.Item(b).ToString, "Added", FileLocalPos1.Item(AddedFileArr1.Item(b).ToString)}
DcmComm.FilesGrid.Rows.Add(row1)
j = j + 1
Next
For b = 0 To RemovedFileArr1.Count - 1
Dim row1 As String() = {False, RemovedFileArr1.Item(b).ToString, "Removed", ""}
DcmComm.FilesGrid.Rows.Add(row1)
j = j + 1
Next
Exit Sub
End Sub
..........................
and the error is appearing in this line :
Dim Filerow1 As String() = {False, ModFileArr1.Item(b).ToString, "Modified", FileLocalPos1.Item(ModFileArr1.Item(b).ToString)}