hello people of code project i have the following code.

Code:
 private String header;
        private Dictionary<String, String> tokens;
        
        public DevExpress.XtraEditors.TextEdit txtDisplayName;
        public DevExpress.XtraEditors.ListBoxControl lstwep;
        public DevExpress.XtraEditors.SimpleButton elfenliedbutton;
        public DevExpress.XtraEditors.TextEdit txtmaxammo;
        public LauncherForm elfform;
        private String file;



        public Parser(String file, DevExpress.XtraEditors.ListBoxControl lstelfen, LauncherForm elfform1)
        {
            elfform = elfform1;
            lstwep = lstelfen;

            this.file = file;
            String plainText;
            using (StreamReader sr = new StreamReader(file))
            {
                plainText = sr.ReadToEnd();
            }

            String[] tokens = plainText.Split('\\');
            this.tokens = new Dictionary<string, string>(tokens.Length + 10);

            header = tokens[0];
            for (int i = 1; i < tokens.Length; i += 2)
            {
                String key = tokens[i];
                String val = (i + 1 <= tokens.Length) ? tokens[i + 1] : "";

                this.tokens.Add(key, val);
            }

           
        }

        public String Search(String name)
        {
            foreach (KeyValuePair<String, String> pair in tokens)
            {
                if (pair.Key == name)
                    return pair.Value;
            }

            return null;
        }

        public void Set(String key, String val)
        {
            tokens[key] = val;
        }

        public void Save(String file)
        {
            using (StreamWriter sw = new StreamWriter(File.OpenWrite(file)))
            {
                sw.Write(header);
                foreach (KeyValuePair<String, String> pair in tokens)
                {
                    sw.Write("\\" + pair.Key + "\\" + pair.Value);
                }
            }
        }

        public void Save()
        {
            this.Save(file);
        }

    }
what i want to do is generate a list box with all weapon files in a mod and when one is selected it will execute the parse code

here is a little muck up i made in gui to explain better what i mean

Attachment 34413

as you can see form below code i can get the file to parse but i want to load all the weapon file names form directory and list them all in the listbox then when i select a name it will load the weapon file into selected boxes

but im not sure how to do this i managed to get it to work with push of a button but i cant seem to get it to list weapon files into the listbox and then on a select it will run the code to load the selected weapon file and then display its values to text box then save it out. and here is the one example weapon file so its easy to understand what im trying to do.

https://mega.nz/#!R0xjDQLD!11Lwjcs8U...heoyrndmBlH75U

so form example weapon file for example displayName/weaponname/ thats how they are layied out

thank you in advance elfenliedtopfan5