Ejemplo n.º 1
0
        protected virtual void parse(XmlNode root, ref Configuration config)
        {
            foreach (XmlNode node in root.ChildNodes)
            {
                if (node.Name == "Directory")
                {
                    config.rootDirectory = new System.IO.DirectoryInfo(node.InnerText);
                }
                else if (node.Name == "GameDirectory")
                {
                    try
                    {
                        DirectoryInfo dir;
                        if (Directory.Exists(node.InnerText))
                        {
                            dir = new DirectoryInfo(node.InnerText);
                        }
                        else
                        {
                            dir = new DirectoryInfo(config.rootDirectory.FullName + "\\" + node.InnerText);
                        }
                        config.gameDirectories.Add(dir);
                    }
                    catch (NotSupportedException ex)
                    {
                    }

                }
            }
        }
Ejemplo n.º 2
0
        public override void initialize(Configuration config)
        {
            if (!(config is ZSNESConfiguration))
            {
                throw new ArgumentException("Configuration must be of type ZSNESConfiguration");
            }

            base.initialize(config);
        }
Ejemplo n.º 3
0
 protected override void parse(System.Xml.XmlNode root, ref Configuration config)
 {
     base.parse(root, ref config);
 }
Ejemplo n.º 4
0
        public virtual void initialize(Configuration config)
        {
            mConfiguration = config;
            mRootDir = config.rootDirectory;

            mOutputReader = new BackgroundWorker();
            mOutputReader.DoWork += readProcessOutput;

            if (mRootDir.Exists)
            {
                mExecutableFile = locateExecutable();
                mRomDirs = locateRomDirs();

                mGames.Clear();

                foreach (DirectoryInfo dir in mRomDirs)
                {
                    foreach (Game game in locateGames(dir))
                    {
                        mGames.Add(game);
                    }
                }
            }
        }