idTech4.UI.idWindow.AddCommand C# (CSharp) Method

AddCommand() public method

public AddCommand ( string command ) : void
command string
return void
		public void AddCommand(string command)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			if(_command.Length > 0)
			{
				_command += string.Format(" ; {0}", command);
			}
			else
			{
				_command = command;
			}
		}

Usage Example

示例#1
0
		private static void Script_Set(idWindow window, List<idWinGuiScript> source)
		{
			string dest = (source.Count > 0) ? source[0].Variable.ToString() : null;

			if(dest != null)
			{
				if(dest.Equals("cmd", StringComparison.OrdinalIgnoreCase) == true)
				{
					dest = (source.Count > 1) ? source[1].Variable as idWinString : null;
					
					int parameterCount = source.Count;

					if(parameterCount > 2)
					{
						StringBuilder value = new StringBuilder(dest);
						int i = 2;

						while(i < parameterCount)
						{
							value.AppendFormat(" \"{0}\"", source[i].Variable);
							i++;
						}

						window.AddCommand(value.ToString());
					}
					else
					{
						window.AddCommand(dest);
					}

					return;
				}
			}

			source[0].Variable.Set(source[1].Variable.ToString());
			source[0].Variable.Evaluate = false;
		}