OpenBve.Interface.TryGetCommandInfo C# (CSharp) Method

TryGetCommandInfo() static private method

static private TryGetCommandInfo ( Command Value, CommandInfo &Info ) : bool
Value Command
Info CommandInfo
return bool
		internal static bool TryGetCommandInfo(Command Value, out CommandInfo Info) {
			for (int i = 0; i < CommandInfos.Length; i++) {
				if (CommandInfos[i].Command == Value) {
					Info = CommandInfos[i];
					return true;
				}
			}
			Info.Command = Value;
			Info.Type = CommandType.Digital;
			Info.Name = "N/A";
			Info.Description = "N/A";
			return false;
		}

Usage Example

示例#1
0
 // command
 private void comboboxCommand_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.Tag == null & listviewControls.SelectedIndices.Count == 1)
     {
         int i = listviewControls.SelectedIndices[0];
         int j = comboboxCommand.SelectedIndex;
         if (j >= 0)
         {
             Interface.CurrentControls[i].Command = Interface.CommandInfos[j].Command;
             Interface.CommandInfo Info;
             Interface.TryGetCommandInfo(Interface.CommandInfos[j].Command, out Info);
             Interface.CurrentControls[i].InheritedType = Info.Type;
             UpdateControlListElement(listviewControls.Items[i], i, true);
         }
     }
 }
All Usage Examples Of OpenBve.Interface::TryGetCommandInfo