Пример #1
0
        protected override void ResourceLoader()
        {
            base.ResourceLoader();

            for (int i = 0; i < Elements.Count; i++)
            {
                Console.WriteLine("{0}: {1} '{2}'", i, Elements[i].Type, Elements[i].Text);
            }

            Elements[QUITMISSION_ELEMENT_INDEX].Activate +=
                delegate() {
                QuitMissionDialog d = new QuitMissionDialog(this, mpq);
                d.Cancel += delegate() { DismissDialog(); };
                ShowDialog(d);
            };

            Elements[EXITPROGRAM_ELEMENT_INDEX].Activate +=
                delegate() {
                ExitConfirmationDialog d = new ExitConfirmationDialog(this, mpq);
                d.Cancel += delegate() { DismissDialog(); };
                ShowDialog(d);
            };

            Elements[RESTARTMISSION_ELEMENT_INDEX].Activate +=
                delegate() {
                RestartConfirmationDialog d = new RestartConfirmationDialog(this, mpq);
                d.Cancel += delegate() { DismissDialog(); };
                ShowDialog(d);
            };

            Elements[PREVIOUS_ELEMENT_INDEX].Activate +=
                delegate() {
                if (Previous != null)
                {
                    Previous();
                }
            };
        }
Пример #2
0
		protected override void ResourceLoader ()
		{
			base.ResourceLoader ();

			for (int i = 0; i < Elements.Count; i ++)
				Console.WriteLine ("{0}: {1} '{2}'", i, Elements[i].Type, Elements[i].Text);

			Elements[QUITMISSION_ELEMENT_INDEX].Activate +=
				delegate () {
					QuitMissionDialog d = new QuitMissionDialog (this, mpq);
					d.Cancel += delegate () { DismissDialog (); };
					ShowDialog (d);
				};

			Elements[EXITPROGRAM_ELEMENT_INDEX].Activate +=
				delegate () {
					ExitConfirmationDialog d = new ExitConfirmationDialog (this, mpq);
					d.Cancel += delegate () { DismissDialog (); };
					ShowDialog (d);
				};

			Elements[RESTARTMISSION_ELEMENT_INDEX].Activate += 
				delegate () {
					RestartConfirmationDialog d = new RestartConfirmationDialog (this, mpq);
					d.Cancel += delegate () { DismissDialog (); };
					ShowDialog (d);
				};

			Elements[PREVIOUS_ELEMENT_INDEX].Activate +=
				delegate () {
					if (Previous != null)
						Previous ();
				};
		}