コード例 #1
0
ファイル: Logic.cs プロジェクト: GodLesZ/svn-dump
		void btnTask_Click(object sender, Controls.EventArgs e) {
			if (sender == btnTasks[0]) {

#if (!XBOX && !XBOX_FAKE)
				Manager.Cursor = Manager.Skin.Cursors["Busy"].Resource;
#endif

				btnTasks[0].Enabled = false;
				TaskDialog tmp = new TaskDialog(Manager);
				tmp.Closing += new WindowClosingEventHandler(WindowClosing);
				tmp.Closed += new WindowClosedEventHandler(WindowClosed);
				tmp.Init();
				Manager.Add(tmp);

#if (!XBOX && !XBOX_FAKE)
				Thread.Sleep(2000); // Sleep to demonstrate animated busy cursor
#endif

				tmp.Show();

#if (!XBOX && !XBOX_FAKE)
				Manager.Cursor = Manager.Skin.Cursors["Default"].Resource;
#endif
			} else if (sender == btnTasks[1]) {
				btnTasks[1].Enabled = false;
				TaskControls tmp = new TaskControls(Manager);
				tmp.Closing += new WindowClosingEventHandler(WindowClosing);
				tmp.Closed += new WindowClosedEventHandler(WindowClosed);
				tmp.Init();
				Manager.Add(tmp);
				tmp.ShowModal();
			} else if (sender == btnTasks[2]) {
				btnTasks[2].Enabled = false;
				TaskAutoScroll tmp = new TaskAutoScroll(Manager);
				tmp.Closing += new WindowClosingEventHandler(WindowClosing);
				tmp.Closed += new WindowClosedEventHandler(WindowClosed);
				tmp.Init();
				Manager.Add(tmp);
				tmp.Show();
			} else if (sender == btnTasks[3]) {
				btnTasks[3].Enabled = false;

				Window tmp = (Window)Layout.Load(Manager, "Window");
				tmp.Closing += new WindowClosingEventHandler(WindowClosing);
				tmp.Closed += new WindowClosedEventHandler(WindowClosed);
				tmp.Init();
				tmp.GetControl("btnOk").Click += new Controls.EventHandler(Central_Click);
				Manager.Add(tmp);
				tmp.Show();
			} else if (sender == btnTasks[4]) {
				btnTasks[4].Enabled = false;

				TaskEvents tmp = new TaskEvents(Manager);
				tmp.Closing += new WindowClosingEventHandler(WindowClosing);
				tmp.Closed += new WindowClosedEventHandler(WindowClosed);
				tmp.Init();
				Manager.Add(tmp);
				tmp.Show();
			}
		}