예제 #1
0
파일: Region.cs 프로젝트: afrog33k/eAd
        public Region( StatLog statLog,  CacheManager cacheManager)
            : base(0, 0, 0, 0)
        {
            // Store the statLog
            _statLog = statLog;

            // Store the cache manager
            // TODO: What happens if the cachemanger changes during the lifecycle of this region?
            _cacheManager = cacheManager;

            //default options
            options.Width = 1024;
            options.Height = 768;
            options.Left = 0;
            options.Top = 0;
            options.Uri = null;

            this.Size = new Size(options.Width, options.Height);

            this.Location = new Point(options.Left, options.Top);



              this.Background = new SolidColorBrush(Colors.Red);

            if (Settings.Default.DoubleBuffering)
            {
                //   SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                //      SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            }

            // Create a new BlackList for us to use
            blackList = new BlackList();
        }
예제 #2
0
파일: Region.cs 프로젝트: afrog33k/eAd
        public Region(StatLog statLog, CacheManager cacheManager)
            : base(0, 0, 0, 0)
        {
            // Store the statLog
            _statLog = statLog;

            // Store the cache manager
            // TODO: What happens if the cachemanger changes during the lifecycle of this region?
            _cacheManager = cacheManager;

            //default options
            options.Width  = 1024;
            options.Height = 768;
            options.Left   = 0;
            options.Top    = 0;
            options.Uri    = null;

            this.Size = new Size(options.Width, options.Height);

            this.Location = new Point(options.Left, options.Top);



            this.Background = new SolidColorBrush(Colors.Red);

            if (Settings.Default.DoubleBuffering)
            {
                //   SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                //      SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            }

            // Create a new BlackList for us to use
            blackList = new BlackList();
        }
예제 #3
0
파일: Region.cs 프로젝트: afrog33k/eAd
 public Region(StatLog statLog, CacheManager cacheManager) : base(0, 0, 0, 0)
 {
     this.currentSequence = -1;
     this._statLog = statLog;
     this._cacheManager = cacheManager;
     this.options.Width = 0x400;
     this.options.Height = 0x300;
     this.options.Left = 0;
     this.options.Top = 0;
     this.options.Uri = null;
     this.Size = new System.Windows.Size((double) this.options.Width, (double) this.options.Height);
     this.Location = new Point((double) this.options.Left, (double) this.options.Top);
     base.Background = new SolidColorBrush(Colors.Transparent);
     bool doubleBuffering = Settings.Default.DoubleBuffering;
     this.blackList = new BlackList();
 }
예제 #4
0
        public Region(StatLog statLog, CacheManager cacheManager) : base(0, 0, 0, 0)
        {
            this.currentSequence = -1;
            this._statLog        = statLog;
            this._cacheManager   = cacheManager;
            this.options.Width   = 0x400;
            this.options.Height  = 0x300;
            this.options.Left    = 0;
            this.options.Top     = 0;
            this.options.Uri     = null;
            this.Size            = new System.Windows.Size((double)this.options.Width, (double)this.options.Height);
            this.Location        = new Point((double)this.options.Left, (double)this.options.Top);
            base.Background      = new SolidColorBrush(Colors.Transparent);
            bool doubleBuffering = Settings.Default.DoubleBuffering;

            this.blackList = new BlackList();
        }
예제 #5
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
            }

                );
        }
예제 #6
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}

                );

        }
예제 #7
0
    public ClientManager()
    {
        Instance = this;

        InitializeComponent();

        // Check the directories exist
        if (!Directory.Exists(Settings.Default.LibraryPath) || !Directory.Exists(Settings.Default.LibraryPath + @"\backgrounds\"))
        {
            // Will handle the create of everything here
            Directory.CreateDirectory(Settings.Default.LibraryPath + @"\backgrounds");
            Directory.CreateDirectory(Settings.Default.LibraryPath + @"\Layouts");
            Directory.CreateDirectory(Settings.Default.LibraryPath + @"\Uploads\Media");
        }

        // Create a cachemanager
        SetCacheManager();

        ShowSplashScreen();

        // Change the default Proxy class
        OptionForm.SetGlobalProxy();

        Closed += delegate
        {
            Closing();
            Environment.Exit(0);

        };

        MyCommand.InputGestures.Add(new KeyGesture(Key.Q, ModifierKeys.Control));

        CommandBindings.Add(new CommandBinding(MyCommand, MyCommandExecuted));

        InitializeComponent();

        Switcher.ClientManager = this;


        Switcher.Switch(AdvertPlayer.Instance);

      var customerPage=  CustomerPage.Instance;

      // Setup the proxy information
      OptionForm.SetGlobalProxy();

      _statLog = new StatLog();

        this.StartKeepAliveThread();

        this.StartMessageReceiveThread();

        try
        {
            // Create the Schedule
            _schedule = new Schedule(App.UserAppDataPath + "\\" + Settings.Default.ScheduleFile, ClientManager.Instance.CacheManager);

            // Bind to the schedule change event - notifys of changes to the schedule
            _schedule.ScheduleChangeEvent += ScheduleScheduleChangeEvent;

            // Initialize the other schedule components
            _schedule.InitializeComponents();
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.Message, LogType.Error.ToString());
            MessageBox.Show("Fatal Error initialising AdvertPlayer", "Fatal Error");

            Environment.Exit(0);
        }

    }