public override void Initialize(LayoutElementsContainer layout) { DevAccount devAccount = ToolAuthentication.LoadLastSignedInUser(); layout.Header("Account"); if (devAccount != null) { layout.Label("Username: "******"Id: " + devAccount.Id); layout.Label("Type: " + devAccount.AccountType); } else { layout.Label("Not logged in"); } layout.Header("Sandbox"); var sb = layout.TextBox(); var setSb = layout.Button("Set Sandbox"); setSb.Button.Clicked += () => SandboxHelper.SetSandbox(sb.Text); var retail = layout.Button("Switch to retail"); setSb.Button.Clicked += () => SandboxHelper.SetSandbox("RETAIL"); }
/// <inheritdoc /> public override void Initialize(LayoutElementsContainer layout) { bool isMultiLine = false; var attributes = Values.GetAttributes(); var multiLine = attributes?.FirstOrDefault(x => x is MultilineTextAttribute); if (multiLine != null) { isMultiLine = true; } _element = layout.TextBox(isMultiLine); _element.TextBox.EditEnd += () => SetValue(_element.Text); }
public override void Initialize(LayoutElementsContainer layout) { var values = (string[])Values[0]; if (values == null || values.Length == 0) { values = new string[1]; values[0] = string.Empty; } if (_textBoxes == null || _textBoxes.Length != values.Length) { _textBoxes = new TextBox[values.Length]; } for (int i = 0; i < values.Length; i++) { var value = values[i]; var textBox = layout.TextBox(value.IsMultiline()); textBox.TextBox.Tag = i; textBox.TextBox.Text = value; textBox.TextBox.TextBoxEditEnd += OnEditEnd; _textBoxes[i] = textBox.TextBox; } }
/// <inheritdoc /> public override void Initialize(LayoutElementsContainer layout) { _element = layout.TextBox(); _element.TextBox.EditEnd += OnEditEnd; }
/// <inheritdoc /> public override void Initialize(LayoutElementsContainer layout) { element = layout.TextBox(); element.TextBox.EditEnd += () => SetValue(element.Text); }