Example #1
0
		private void bAddType_Click(object sender, System.EventArgs e)
		{
			if ( txType.Text.Length > 0 )
			{
				string type = txType.Text;
				bool exists = false;

				foreach ( BoxSpawnEntry entry in Spawn.Entries )
				{
					if ( entry.Type.ToLower() == type.ToLower() )
					{
						exists = true;
						return;
					}
				}

				if ( exists )
				{
					MessageBox.Show( Pandora.Localization.TextProvider[ "Spawns.Exists" ] );
				}
				else
				{
					// Actually add
					BoxSpawnEntry entry = new BoxSpawnEntry();
					entry.Type = type;

					Spawn.Entries.Add( entry );

					dGrid.DataSource = null;
					dGrid.DataSource = Spawn.Entries;
					dGrid.Refresh();
				}

				txType.Text = "";
			}
		}
Example #2
0
		private void dGrid_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
		{
			string type = e.Data.GetData( DataFormats.Text ).ToString();

			BoxSpawnEntry entry = new BoxSpawnEntry();
			entry.Type = type;

			Spawn.Entries.Add( entry );

			dGrid.DataSource = null;
			dGrid.DataSource = Spawn.Entries;
			dGrid.Refresh();
		}
Example #3
0
		public object Clone()
		{
			BoxSpawnEntry entry = new BoxSpawnEntry();
			entry.m_Type = this.m_Type;
			entry.m_MaxCount = this.m_MaxCount;

			return entry;
		}