Exemple #1
0
        public ClientManager()
        {
            //      RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;

            //Listeners

            TextWriterTraceListener[] listeners = new TextWriterTraceListener[]
            {
                new TextWriterTraceListener("log.txt"),
                new TextWriterTraceListener(Console.Out),
            };


            Debug.Listeners.AddRange(listeners);

            EventHandler handler = null;

            this._schedulerTimer    = new System.Timers.Timer();
            this.ScheduleChangeLock = new object();
            Instance = this;
            this.InitializeComponent();
            if (!Directory.Exists(Settings.Default.LibraryPath) ||
                !Directory.Exists(Settings.Default.LibraryPath + @"\backgrounds\"))
            {
                Directory.CreateDirectory(Settings.Default.LibraryPath + @"\backgrounds");
                Directory.CreateDirectory(Settings.Default.LibraryPath + @"\Layouts");
                Directory.CreateDirectory(Settings.Default.LibraryPath + @"\Uploads\Media");
            }
            this.SetCacheManager();
            this.ShowSplashScreen();
            OptionForm.SetGlobalProxy();
            if (handler == null)
            {
                handler = new EventHandler((y, t) =>
                {
                    this.Closing();
                    Environment.Exit(0);
                });
            }
            base.Closed += handler;
            MyCommand.InputGestures.Add(new KeyGesture(Key.Q, ModifierKeys.Control));
            base.CommandBindings.Add(new CommandBinding(MyCommand,
                                                        new ExecutedRoutedEventHandler(this.MyCommandExecuted)));
            this.InitializeComponent();
            Switcher.ClientManager = this;
            OptionForm.SetGlobalProxy();
            this._statLog = new ClientApp.Core.StatLog();

            Switcher.Switch(AdvertPlayer.Instance);
            this.StartMessageReceiveThread();
            try
            {
                this._schedule = new ClientApp.Schedule(App.UserAppDataPath + @"\" + Settings.Default.ScheduleFile,
                                                        Instance.CacheManager);
                this._schedule.ScheduleChangeEvent +=
                    new ClientApp.Schedule.ScheduleChangeDelegate(this.ScheduleScheduleChangeEvent);
                this._schedule.InitializeComponents();
            }
            catch (Exception)
            {
                MessageBox.Show("Fatal Error initialising eAd", "Fatal Error");
                Environment.Exit(0);
            }


            Charging       instance = Charging.Instance;
            LoadingProfile profile1 = LoadingProfile.Instance;


            //Todo: Make this an option ... Lower fps of  app
            Timeline.DesiredFrameRateProperty.OverrideMetadata(

                typeof(Timeline),

                new FrameworkPropertyMetadata {
                DefaultValue = 20
            }

                );
        }
Exemple #2
0
        public ClientManager()
        {
            //      RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; 

            //Listeners 

            TextWriterTraceListener[] listeners = new TextWriterTraceListener[]
                                                      {
                                                          new TextWriterTraceListener("log.txt"),
                                                          new TextWriterTraceListener(Console.Out),
                                                      };


            Debug.Listeners.AddRange(listeners);

            EventHandler handler = null;
            this._schedulerTimer = new System.Timers.Timer();
            this.ScheduleChangeLock = new object();
            Instance = this;
            this.InitializeComponent();
            if (!Directory.Exists(Settings.Default.LibraryPath) ||
                !Directory.Exists(Settings.Default.LibraryPath + @"\backgrounds\"))
            {
                Directory.CreateDirectory(Settings.Default.LibraryPath + @"\backgrounds");
                Directory.CreateDirectory(Settings.Default.LibraryPath + @"\Layouts");
                Directory.CreateDirectory(Settings.Default.LibraryPath + @"\Uploads\Media");
            }
            this.SetCacheManager();
            this.ShowSplashScreen();
            OptionForm.SetGlobalProxy();
            if (handler == null)
            {
                handler = new EventHandler((y, t) =>
                                               {
                                                   this.Closing();
                                                   Environment.Exit(0);
                                               });
            }
            base.Closed += handler;
            MyCommand.InputGestures.Add(new KeyGesture(Key.Q, ModifierKeys.Control));
            base.CommandBindings.Add(new CommandBinding(MyCommand,
                                                        new ExecutedRoutedEventHandler(this.MyCommandExecuted)));
            this.InitializeComponent();
            Switcher.ClientManager = this;
            OptionForm.SetGlobalProxy();
            this._statLog = new ClientApp.Core.StatLog();

            Switcher.Switch(AdvertPlayer.Instance);
            this.StartMessageReceiveThread();
            try
            {
                this._schedule = new ClientApp.Schedule(App.UserAppDataPath + @"\" + Settings.Default.ScheduleFile,
                                                        Instance.CacheManager);
                this._schedule.ScheduleChangeEvent +=
                    new ClientApp.Schedule.ScheduleChangeDelegate(this.ScheduleScheduleChangeEvent);
                this._schedule.InitializeComponents();
            }
            catch (Exception)
            {
                MessageBox.Show("Fatal Error initialising eAd", "Fatal Error");
                Environment.Exit(0);
            }


            Charging instance = Charging.Instance;
            LoadingProfile profile1 = LoadingProfile.Instance;


            //Todo: Make this an option ... Lower fps of  app
            Timeline.DesiredFrameRateProperty.OverrideMetadata(

                typeof (Timeline),

                new FrameworkPropertyMetadata {DefaultValue = 20}

                );

        }