Lines Matching refs:Length

29 			for (int i = 0; i < controlsToSave.Length; i++) {  in SaveControls()
142 int Length = 0; in LoadControls()
149 for (int i = 0; i < Lines.Length; i++) in LoadControls()
152 if (Lines[i].Length != 0 && !Lines[i].StartsWith(";", StringComparison.OrdinalIgnoreCase)) in LoadControls()
155 for (int j = 0; j < Terms.Length; j++) in LoadControls()
160 if (Terms.Length >= 2) in LoadControls()
162 if (Length >= Controls.Length) in LoadControls()
164 Array.Resize(ref Controls, Controls.Length << 1); in LoadControls()
168 for (j = 0; j < Translations.CommandInfos.Length; j++) in LoadControls()
173 if (j == Translations.CommandInfos.Length) in LoadControls()
175 Controls[Length].Command = Translations.Command.None; in LoadControls()
176 Controls[Length].InheritedType = Translations.CommandType.Digital; in LoadControls()
177 Controls[Length].Method = ControlMethod.Invalid; in LoadControls()
178 Controls[Length].Device = new Guid(); in LoadControls()
179 Controls[Length].Component = JoystickComponent.Invalid; in LoadControls()
180 Controls[Length].Element = -1; in LoadControls()
181 Controls[Length].Direction = 0; in LoadControls()
182 Controls[Length].Modifier = KeyboardModifier.None; in LoadControls()
183 Controls[Length].Option = 0; in LoadControls()
187 Controls[Length].Command = Translations.CommandInfos[j].Command; in LoadControls()
188 Controls[Length].InheritedType = Translations.CommandInfos[j].Type; in LoadControls()
191 if (Method == "keyboard" & Terms.Length >= 4) in LoadControls()
238 Controls[Length].Method = ControlMethod.Keyboard; in LoadControls()
239 Controls[Length].Device = new Guid(); //will create invalid all zero GUID in LoadControls()
240 Controls[Length].Component = JoystickComponent.Invalid; in LoadControls()
241 Controls[Length].Key = (OpenBveApi.Input.Key)CurrentKey; in LoadControls()
242 Controls[Length].Direction = 0; in LoadControls()
243 Controls[Length].Modifier = (KeyboardModifier) Modifiers; in LoadControls()
245 … if (Terms.Length >= 5 && int.TryParse(Terms[4], NumberStyles.Integer, Culture, out Option)) in LoadControls()
247 Controls[Length].Option = Option; in LoadControls()
256 else if (Method == "joystick" & Terms.Length >= 4) in LoadControls()
268 if (Component == "axis" & Terms.Length >= 6) in LoadControls()
277 Controls[Length].Method = ControlMethod.Joystick; in LoadControls()
278 Controls[Length].Device = Device; in LoadControls()
279 Controls[Length].Component = JoystickComponent.Axis; in LoadControls()
280 Controls[Length].Element = CurrentAxis; in LoadControls()
281 Controls[Length].Direction = Direction; in LoadControls()
282 Controls[Length].Modifier = KeyboardModifier.None; in LoadControls()
284 … if (Terms.Length >= 7 && int.TryParse(Terms[6], NumberStyles.Integer, Culture, out Option)) in LoadControls()
286 Controls[Length].Option = Option; in LoadControls()
293 else if (Component == "hat" & Terms.Length >= 6) in LoadControls()
301 Controls[Length].Method = ControlMethod.Joystick; in LoadControls()
302 Controls[Length].Device = Device; in LoadControls()
303 Controls[Length].Component = JoystickComponent.Hat; in LoadControls()
304 Controls[Length].Element = CurrentHat; in LoadControls()
305 Controls[Length].Direction = HatDirection; in LoadControls()
306 Controls[Length].Modifier = KeyboardModifier.None; in LoadControls()
308 … if (Terms.Length >= 7 && int.TryParse(Terms[6], NumberStyles.Integer, Culture, out Option)) in LoadControls()
310 Controls[Length].Option = Option; in LoadControls()
318 else if (Component == "button" & Terms.Length >= 5) in LoadControls()
323 Controls[Length].Method = ControlMethod.Joystick; in LoadControls()
324 Controls[Length].Device = Device; in LoadControls()
325 Controls[Length].Component = JoystickComponent.Button; in LoadControls()
326 Controls[Length].Element = CurrentButton; in LoadControls()
327 Controls[Length].Direction = 0; in LoadControls()
328 Controls[Length].Modifier = KeyboardModifier.None; in LoadControls()
330 … if (Terms.Length >= 6 && int.TryParse(Terms[5], NumberStyles.Integer, Culture, out Option)) in LoadControls()
332 Controls[Length].Option = Option; in LoadControls()
341 else if (Method == "raildriver" & Terms.Length >= 4) in LoadControls()
353 if (Component == "axis" & Terms.Length >= 6) in LoadControls()
362 Controls[Length].Method = ControlMethod.RailDriver; in LoadControls()
363 Controls[Length].Device = Device; in LoadControls()
364 Controls[Length].Component = JoystickComponent.Axis; in LoadControls()
365 Controls[Length].Element = CurrentAxis; in LoadControls()
366 Controls[Length].Direction = Direction; in LoadControls()
367 Controls[Length].Modifier = KeyboardModifier.None; in LoadControls()
369 … if (Terms.Length >= 7 && int.TryParse(Terms[6], NumberStyles.Integer, Culture, out Option)) in LoadControls()
371 Controls[Length].Option = Option; in LoadControls()
378 else if (Component == "button" & Terms.Length >= 5) in LoadControls()
383 Controls[Length].Method = ControlMethod.RailDriver; in LoadControls()
384 Controls[Length].Device = Device; in LoadControls()
385 Controls[Length].Component = JoystickComponent.Button; in LoadControls()
386 Controls[Length].Element = CurrentButton; in LoadControls()
387 Controls[Length].Direction = 0; in LoadControls()
388 Controls[Length].Modifier = KeyboardModifier.None; in LoadControls()
390 … if (Terms.Length >= 6 && int.TryParse(Terms[5], NumberStyles.Integer, Culture, out Option)) in LoadControls()
392 Controls[Length].Option = Option; in LoadControls()
404 Controls[Length].Method = ControlMethod.Invalid; in LoadControls()
405 Controls[Length].Device = new Guid(); //Invalid all zero GUID in LoadControls()
406 Controls[Length].Component = JoystickComponent.Invalid; in LoadControls()
407 Controls[Length].Element = -1; in LoadControls()
408 Controls[Length].Direction = 0; in LoadControls()
409 Controls[Length].Modifier = KeyboardModifier.None; in LoadControls()
410 Controls[Length].Option = 0; in LoadControls()
414 Length++; in LoadControls()
418 Array.Resize(ref Controls, Length); in LoadControls()
426 for (int i = 0; i < Add.Length; i++) { in AddControls()
428 for (j = 0; j < Base.Length; j++) { in AddControls()
431 if (j == Base.Length) { in AddControls()
432 Array.Resize(ref Base, Base.Length + 1); in AddControls()
433 Base[Base.Length - 1] = Add[i]; in AddControls()