Beispiel #1
0
        public static string ShowStringDialog(string title, string text)
        {
            var dialog = new StringRequest {
                Title = title, TextBox = { Text = text }, Owner = MainWindow.Instance
            };

            return(dialog.ShowDialog() == true ? dialog.TextBox.Text : null);
        }
Beispiel #2
0
        void RemoveCounterButton_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new StringRequest {
                Title = "Insert counter name.", Owner = MainWindow.Instance
            };
            var result = dialog.ShowDialog();

            if (result.HasValue && result.Value && !MainWindow.Instance.Mission.Counters.Remove(dialog.TextBox.Text))
            {
                MessageBox.Show("Error: counter " + dialog.TextBox.Text + " does not exist.");
            }
        }
Beispiel #3
0
        void AddCounterButton_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new StringRequest {
                Title = "Insert counter name.", Owner = MainWindow.Instance
            };
            var result = dialog.ShowDialog();

            if (result.HasValue && result.Value)
            {
                MainWindow.Instance.Mission.Counters.Add(dialog.TextBox.Text);
            }
        }
        void Find_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new StringRequest {
                Title = "Insert text to search.", Owner = MainWindow.Instance
            };

            if (!(dialog.ShowDialog().GetValueOrDefault()))
            {
                return;
            }
            GoToText(dialog.TextBox.Text);
        }
		void RenameTrigger(Trigger trigger)
		{
			if (trigger == null) return;
			var dialog = new StringRequest { Title = "Rename Trigger", TextBox = { Text = trigger.Name }, Owner =this };
			if (dialog.ShowDialog() == true)
			{
				trigger.Name = dialog.TextBox.Text;
				trigger.RaisePropertyChanged(String.Empty);
				Mission.RaisePropertyChanged("Triggers");
			}
		}
		void RenameRegion(Region region)
		{
			if (region == null) return;
			var dialog = new StringRequest { Title = "Rename Region", TextBox = { Text = region.Name }, Owner = this };
			if (dialog.ShowDialog() == true)
			{
				region.Name = dialog.TextBox.Text;
				region.RaisePropertyChanged(String.Empty);
				Mission.RaisePropertyChanged("Regions");
			}
		}
		void RenameLogicItem(TriggerLogic item)
		{
			if (item == null) return;
			var dialog = new StringRequest { Title = "Rename Item", TextBox = { Text = item.Name }, Owner =this };
			if (dialog.ShowDialog() == true) item.Name = dialog.TextBox.Text;
		}
		void RemoveCounterButton_Click(object sender, RoutedEventArgs e)
		{
			var dialog = new StringRequest { Title = "Insert counter name.", Owner = MainWindow.Instance };
			var result = dialog.ShowDialog();
			if (result.HasValue && result.Value && !MainWindow.Instance.Mission.Counters.Remove(dialog.TextBox.Text))
			{
				MessageBox.Show("Error: counter " + dialog.TextBox.Text + " does not exist.");
			}
		}
		void AddCounterButton_Click(object sender, RoutedEventArgs e)
		{
			var dialog = new StringRequest {Title = "Insert counter name.", Owner = MainWindow.Instance};
			var result = dialog.ShowDialog();
			if (result.HasValue && result.Value) MainWindow.Instance.Mission.Counters.Add(dialog.TextBox.Text);
		}