/** * Method that sets instance variables to avoid repetition in constructors. * * @param name - The name of the message action. * @param text - The text in the message action. * @param value - A way to ID the message action. * @param type - The type of action, usually button. * @param confirm - The MessageActionConfirmation for this action, a pop up confirming the user's actions. * @param options - A list of MessageActionOptions holding the options for the action. Usually buttons. */ private void Initialize(string name, string text, string value, string type, MessageActionConfirm confirm, List <MessageActionOption> options) { _name = name; _text = text; _value = value; _type = type; _confirm = confirm?.Build(); if (options != null) { foreach (MessageActionOption option in options) { _options.Add(option.Build()); } } }
public MessageAction(string name, string text, string value, string type, MessageActionConfirm confirm, List <MessageActionOption> options) { Initialize(name, text, value, type, confirm, options); }
public MessageAction(string text, MessageActionConfirm confirm) { Initialize(text, text, "", Constants.BUTTON, confirm, null); }