public override void DefineAction(string name, Constants.ActionKind kind, ActionArgs args, IDictionary <string, object> options, ActionContext.ActionResponder responder)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                CompatibilityLayer.LogError($"Empty name parameter.");
                return;
            }
            if (args == null)
            {
                CompatibilityLayer.LogError($"Args cannot be null.");
                return;
            }

            var ad = new ActionDefinition();

            ad.Name    = name;
            ad.Kind    = kind;
            ad.Args    = args;
            ad.Options = options;
            if (responder != null)
            {
                ad.Responder += responder;
            }

            VarCache.RegisterActionDefinition(ad);
        }
Ejemplo n.º 2
0
        public override void DefineAction(string name, Constants.ActionKind kind, ActionArgs args, IDictionary <string, object> options, ActionContext.ActionResponder responder)
        {
            if (name == null)
            {
                return;
            }
            if (responder != null)
            {
                ActionRespondersDictionary.Add(name, responder);
            }

            string argString    = args == null ? null : args.ToJSON();
            string optionString = options == null ? null : Json.Serialize(options);

            lp_defineAction(name, (int)kind, argString, optionString);
        }
Ejemplo n.º 3
0
        public override void DefineAction(string name, Constants.ActionKind kind, ActionArgs args, IDictionary <string, object> options, Action responder)
        {
            if (name == null)
            {
                return;
            }
            if (responder != null)
            {
                ActionRespondersDictionary.Add("ActionResponder:" + name, responder);
            }

            string argString    = args == null ? null : args.ToJSON();
            string optionString = options == null ? null : Json.Serialize(options);
            int    kindInt      = (int)kind;

            NativeSDK.CallStatic("defineAction", name, kindInt, argString, optionString);
        }
Ejemplo n.º 4
0
 public static void DefineAction(string name, Constants.ActionKind kind, ActionArgs args, IDictionary <string, object> options, ActionContext.ActionResponder responder)
 {
     LeanplumFactory.SDK.DefineAction(name, kind, args, options, responder);
 }
Ejemplo n.º 5
0
 public static void DefineAction(string name, Constants.ActionKind kind, ActionArgs args, IDictionary <string, object> options)
 {
     LeanplumFactory.SDK.DefineAction(name, kind, args, options, null);
 }
Ejemplo n.º 6
0
 public static void DefineAction(string name, Constants.ActionKind kind, ActionArgs args)
 {
     LeanplumFactory.SDK.DefineAction(name, kind, args, null, null);
 }
Ejemplo n.º 7
0
 public override void DefineAction(string name, Constants.ActionKind kind, ActionArgs args, IDictionary <string, object> options, Action responder)
 {
 }
Ejemplo n.º 8
0
 public abstract void DefineAction(string name, Constants.ActionKind kind, ActionArgs args,
                                   IDictionary <string, object> options, ActionContext.ActionResponder responder);