*Beta* Unfinished Tech editor.

Alrighty, here are my fixes:

mnuOpen_Click() in Form1.vb
Code:
Private Sub mnuOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOpen.Click
        On Error GoTo ERR_mnuOpen
        Dim FileTarget As New Windows.Forms.OpenFileDialog
        FileTarget.Filter = "XML files (*.xml)|*.xml"
        FileTarget.Title = "Select Technology file"
        FileTarget.CheckFileExists = True
        FileTarget.CheckFileExists = True
        FileTarget.ShowDialog()            'BUG: Exception when trying to open a file that contains no techs. - NOT FIXED (in progress)

        'While FileTarget.FileName = ""
        'End While                       BUG: Application hangs. - FIXED
        If FileTarget.FileName = "" Then Exit Sub 'Application would hang using the above code.

        If System.IO.File.Exists(FileTarget.FileName) Then
            LoadXML(FileTarget.FileName)
        End If
        lstTechs.DataSource = CurTechList
        lstTechs.DisplayMember = "Name"
        lstTechs.ValueMember = "Data"
        FileOpen = True
        FileName = FileTarget.FileName
        mnuTechs.Enabled = True

        'Error-handling
        Exit Sub
ERR_mnuOpen:
        Dim result As MsgBoxResult
        result = MsgBox("An error occurred while trying to open the file. Would you like to try opening another one?", MsgBoxStyle.YesNo, "File error")
        If result = MsgBoxResult.Yes Then mnuOpen_Click(sender, e)
    End Sub

mnuAdd_Click() in Form1.vb
Code:
Private Sub mnuAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAdd.Click
        Dim tech As New clsTechData
        tech.Name = InputBox("Please name your new technology.", "Add Technology", "UnnamedTech") 'Added by HG_CassiusA (Brendon S. Allan)
        'tech.Name = "UnnamedTech" <==Obsolete code==> (HG_CassiusA)
        CurTechList.Add(tech, tech.Name) 'Changed from CurTechList.Add(tech) to fix bug regarding technology deletion.
        CurTech = tech

        If Not CurTechList Is Nothing Or CurTechList.Count > 0 Then
            lstTechs.DataSource = Nothing
            lstTechs.DataSource = CurTechList
            lstTechs.DisplayMember = "Name"
            lstTechs.ValueMember = "Data"
        Else
            lstTechs.DataSource = Nothing
        End If
        lstTechs.ClearSelected()
        lstTechs.SelectedIndex = lstTechs.Items.Count - 1
        SetupForm()
    End Sub

mnuRemove_Click() in Form1.vb
Code:
Private Sub mnuAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAdd.Click
        Dim tech As New clsTechData
        tech.Name = InputBox("Please name your new technology.", "Add Technology", "UnnamedTech") 'Added by HG_CassiusA (Brendon S. Allan)
        'tech.Name = "UnnamedTech" <==Obsolete code==> (HG_CassiusA)
        CurTechList.Add(tech, tech.Name) 'Changed from CurTechList.Add(tech) to fix bug regarding technology deletion.
        CurTech = tech

        If Not CurTechList Is Nothing Or CurTechList.Count > 0 Then
            lstTechs.DataSource = Nothing
            lstTechs.DataSource = CurTechList
            lstTechs.DisplayMember = "Name"
            lstTechs.ValueMember = "Data"
        Else
            lstTechs.DataSource = Nothing
        End If
        lstTechs.ClearSelected()
        lstTechs.SelectedIndex = lstTechs.Items.Count - 1
        SetupForm()
    End Sub

Hope this helps :D

I've also been trying to update your XML reading code to .NET 2.0 compliancy, since the XMLValidatingReader class is obsolete in .NET 2.0.
 
I don't really want to update it to net 2.0 for a few reasons. A. I'd like it to be as accessable as possible (i almost wrote it in VB 6.0, but the ease of .net enticed me away), B. I can't update to the most current installer (for reasons you can interpret, and i cannot say on this forum), so i can't use .net 2.0. furthermore, i'm just a bit jumpy about "advanced" microsoft technology, and refuse to adopt it until it's at least one generation behind the cutting edge.

If you'd like to maintain a second version of the program written for .net 2.0 you have my full permission HG_CassiusA, indeed, anyone who wishes to take my code and modify it has my permission, as long as they cite me as the origion, and post their code along with the .exe.
 
This is a great idea for a Util. I hope someone picks up the ball and runs with it.
 
This doesn't work for me - is it possible that I need (and I'm just grasping at straws here), some binaries for this .net business?
 
Yes, you need .NET Framework 1.0 or higher, which can be downloaded from Microsoft. .NET 2.0 can run the program as well (I think), but to be respectful to Darva's wishes for his program my advice would be to use 1.0.
 
Ah - I've got it working now. A really great program - the one problem is it does not have a field for the Description, so I have to manually add it. Other than that - love it.
 
Dang. Did this one get discontinued?
 
I was wondering the same thing, so I grabbed the source code that he was nice enough to provide. My VB is a bit rusty but I'll take a look at see what I can do or if it would be easier for me to just start over.
 
Oh, I see what you thought.

Unfortunately, I have no ability with coding, and I haven't done any modification on this program. All I've done is download the .Net framework so I can run the program in the first post.
 
This thingy has a funny bug. It's absolutly impossible to add a technology named TECH_PHILOSOPHY. Sokrates wouldn't like this:lol:
Otherwise still helpful sometimes but really somebody should develope it further, pretty please!

Edit: I found a work around if I call tech_Philosophy tech_Gelaber which means something like nonsense talk in german it named it Philosophy correctly after reload and furthermore doesn't cause any problems afterwards with that. Seems this program just waited for some kind of statement first:rotfl:

Don't know if anyone can reproduce this effect but it certainly amused me:D

Edit: haha forget about was my error(of course), I think it's simply too late
 
Back
Top Bottom