Exemple #1
0
		void Check (SilverlightHost host)
		{
			Assert.AreEqual (Colors.White, host.Background, "Background");
			Assert.IsNotNull (host.Content, "Content");
			Assert.IsTrue (host.IsLoaded, "IsLoaded");
			Assert.AreEqual (String.Empty, host.NavigationState, "NavigationState");
			Assert.IsNotNull (host.Settings, "Settings");
			Assert.IsTrue (host.Source.AbsoluteUri.EndsWith ("moon-unit.xap"), "Source");
		}
Exemple #2
0
		void Check (SilverlightHost host)
		{
			Assert.AreEqual (Colors.White, host.Background, "Background");
			Assert.IsNotNull (host.Content, "Content");
			Assert.IsTrue (host.IsLoaded, "IsLoaded");
			Assert.AreEqual (String.Empty, host.NavigationState, "NavigationState");
			Assert.IsNotNull (host.Settings, "Settings");
			// ensure this works with 'moon-unit#.xap'
			string ba = host.Source.AbsoluteUri;
			Assert.IsTrue (ba.EndsWith (".xap"), "Source (.xap)");
			int last_slash = ba.LastIndexOf ('/');
			Assert.IsTrue (ba.Substring (last_slash, ba.Length - last_slash - 5) == "/moon-unit", "Source: " + ba);
		}
Exemple #3
0
		public void IsVersionSupported ()
		{
			SilverlightHost host = new SilverlightHost ();

			Assert.Throws (delegate { host.IsVersionSupported (null); }, typeof (NullReferenceException), "IsVersionSupported(null)");

			Assert.IsFalse (host.IsVersionSupported (String.Empty), "Empty");
			Assert.IsFalse (host.IsVersionSupported ("1"), "1");
			Assert.IsFalse (host.IsVersionSupported ("1."), "1.");
			Assert.IsTrue  (host.IsVersionSupported ("1.0"), "1.0");
			Assert.IsFalse (host.IsVersionSupported ("1.0."), "1.0.");
			Assert.IsTrue  (host.IsVersionSupported ("1.0.0"), "1.0.0");
			Assert.IsFalse (host.IsVersionSupported ("1.0.0."), "1.0.0.");
			Assert.IsTrue  (host.IsVersionSupported ("1.0.0.0"), "1.0.0.0");
			Assert.IsFalse (host.IsVersionSupported ("1.0.0.0."), "1.0.0.0.");
			Assert.IsFalse (host.IsVersionSupported ("1.0.0.0.0"), "1.0.0.0.0");
		}
Exemple #4
0
        public MainPage()
        {
            InitializeComponent();

            Host = Application.Current.Host;
            if (Application.Current.IsRunningOutOfBrowser)
            {
                Application.Current.MainWindow.Title = "DotShot - Wild Framerate Heaven.";
            }
            Host.Settings.EnableFrameRateCounter = true;
            Host.Settings.MaxFrameRate = 60;

            this.KeyDown += new KeyEventHandler(Page_KeyDown);
            this.KeyUp += new KeyEventHandler(Page_KeyUp);

            dt.Interval = new TimeSpan(0, 0, 0, 0, 1000 / 60);
            dt.Tick += new EventHandler(GameLoop);

            GenerateBackground(200);

            startGame();
        }
Exemple #5
0
		public void New ()
		{
			SilverlightHost host = new SilverlightHost ();
			Check (host);
		}