예제 #1
0
        private void EditWatch(bool duplicate = false)
        {
            var indexes = SelectedIndices.ToList();

            if (SelectedWatches.Any())
            {
                var we = new WatchEditor
                {
                    InitialLocation = this.ChildPointToScreen(WatchListView)
                };

                we.SetWatch(_watches.Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit);

                var result = we.ShowHawkDialog();
                if (result == DialogResult.OK)
                {
                    Changes();
                    if (duplicate)
                    {
                        _watches.AddRange(we.Watches);
                        WatchListView.ItemCount = _watches.ItemCount;
                    }
                    else
                    {
                        for (var i = 0; i < we.Watches.Count; i++)
                        {
                            _watches[indexes[i]] = we.Watches[i];
                        }
                    }
                }

                UpdateValues();
            }
        }
        private void EditWatch(bool duplicate = false)
        {
            var indexes = SelectedIndices.ToList();

            if (SelectedWatches.Any())
            {
                var we = new WatchEditor
                {
                    InitialLocation = this.ChildPointToScreen(WatchListView),
                    MemoryDomains   = MemoryDomains
                };

                we.SetWatch(SelectedWatches.First().Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit);

                if (this.ShowDialogWithTempMute(we) == DialogResult.OK)
                {
                    if (duplicate)
                    {
                        _watches.AddRange(we.Watches);
                        WatchListView.RowCount = _watches.Count;
                        UpdateWatchCount();
                    }
                    else
                    {
                        for (var i = 0; i < we.Watches.Count; i++)
                        {
                            _watches[indexes[i]] = we.Watches[i];
                        }
                    }
                    Changes();
                }

                GeneralUpdate();
            }
            else if (SelectedSeparators.Any() && !duplicate)
            {
                var inputPrompt = new InputPrompt
                {
                    Text          = "Edit Separator",
                    StartLocation = this.ChildPointToScreen(WatchListView),
                    Message       = "Separator Text:",
                    TextInputType = InputPrompt.InputType.Text
                };

                if (this.ShowDialogWithTempMute(inputPrompt) == DialogResult.OK)
                {
                    Changes();

                    for (int i = 0; i < SelectedSeparators.Count(); i++)
                    {
                        var sep = SelectedSeparators.ToList()[i];
                        sep.Notes            = inputPrompt.PromptText;
                        _watches[indexes[i]] = sep;
                    }
                }

                GeneralUpdate();
            }
        }
예제 #3
0
        private void NewWatchMenuItem_Click(object sender, EventArgs e)
        {
            var we = new WatchEditor
            {
                InitialLocation = this.ChildPointToScreen(WatchListView)
            };

            we.SetWatch(_watches.Domain);
            we.ShowHawkDialog();
            if (we.DialogResult == DialogResult.OK)
            {
                _watches.Add(we.Watches[0]);
                Changes();
                UpdateWatchCount();
                WatchListView.ItemCount = _watches.ItemCount;
                UpdateValues();
            }
        }
예제 #4
0
파일: RamWatch.cs 프로젝트: lenalia/BizHawk
        private void EditWatch(bool duplicate = false)
        {
            var indexes = SelectedIndices.ToList();

            if (SelectedWatches.Any())
            {
                foreach (var sw in SelectedWatches)
                {
                    if (sw.Domain != SelectedWatches.First().Domain)
                    {
                        throw new InvalidOperationException("Can't edit multiple watches on varying memorydomains");
                    }
                }

                var we = new WatchEditor
                {
                    InitialLocation = this.ChildPointToScreen(WatchListView),
                    MemoryDomains   = _memoryDomains
                };

                we.SetWatch(SelectedWatches.First().Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit);

                var result = we.ShowHawkDialog(this);
                if (result == DialogResult.OK)
                {
                    Changes();
                    if (duplicate)
                    {
                        _watches.AddRange(we.Watches);
                        WatchListView.ItemCount = _watches.Count;
                    }
                    else
                    {
                        for (var i = 0; i < we.Watches.Count; i++)
                        {
                            _watches[indexes[i]] = we.Watches[i];
                        }
                    }
                }

                UpdateValues();
            }
        }
