Beispiel #1
0
 public override void OnApplicationStart(HmeApplicationStartArgs e)
 {
     e.Application.Root              = new View();
     _fontView                       = new FontView();
     e.Application.TextStyleCreated += _fontView.application_TextStyleCreated;
     e.Application.Root.Children.Add(_fontView);
 }
Beispiel #2
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            e.Application.ApplicationParametersReceived += new EventHandler <ApplicationParametersReceivedArgs>(Application_ApplicationParametersReceived);
            e.Application.KeyPress += new EventHandler <KeyEventArgs>(Application_KeyPress);
            e.Application.ApplicationErrorOccurred += new EventHandler <ApplicationErrorArgs>(Application_ApplicationErrorOccurred);

            _root = e.Application.Root;

            int x = SafetyViewMargin.HorizontalActionMargin;
            int w = _root.Bounds.Width - 2 * x;

            _titleView        = new TextView("HME Transition Test", DefaultRegular30, Color.White);
            _titleView.Bounds = new Rectangle(x, SafetyViewMargin.VerticalActionMargin, w, 40);
            _root.Children.Add(_titleView);

            _depthView        = new TextView(string.Empty, DefaultRegular20, Color.White);
            _depthView.Bounds = new Rectangle(x, 70, w, 40);
            _root.Children.Add(_depthView);

            _entryView        = new TextView(string.Empty, DefaultRegular20, Color.White);
            _entryView.Bounds = new Rectangle(x, 100, w / 2 - 10, 40);
            _root.Children.Add(_entryView);

            _returnView        = new TextView(string.Empty, DefaultRegular20, Color.White);
            _returnView.Bounds = new Rectangle(x + w / 2 + 20, 100, w / 2 - 10, 40);
            _root.Children.Add(_returnView);

            _colorView        = new TextView(string.Empty, DefaultRegular20, Color.White);
            _colorView.Bounds = new Rectangle(x, 130, w, 40);
            _root.Children.Add(_colorView);

            _hilightView        = new ColorView(Color.White);
            _hilightView.Bounds = new Rectangle(0, 0, 0, 0);
            _root.Children.Add(_hilightView);
            UpdateHilight(e.Application);

            _colorViews = new View[colors.Length];
            for (int i = 0; i < colors.Length; ++i)
            {
                x = SafetyViewMargin.HorizontalActionMargin + 80;
                w = _root.Bounds.Width - 2 * x;
                int y = 180 + i * 50;
                int h = 40;
                _colorViews[i]        = new ColorView(colors[i]);
                _colorViews[i].Bounds = new Rectangle(x, y, w, h);
                _root.Children.Add(_colorViews[i]);
            }

            _hintsView = new TextView("Move up and down to select a color.  " +
                                      "Move left to go back, right to go forward.",
                                      DefaultRegular14, Color.White);
            _hintsView.Bounds = new Rectangle(x, 400, w, 40);
            _root.Children.Add(_hintsView);

            _errorView        = new TextView(string.Empty, DefaultRegular18, Color.Red);
            _errorView.Bounds = new Rectangle(x, 440, w, 40);
            _root.Children.Add(_errorView);
        }
Beispiel #3
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            View root = new View();

            _mandel        = new Mandel();
            _mandel.Margin = SafetyViewMargin.TitleMargin;
            root.Children.Add(_mandel);
            e.Application.Root      = root;
            e.Application.KeyPress += new EventHandler <KeyEventArgs>(application_KeyPress);
        }
Beispiel #4
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            _videoView         = new StreamedVideoView();
            e.Application.Root = _videoView;
            Uri uri = new Uri(BaseUri, "tivoStartup.mp4");

            _videoView.Play(uri, "video/mp4");
            e.Application.KeyPress             += new EventHandler <KeyEventArgs>(Application_KeyPress);
            e.Application.ResourceStateChanged += new EventHandler <ResourceStateChangedArgs>(Application_ResourceStateChanged);
        }
Beispiel #5
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            Application app = e.Application;

            app.KeyPress += new EventHandler <KeyEventArgs>(app_KeyPress);
            // get application responsive as quickly as possible
            // query disk usage once we have the host name
            app.DeviceConnected             += new EventHandler <DeviceConnectedArgs>(app_DeviceConnected);
            app.SupportedResolutionsChanged += new EventHandler <EventArgs>(app_SupportedResolutionsChanged);

            _waitingView = new WaitingView();
            app.Root.Children.Add(_waitingView);
        }
Beispiel #6
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            e.Application.Root = new View();
            _content           = new View();
            _content.Margin    = SafetyViewMargin.TitleMargin;
            e.Application.Root.Children.Add(_content);

            for (int i = 0; i < _sprites.Length; ++i)
            {
                _sprites[i] = new Sprite(i, e.Application,
                                         rand.Next(_content.Bounds.Width),
                                         rand.Next(_content.Bounds.Height),
                                         8 + rand.Next(64), 8 + rand.Next(64));
                _content.Children.Add(_sprites[i]);
            }
        }
Beispiel #7
0
        public HmeApplicationHandler CreateApplication(HmeConnection connection, string baseUri)
        {
            HmeApplicationHandler application = (HmeApplicationHandler)Activator.CreateInstance(_hmeApplicationHandler);

            // store copy associated to application so it can be used in closed event
            _applications.Add(connection.Application, application);
            connection.Application.Closed += new EventHandler <EventArgs>(Application_Closed);

            application.BaseUri = new Uri(baseUri);
            // start the application
            HmeApplicationStartArgs startArgs = new HmeApplicationStartArgs();

            startArgs.Application  = connection.Application;
            startArgs.HostServices = _services;
            application.OnApplicationStart(startArgs);
            return(application);
        }
