public void Run() { TextInputControl textInputControl = new TextInputControl(); ListInputControl listInputControl = new ListInputControl(); string firstName = textInputControl.Read("First Name"); string middleName = textInputControl.Read("Middle Name"); string lastName = textInputControl.Read("Last Name"); List <string> specializations = listInputControl.Read("Specializations"); string comments = textInputControl.Read("Comments"); Medic medic = new Medic { Id = Guid.NewGuid(), Name = new PersonName { FirstName = firstName, MiddleName = middleName, LastName = lastName }, Specializations = new ObservableCollection <string>(specializations), Comments = comments }; unitOfWork.MedicRepository.Add(medic); }
public pTextBox(string text, float size, Vector2 pos, float length, float depth = 1, bool passwordBox = false) { TextSize = size; Length = length; Box = new pText(string.Empty, size, pos, new Vector2(length, 0), depth, true, Color.White, false); Box.TextBold = true; Box.BackgroundColour = backgroundUnfocused; Box.TextColour = Color.White; Box.TextAlignment = TextAlignment.LeftFixed; Box.HandleInput = true; Box.ClickRequiresConfirmation = true; Box.BorderColour = new Color(180, 180, 180); Box.BorderWidth = 2; cursor = new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Game, pos, depth + 0.001f, true, Color.TransparentWhite); cursor.VectorScale = new Vector2(2, size * 1.5f); cursor.Bypass = true; cursor.Position.Y += CURSOR_Y_OFFSET; SpriteCollection.Add(cursor); if (passwordBox) { InputControl = new PasswordInputControl(this); } else { InputControl = new TextInputControl(this); } InputControl.OnNewImeComposition += InputControl_OnNewImeComposition; InputControl.OnImeStart += new VoidDelegate(InputControl_OnImeStart); InputControl.OnImeEnd += new VoidDelegate(InputControl_OnImeEnd); ImeLine = new pText(string.Empty, size, cursor.Position, depth + 0.002f, true, Color.PaleVioletRed); SpriteCollection.Add(ImeLine); enabled = true; InputControl.pTextBox = this; Box.OnClick += box_OnClick; InputManager.Bind(InputEventType.OnClick, onClick, InputTargetPriority.Highest, BindLifetime.Manual); //todo: this is too global InputControl.OnNewText += TextInputControl_OnNewText; InputControl.OnKey += UpdateCursorPositionScheduled; SpriteCollection.Add(Box); Text = text; }
protected override void Initialize() { up = GetControl <ButtonControl>(Controls.PlayerUp); down = GetControl <ButtonControl>(Controls.PlayerDown); left = GetControl <ButtonControl>(Controls.PlayerLeft); right = GetControl <ButtonControl>(Controls.PlayerRight); cancel = GetControl <ButtonControl>(Controls.PlayerCancel); changeTileDir = GetControl <ButtonControl>(Controls.ChangePlacementDirection); startWord = GetControl <ButtonControl>(Controls.StartWordEntry); castTileSpell = GetControl <ButtonControl>(Controls.CastTileSpell); anyLetter = GetControl <ButtonControl>(Controls.AnyLetter); textInputControl = GetControl <TextInputControl>(Controls.TextInput); restart = GetControl <ButtonControl>(Controls.Restart); StartCoroutine(RunPlayerInteraction()); }
protected override void Initialize() { textInputControl = GetControl <TextInputControl>(Controls.LetterInput); StartCoroutine(StartEncounter()); }