コード例 #1
0
ファイル: Program.cs プロジェクト: skorpioniche/Iplayer
        private static void Main()
        {
            if (InstanceExists())
                return;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(true);

            // TODO: Resolve factory as a depenedency by means of some DI solution.
            DefaultFactory Factory = new DefaultFactory();

            try
            {
                PlayerCore Core = new PlayerCore(Factory);

                MainForm MainForm = new MainForm(Core)
                                        {
                                            Icon = Resource.HOLO
                                        };
                Core.SetView(MainForm);

                Application.Run(MainForm);

                Core.SaveDatabase();
            }
            catch (Exception E)
            {
                Logger.FatalException("Unhandled exception at the top level.", E);

                MessageBox.Show(E.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
 public static void InicializationCore()
 {
     var factory = new DefaultFactory();
     core = new PlayerCore(factory);
     core.SaveDatabase();
     Scaning();
     StartCalculeteProcessor();
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: skorpioniche/Iplayer
        public MainForm(PlayerCore core)
        {
            if (core == null)
            {
                throw new ArgumentNullException("core");
            }

            Core = core;

            InitializeComponent();

            tmProcessing = new System.Timers.Timer(1000);
            tmProcessing.Elapsed += tmProcessing_Elapsed;
            tmProcessing.Start();
        }