コード例 #1
0
        public bool LoadConfig()
        {
            OpenConfigDialog OCD = new OpenConfigDialog(Settings);
            if (OCD.ShowDialog() == DialogResult.OK)
            {
                if (Pinball != null)
                {
                    Pinball.Finish();
                }


                Pinball = new Pinball();
                Pinball.Setup(OCD.GlobalConfigFilename, OCD.TableFilename, OCD.RomName);
                Pinball.Init();
                DisplayTableElements();


                return true;
            }
            else
            {

                return false;
            }
        }
コード例 #2
0
ファイル: Plugin.cs プロジェクト: wimkuijp/DirectOutput
        /// <summary>
        /// Initializes the Plugin.<br/>
        /// The IDirectPlugin interface requires the implementation of this method.<br/>
        /// </summary>
        /// <param name="TableFilename">The table filename.</param>
        /// <param name="RomName">Name of the rom.</param>
        public void PluginInit(string TableFilename, string RomName)
        {
            //Check config dir for global config file
            FileInfo F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_B2SServer.xml"));

            if (!F.Exists)
            {
                //Check if a shortcut to the config dir exists
                FileInfo LnkFile = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_B2SServer.lnk"));
                if (LnkFile.Exists)
                {
                    string ConfigDirPath = ResolveShortcut(LnkFile);
                    if (Directory.Exists(ConfigDirPath))
                    {
                        F = new FileInfo(Path.Combine(ConfigDirPath, "GlobalConfig_B2SServer.xml"));
                    }
                }
                if (!F.Exists)
                {
                    //Check table dir for global config file
                    F = new FileInfo("GlobalConfig_B2SServer.xml");
                    if (!F.Exists)
                    {
                        //Check dll dir for global config file
                        F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "GlobalConfig_B2SServer.xml"));
                        if (!F.Exists)
                        {
                            //if global config file does not exist, set filename to config directory.
                            F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_B2SServer.xml"));
                        }
                    }
                }
            }

            Pinball.Setup(F.FullName, TableFilename, RomName);
            Pinball.Init();

            // PluginShowFrontend();
        }