Beispiel #8
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            _musicList                   = new MusicList(27);
            _musicList.Bounds            = new System.Drawing.Rectangle(64, 40, 640 - 64 * 2, 480 - 150);
            _musicList.SelectionChanged += new EventHandler <EventArgs>(_musicList_SelectionChanged);
            e.Application.Root.Children.Add(_musicList);
            _track        = new Track();
            _track.Bounds = new System.Drawing.Rectangle(64, _musicList.Bounds.Y + _musicList.Bounds.Height, 640 - 64 * 2, 60);
            e.Application.Root.Children.Add(_track);

            _musicList.AddRange(_fileNames);
            _musicList.Focus();

            _application                       = e.Application;
            _application.KeyPress             += new EventHandler <KeyEventArgs>(application_KeyPress);
            _application.ResourceStateChanged += new EventHandler <ResourceStateChangedArgs>(application_ResourceStateChanged);
        }
Beispiel #9
0
        protected override void OnApplicationConnected(HmeApplicationConnectedEventArgs args)
        {
            ApplicationT applicationT = new ApplicationT();

            // store copy associated to application so it can be used in closed event
            _applications.Add(args.Application, applicationT);
            args.Application.Closed += new EventHandler <EventArgs>(Application_Closed);
            // set the base uri for the application
            applicationT.BaseUri = args.BaseUri;
            // start the application
            HmeApplicationStartArgs startArgs = new HmeApplicationStartArgs();

            startArgs.Application  = args.Application;
            startArgs.HostServices = this;
            applicationT.OnApplicationStart(startArgs);

            base.OnApplicationConnected(args);
        }
Beispiel #10
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            _application = e.Application;
            View root = new View();

            root.Bounds = new Rectangle(0, 0, 640, 480);

            _foreground        = new ImageView(null, ImageLayout.BestFit);
            _foreground.Bounds = root.Bounds;
            _background        = new ImageView(null, ImageLayout.BestFit);
            _background.Bounds = root.Bounds;

            // add the background first because it is behind the foreground
            root.Children.Add(_background);
            root.Children.Add(_foreground);
            _application.Root = root;

            _timer = new Timer(DisplayNextImage, null, 0, ShowTime);
        }
Beispiel #11
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            e.Application.Root = new ColorView(Color.White);

            _timeViews = new TextView[2];

            TextStyle font = new TextStyle("default", FontStyle.Bold, 96);

            for (int i = 0; i < _timeViews.Length; ++i)
            {
                _timeViews[i]        = new TextView(string.Empty, font, Color.Black, TextLayout.HorizontalAlignCenter);
                _timeViews[i].Bounds = new Rectangle(0, 100, e.Application.Root.Bounds.Width, 280);
                e.Application.Root.Children.Add(_timeViews[i]);
            }

            app = e.Application;
            e.Application.KeyPress += new EventHandler <KeyEventArgs>(Application_KeyPress);

            _timer = new System.Threading.Timer(UpdateTime, null, 0, 1000);
        }
Beispiel #12
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            _app = e.Application;

            _app.Root = new ImageView(_app.GetImageResource("background"));

            _piecesView        = new View();
            _piecesView.Bounds = _app.Root.Bounds;
            _app.Root.Children.Add(_piecesView);

            _gridX = (_app.Root.Bounds.Width - 300) / 2;
            _gridY = 130;
            ImageView grid = new ImageView(_app.GetImageResource("grid"));

            grid.Bounds = new Rectangle(_gridX - 5, _gridY - 5, 310, 310);
            _app.Root.Children.Add(grid);

            _app.CreateTextStyle(_tokenStyle);

            _app.KeyPress += new EventHandler <KeyEventArgs>(_app_KeyPress);
        }
Beispiel #13
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            e.Application.Root = new ColorView(Color.White);

            _content        = new View();
            _content.Margin = SafetyViewMargin.TitleMargin;
            e.Application.Root.Children.Add(_content);

            TextStyle font = new TextStyle("default", System.Drawing.FontStyle.Regular, 17);

            _easeText        = new TextView("Ease (use left/right) : " + _ease, font, Color.Black, TextLayout.HorizontalAlignLeft);
            _easeText.Bounds = new Rectangle(300, 0, 190, 20);
            _content.Children.Add(_easeText);
            _timeText        = new TextView("Time (use up/down) : " + _animTime.TotalSeconds, font, Color.Black, TextLayout.HorizontalAlignLeft);
            _timeText.Bounds = new Rectangle(300, 20, 190, 20);
            _content.Children.Add(_timeText);

            _transparency     = new Square(0, 0, 90, 90, "Transparency", Color.Magenta);
            _visible          = new Square(100, 0, 90, 90, "Visible", Color.Magenta);
            _bounds           = new Square(300, 100, 90, 90, "Bounds", Color.Magenta);
            _translate        = new View();
            _translate.Bounds = new Rectangle(0, 100, 290, 90);
            _translate.Children.Add(new Square(-300, 0, 600, 90, Color.Green));
            _translate.Children.Add(new Square(0, 0, 90, 90, "Translate", Color.Magenta));
            _scale = new Square(0, 200, 90, 90, "Scale", Color.Magenta);
            _content.Children.Add(_transparency);
            _content.Children.Add(_visible);
            _content.Children.Add(_bounds);
            _content.Children.Add(_translate);
            _content.Children.Add(_scale);

            e.Application.KeyPress += new EventHandler <KeyEventArgs>(application_KeyPress);

            System.Threading.Thread animate = new System.Threading.Thread(Animate);
            animate.Start();
        }