Interaktionslogik für Standard.xaml
상속: IObserver, IPluginHost
예제 #1
0
 public LoadingTitle(Standard w1,IPlaylist aPlaylist)
 {
     Owner = w1;
     InitializeComponent();
     _main = w1;
     _aPlaylist = aPlaylist;
 }
예제 #2
0
파일: App.xaml.cs 프로젝트: mhack/gamenoise
        /// <summary>
        /// Constructor for Main Window
        /// </summary>
        public App()
        {
            SplashScreen sp = new SplashScreen("pictures/splashscreen2.png");
            sp.Show(true);

            try
            {
                //Initialising Classes
                GameNoiseList aPlaylist = new GameNoiseList();
                Configuration aConfiguration = LoadSettings();
                PluginManager.PluginManager aPluginManager = new PluginManager.PluginManager();

                //Load Language
                Thread.CurrentThread.CurrentCulture = new CultureInfo(aConfiguration.Language);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(aConfiguration.Language);

                aStandard = new Standard(this, aConfiguration, aPluginManager);
                Ingame aIngame;

                try
                {
                    aIngame = new Ingame(aConfiguration, this);
                }
                catch (Exception)
                {
                    aIngame = null;
                }

                //Get Window Handler and initialize BASS
                Interfaces.IBassWrapper aBassWrapper = new BassWrapper(new WindowInteropHelper(aStandard).Handle);

                //Setting references in aStandard
                aStandard.ABassWrapperGui = (Interfaces.IBassWrapperGui)aBassWrapper;

                //Setting references in aPlayControler
                PlayControler aPlayControler = new PlayControler(aConfiguration.PathTmpEqualizer);
                aStandard.APlayControler = aPlayControler;
                aPlayControler.TmpPlaylist = aPlaylist;
                aPlayControler.ABassWrapper = aBassWrapper;
                aBassWrapper.aPlayControler = aPlayControler;
                aBassWrapper.aPluginManager = aPluginManager;

                aStandard.APlaylist = aPlaylist;
                aStandard.AIngame = aIngame;
                aStandard.LoadHotKeys();

                aPlaylist.AddObserver(aStandard);
                aBassWrapper.AddObserver(aStandard);
                aConfiguration.AddObserver(aStandard);
                aPlayControler.AddObserver(aStandard);

                //Ingame references
                if (aIngame != null)
                {
                    aPlaylist.AddObserver(aIngame);
                    aBassWrapper.AddObserver(aIngame);
                    aConfiguration.AddObserver(aIngame);
                }

                //Setting references in GameNoiseList
                aPlaylist.ABassWrapperOrganisation = (Interfaces.IBassWrapperOrganisation)aBassWrapper;
                aPlaylist.APluginManager = aPluginManager;

                //Show Standard GUI
                aStandard.Show();
                aConfiguration.InitNotify();
            }
            catch (FileNotFoundException e)
            {
                new Error("File: " + e.FileName + " not found!", true,aStandard);
            }
            catch (System.Runtime.Serialization.SerializationException e)
            {
                new Error("Equalizer Settings File is courrupt: " + e.Message, false, aStandard);
            }
            catch (BassWrapperException e)
            {
                new Error(e.GetMessage(), false, aStandard);
            }
            catch (DllNotFoundException e)
            {
                new Error(e.Message, true, aStandard);
            }
            catch (NotSupportedException)
            {}
            catch (ArgumentNullException)
            {}
            catch(ArgumentException)
            {}
        }