Jump to content

Gwendalin

Members
  • Content Count

    89
  • Donations

    $0.00 
  • Joined

  • Last visited

  • Days Won

    2

Gwendalin last won the day on May 18

Gwendalin had the most liked content!

2 Followers

Profile Information

  • Gender
    Female
  • Location
    In the back of your mind whispering dirty things

Recent Profile Visitors

1,765 profile views
  1. This is where eggnog comes from! Don't listen to Marshy's lies! Panda I think i have new found love for you... Pumpkin spice is vile too!
  2. So this time I secretly stalked Crest at one of his festivals he was going to a while back. Embedded Video Link I present to you all Crest in the wild!
  3. It's been a while... enjoy this scary trip to the 80's.
  4. Gwendalin

    XML help

    I finally got it working!!! Well at least 98% working I need to work on how it renames my clones. Right now i add the parent name to the clone followed by the version, but that is not correct for some clones that truly do have a different name, so now it shows as a misname. BUT the actual function of the program is working. I also got my filter working so it will not display any of the checked items. I'm so excited... i haven't programmed anything in a really long time, and even then i never completed my programs. This is my first actual working program!!! Here is a screen shot of it. The red box means that I'm missing that rom... If it is a clone i display the parent so i know where to find the game to add it. If i dont have any info in the Mame fields that means that Mame removed the rom, or changed the name of the rom, and i need to remove it from my front end. All i have to do is fix my names, and maybe get creative and clean up some of the interface, have the cells be the correct size for what is displayed, or add some options like change the color of the highlighted cells. Im really excited because I actually figured out how to read two different XML files and compare the data when they are so different. This is what a game and clone looks like in my front end xml. A clone is considered an additional application. This is what a game and clone looks like in mame. The clone looks like the parent, but it has an extra attirbute. if anyone is interested here is my code. YES it is very ugly, and not optimized, but maybe i can get cleaned up later.
  5. Gwendalin

    XML help

    i tried this, and it was randomly changing the text to green. i would mess with the [4,2] values, and nothing would change so i was getting discouraged. this.dgMissingSystems[4, 2].Style.ForeColor = Color.ForestGreen; so far this worked, and i was able to change cell numbers and it worked. Now to get it to pull the cell numbers dynamically. I think i can get it. i do have to start with 0 to get the first cell. this.dgMissingSystems[1, 1].Style.BackColor = System.Drawing.Color.Red;  Ok... i think i was just getting tunnel vision, and because my forecolor worked once i kind of stopped paying attention during my testing. The reason it wasn't showing was because there was no text to change. oh i also had this... so i was dancing around the answer... this.dgMissingSystems.Rows[dgMissingSystems.Rows.Count].Cells[1].Style.BackColor = Color.Red; Ok i got it semi working now.... Now my problem is it is only keeping one cell highlighted. I know another cell should be red, but only one is. not sure whats going on... the yellow box, and one above it should be red as well. Nevermind... i'm a ditz, and had my numbers backwards! i think its working now! Thanks Marsh!
  6. Gwendalin

    XML help

    I got farther... but now I'm starting to hit the wall. I got my data displaying from both xml files. If i have data showing in one column but not the other that means it is either missing or named wrong. I want to make it more clear by marking the wrong cell, but i cant figure out how to change a single cell's background. I have tried many different options. Also I'm trying to break up the program into functions, but i have trouble with scope. For instance I got my filter to work. It checks one xml document and gets the genre of the game, and blocks it from populating. I'm trying to make a global xml variable so i only have to load it once, but i can't get it to be read in any other section of the code. i'm going to keep working at it... I'll be more detailed if i need help. Anyways here is what the program looks like so far. Its ugly, but it is mostly working. The Mame columns are reading from my mame.xml, and the LB columns are reading from my lB.xml. if there is a rom in Mame but not in LB it will have a blank field. If the name is different in LB from Mame it will list both roms names, and i will need to update my LB frontend. If there is a field empty in the mame columns that means that it is an old entry and needs to be deleted from the front end. Here is my code so far... its messy i know. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Xml.Linq; using System.Text.RegularExpressions; namespace Mame_Check { public partial class Form1 : Form { Dictionary<string, Machines> dictMame = new Dictionary<string, Machines>(); Dictionary<string, Machines> dictLB = new Dictionary<string, Machines>(); public Form1() { InitializeComponent(); btnSearch.Enabled = false; //if (btnSearch.Enabled == true) { LoadXml(); } } private void LoadXml() { XElement mameXML = XElement.Load(tbMamexml.Text); XElement launchboxXML = XElement.Load(tbLBXML.Text); IEnumerable<XElement> mame = mameXML.Elements(); IEnumerable<XElement> lb = launchboxXML.Elements(); //Read LaunchBox XML foreach (var lbSystem in lb) { try { Machines machine = new Machines(); machine.Name = lbSystem.Element("Title").Value + " " + lbSystem.Element("Version").Value; machine.Rom = System.IO.Path.GetFileNameWithoutExtension(lbSystem.Element("ApplicationPath").Value); machine.Genre = lbSystem.Element("Genre").Value; var clones = from nm in launchboxXML.Elements("AdditionalApplication") where (string)nm.Element("GameID") == lbSystem.Element("ID").Value select nm; if (machine.CloneOf == null && this.clbFIlter.CheckedItems.Contains(machine.Genre) == false) { dictLB.Add(machine.Rom, machine); } foreach (var clone in clones) { Machines cmachine = new Machines(); cmachine.Name = lbSystem.Element("Title").Value + " " + clone.Element("Name").Value; cmachine.Rom = System.IO.Path.GetFileNameWithoutExtension(clone.Element("ApplicationPath").Value); cmachine.Name = Regex.Replace(cmachine.Name, @"Play ", ""); cmachine.Name = Regex.Replace(cmachine.Name, @" Version...", ""); cmachine.CloneOf = machine.Name; cmachine.Genre = machine.Genre; if (this.clbFIlter.CheckedItems.Contains(cmachine.Genre) == false) { dictLB.Add(cmachine.Rom, cmachine); } } } catch { } } //Read Mame XML foreach (var mSystem in mame) { try { Machines machine = new Machines(); machine.Name = mSystem.Element("description").Value; machine.Rom = mSystem.Attribute("name").Value; //Clones if (null != mSystem.Attribute("cloneof") && this.clbFIlter.CheckedItems.Contains(machine.Genre) == false) { machine.CloneOf = mSystem.Attribute("cloneof").Value; } if (this.clbFIlter.CheckedItems.Contains(machine.Genre) == false) { dictMame.Add(machine.Rom, machine); } } catch { } } } private void LoadListBox() { XElement launchboxXML = XElement.Load(tbLBXML.Text); IEnumerable<XElement> lb = launchboxXML.Elements(); //Load listcheck box foreach (var lbSystem in lb) { try { string genre; genre = lbSystem.Element("Genre").Value; if (this.clbFIlter.Items.Contains(genre) != true) { this.clbFIlter.Items.Add(genre); } } catch { } } } private void BtnSearch_Click(object sender, EventArgs e) { LoadXml(); //Check Mame systems foreach (KeyValuePair<string, Machines> item in dictMame) { string key = item.Key; try { //If system is a parent if (item.Value.CloneOf == null) { //If parent is in Mame, but not in LaunchBox if (dictLB.ContainsKey(key) != true) { //this.dgMissingSystems.Rows[dgMissingSystems.Rows.Count].Cells[1].Style.BackColor = Color.Red; this.dgMissingSystems.Rows.Add(item.Value.Name, item.Value.Rom, "", "", "", "", "", ""); } else { //Parent is Named differently than in LaunchBox if (item.Value.Name != dictLB[key].Name) { this.dgMissingSystems.Rows.Add(item.Value.Name, item.Value.Rom, "", "", dictLB[key].Name, dictLB[key].Rom, "", ""); } } } else //If system is a clone { //If clone is in Mame, but not in LaunchBox if (dictLB.ContainsKey(item.Key) != true) { this.dgMissingSystems.Rows.Add(item.Value.CloneOf, "", item.Value.Name, item.Value.Rom, "", "", "", ""); } else { //If clone is Named differently than in LaunchBox if (item.Value.Name != dictLB[key].Name) { this.dgMissingSystems.Rows.Add(item.Value.CloneOf, "", item.Value.Name, item.Value.Rom, dictLB[key].CloneOf, "", dictLB[key].Name, dictLB[key].Rom); } } //dgMissingSystems[4, 2].Style.ForeColor = Color.ForestGreen; } } catch { } } //check LaunchBox systems foreach (KeyValuePair<string, Machines> item in dictLB) { try { //If system is a parent if (item.Value.CloneOf == null) { //If parent is in LaunchBox, but not Mame if (dictMame.ContainsKey(item.Key) != true) { this.dgMissingSystems.Rows.Add("", "", "", "", item.Value.Name, item.Value.Rom, "", ""); } } else //If system is a clone { //If clone is in LaunchBox, but not in Mame if (dictMame.ContainsKey(item.Key) != true) { this.dgMissingSystems.Rows.Add("", "", "", "", item.Value.CloneOf, "", item.Value.Name, item.Value.Rom); } } } catch { } } } private void BtnMameBrowse_Click(object sender, EventArgs e) { DialogResult result = openFileDialogMame.ShowDialog(); if (result == DialogResult.OK) { tbMamexml.Text = openFileDialogMame.FileName; if (tbMamexml.Text != "" && tbLBXML.Text != "") { btnSearch.Enabled = true; } } } private void BtnLBBrowse_Click(object sender, EventArgs e) { DialogResult result = openFileDialogLB.ShowDialog(); if (result == DialogResult.OK) { tbLBXML.Text = openFileDialogLB.FileName; LoadListBox(); if (tbMamexml.Text != "" && tbLBXML.Text != "") { btnSearch.Enabled = true; } } } } }
  7. Gwendalin

    XML help

    WOO HOOO I'm getting there... this is all populated on its own from reading my xml file. Now i just have to compare the data to the other xml file, and have it display only the info that is different or missing. I'm excited... i have not programed anything in a really long time! Thanks Phenom, and Marsh for your guidance!
  8. Gwendalin

    XML help

    Ok here is another upate to hopefully show what i'm trying to do. Mame lists out all of its games files, and a bunch of stuff i dont care about in an XML file. My frontend Launchbox stores all of its info in an xml file as well but does not have the same information tags so i can't do a straight comparison. I want to be able to see what i have in my front end compared to that mame has. I am able to go through both xml files and pull the data i need from each, as an individual variable. Now i need to store them in an array or list or something so i can go through and compare the individual files, and then display what is different or missing. i need to get my individual data into this data grid after sorting, but i'm not sure the best way to store the individual data first. i just typed this data in for an example... right now the button is the only thing working, and it just reads the xml files, and shows a message box of the individual variable.
  9. Gwendalin

    XML help

    Ok everything is working properly at least from my xml side. Now i'm just not sure how to list everything in one big list. XElement root = XElement.Load(@"C:\source\repos\WindowsFormsApp1\WindowsFormsApp1\test.xml"); IEnumerable < XElement > games = root.Elements(); foreach (var game in games) { try { string pName = game.Element("Title").Value + " " + game.Element("Version").Value; string pRom = System.IO.Path.GetFileNameWithoutExtension(game.Element("ApplicationPath").Value); var clones = from nm in root.Elements("AdditionalApplication") where (string)nm.Element("GameID") == game.Element("ID").Value select nm; if (clones.Any() == false) { MessageBox.Show("Parent: " + pName + " Rom: " + pRom); } try { foreach (var clone in clones) { string cName = clone.Element("Name").Value; string cRom = System.IO.Path.GetFileNameWithoutExtension(clone.Element("ApplicationPath").Value); cName = Regex.Replace(cName, @"Play ", ""); cName = Regex.Replace(cName, @" Version...", ""); MessageBox.Show("Parent: " + pName + " Rom: " + pRom + "\n" + "Clone: " + cName + " Rom: " + cRom); } } catch { } } catch { }
  10. Gwendalin

    XML help

    What i'm trying to do is make a program that will let me know what i'm missing from my front end when I update Mame. The front end is not reliable when importing new roms so i have to do it manually, and since Mame changes things frequently it is a pain. there is not always a parent - clone relationship. sometimes it will be just a parent. Sometimes the parent can have multiple clones or just one clone. I want my program to basically look like this... but i'm going to have it only display what is different in my lists. As you can see there are different amounts of clones (they call them orphans), and not all have clones (above the first parent). This is what i have so far, and it is showing correct data, but i have to step through it each time. I'm just not sure how to get all the individual data listed at the same time. XElement root = XElement.Load(@"C:\source\repos\WindowsFormsApp1\WindowsFormsApp1\test.xml"); IEnumerable < XElement > games = root.Elements(); foreach (var game in games) { try { string pName = game.Element("Title").Value + " " + game.Element("Version").Value; string pRom = System.IO.Path.GetFileNameWithoutExtension(game.Element("ApplicationPath").Value); var clone = from nm in root.Elements("AdditionalApplication") where (string)nm.Element("GameID") == game.Element("ID").Value select nm; MessageBox.Show("Parent: " + pName + " Rom: " + pRom); try { foreach (var game2 in clone) { string cName = game2.Element("Name").Value; string cRom = System.IO.Path.GetFileNameWithoutExtension(game2.Element("ApplicationPath").Value); MessageBox.Show("Parent: " + pName + " Rom: " + pRom + "\n" + " " + "Clone: " + cName + " Rom: " + cRom); } } catch { } }
  11. Gwendalin

    XML help

    I figured out how to read the xml and pull the data i need. Now i'm not sure the best way to display it. What should i use to feed my data into to display it? This is what i'm looking to do. Should i load everything into a list... dataset...something else? parent name | version | file name clone name | version | file name parent name | version | file name etc....
  12. Is anyone good at XML and C#? Would anyone be able to help or create a program to read and compare xml documents?
  13. Gwen! How have you been?

    1. Show previous comments  1 more
    2. The Crzy Doctor

      The Crzy Doctor

      Got laid off back in september.... Back at the liquor store... So im doing awesome... :31_neutral_face:

       

      Other than that doing alright. Had to move back into the parents house for the time being till i get some debt knocked down.

    3. Gwendalin

      Gwendalin

      Aww I'm sorry to hear that Crzy... :61_sob:. thankfully you were able to go back to the liquor store, and somewhat like that place. I'm sure things will work out for you soon! ;)

       

      Hopefully living with your parents is going ok. Sometimes i wish I could move back in, and get my debt down, but then i think about living with them, and I'm like... nope I'm ok.

    4. The Crzy Doctor

      The Crzy Doctor

      Yea im not really getting my debt down... Its more of me saying i am but not really being able to do it lol

×
×
  • Create New...