Beispiel #1
0
        public string BuildEditUI([AllowNull] string uniqueControlId,
                                  IPlugInAPI.strTrigActInfo actInfo)
        {
            var           config = ReceiveMessageTriggerConfig.DeserializeTriggerConfig(actInfo.DataIn);
            StringBuilder stb    = new StringBuilder();

            IncludeResourceScript(stb, "ReceiveMessageTriggerScript", uniqueControlId);

            string anyNumberCheckbox = FormCheckBox("AnyNumber" + uniqueControlId, "From any number", config.FromAnyNumber, true);

            string numberInput = FormTextBox("FromNumber" + uniqueControlId, "From number", config.FromNumber);
            string numberLine  = string.Format("<div id=\"FromNumberWrap{0}\">{1}</div>", uniqueControlId, numberInput);

            stb.Append(anyNumberCheckbox).Append("<br />");

            stb.Append(numberLine).Append("<br />");

            stb.Append(FormTextBox("Message" + uniqueControlId, "Message contains", config.Message));

            return(stb.ToString());
        }
Beispiel #2
0
        public string BuildViewUI(IPlugInAPI.strTrigActInfo actInfo)
        {
            var config = ReceiveMessageTriggerConfig.DeserializeTriggerConfig(actInfo.DataIn);

            return(string.Format("A message from {0} containing the text '{1}' is received", config.FromDisplay, config.Message));
        }
Beispiel #3
0
        public bool IsConfigured(IPlugInAPI.strTrigActInfo actionInfo)
        {
            var config = ReceiveMessageTriggerConfig.DeserializeTriggerConfig(actionInfo.DataIn);

            return(config.IsValid());
        }