예제 #5
0
파일: RamWatch.cs 프로젝트: raiscan/BizHawk
 private void NewWatchMenuItem_Click(object sender, EventArgs e)
 {
     var we = new WatchEditor
     {
         InitialLocation = this.ChildPointToScreen(WatchListView),
         MemoryDomains = _memoryDomains
     };
     we.SetWatch(_watches.Domain);
     we.ShowHawkDialog();
     if (we.DialogResult == DialogResult.OK)
     {
         _watches.Add(we.Watches[0]);
         Changes();
         UpdateWatchCount();
         WatchListView.ItemCount = _watches.ItemCount;
         UpdateValues();
     }
 }
예제 #6
0
파일: RamWatch.cs 프로젝트: raiscan/BizHawk
        private void EditWatch(bool duplicate = false)
        {
            var indexes = SelectedIndices.ToList();

            if (SelectedWatches.Any())
            {
                var we = new WatchEditor
                {
                    InitialLocation = this.ChildPointToScreen(WatchListView),
                    MemoryDomains = _memoryDomains
                };

                we.SetWatch(_watches.Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit);

                var result = we.ShowHawkDialog();
                if (result == DialogResult.OK)
                {
                    Changes();
                    if (duplicate)
                    {
                        _watches.AddRange(we.Watches);
                        WatchListView.ItemCount = _watches.ItemCount;
                    }
                    else
                    {
                        for (var i = 0; i < we.Watches.Count; i++)
                        {
                            _watches[indexes[i]] = we.Watches[i];
                        }
                    }
                }

                UpdateValues();
            }
        }
예제 #7
0
        private void EditWatch(bool duplicate = false)
        {
            var indexes = SelectedIndices.ToList();

            if (SelectedWatches.Any())
            {
                foreach (var sw in SelectedWatches)
                {
                    if (sw.Domain != SelectedWatches.First().Domain)
                    {
                        throw new InvalidOperationException("Can't edit multiple watches on varying memory domains");
                    }
                }

                var we = new WatchEditor
                {
                    InitialLocation = this.ChildPointToScreen(WatchListView),
                    MemoryDomains   = MemoryDomains
                };

                we.SetWatch(SelectedWatches.First().Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit);

                var result = we.ShowHawkDialog(this);
                if (result == DialogResult.OK)
                {
                    Changes();
                    if (duplicate)
                    {
                        _watches.AddRange(we.Watches);
                        WatchListView.ItemCount = _watches.Count;
                        UpdateWatchCount();
                    }
                    else
                    {
                        for (var i = 0; i < we.Watches.Count; i++)
                        {
                            _watches[indexes[i]] = we.Watches[i];
                        }
                    }
                }

                UpdateValues();
            }
            else if (SelectedSeparators.Any() && !duplicate)
            {
                var inputPrompt = new InputPrompt
                {
                    Text          = "Edit Separator",
                    StartLocation = this.ChildPointToScreen(WatchListView),
                    Message       = "Separator Text:",
                    TextInputType = InputPrompt.InputType.Text
                };

                var result = inputPrompt.ShowHawkDialog();

                if (result == DialogResult.OK)
                {
                    Changes();

                    for (int i = 0; i < SelectedSeparators.Count(); i++)
                    {
                        var sep = SelectedSeparators.ToList()[i];
                        sep.Notes            = inputPrompt.PromptText;
                        _watches[indexes[i]] = sep;
                    }
                }

                UpdateValues();
            }
        }
예제 #8
0
파일: RamWatch.cs 프로젝트: henke37/BizHawk
		private void EditWatch(bool duplicate = false)
		{
			var indexes = SelectedIndices.ToList();

			if (SelectedWatches.Any())
			{
				foreach (var sw in SelectedWatches)
					if (sw.Domain != SelectedWatches.First().Domain)
						throw new InvalidOperationException("Can't edit multiple watches on varying memorydomains");

				var we = new WatchEditor
				{
					InitialLocation = this.ChildPointToScreen(WatchListView),
					MemoryDomains = _memoryDomains
				};

				we.SetWatch(SelectedWatches.First().Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit);

				var result = we.ShowHawkDialog();
				if (result == DialogResult.OK)
				{
					Changes();
					if (duplicate)
					{
						_watches.AddRange(we.Watches);
						WatchListView.ItemCount = _watches.Count;
					}
					else
					{
						for (var i = 0; i < we.Watches.Count; i++)
						{
							_watches[indexes[i]] = we.Watches[i];
						}
					}
				}

				UpdateValues();
			}
		}