コード例 #1
0
ファイル: SilverlightHostTest.cs プロジェクト: kangaroo/moon
		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");
		}
コード例 #2
0
ファイル: SilverlightHostTest.cs プロジェクト: dfr0/moon
		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);
		}
コード例 #3
0
ファイル: SilverlightHostTest.cs プロジェクト: dfr0/moon
		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");
		}
コード例 #4
0
ファイル: MainPage.xaml.cs プロジェクト: calvcoll/DotShot
        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();
        }
コード例 #5
0
ファイル: SilverlightHostTest.cs プロジェクト: dfr0/moon
		public void New ()
		{
			SilverlightHost host = new SilverlightHost ();
			Check (host);
		}