Ejemplo n.º 1
0
 public void Add(ExecutableBase callback)
 {
     callback.Add("onBind", OnBind);
     callback.Add("onStatus", (int)OnCurrentStatus);
     callback.Add("target", Target.With(r => r.ToString()));
     callback.Add("onEventStatus", (int)OnEventStatus);
     this.merges.Add(callback);
     if (!LockTarget)
     {
         this.target = null;
     }
 }
Ejemplo n.º 2
0
        public void Add(ExecutableBase executable)
        {
            var errorMessage = executable.GetErrors();

            if (errorMessage.Any())
            {
                throw new ArgumentException("Executable {0} have problem: {1}".F(executable.GetType().Name, errorMessage
                                                                                 .Select(r => "{0}-{1}".F(r.Key, r.Value))
                                                                                 .AsString(",")), "callback");
            }
            executable.Add("onBind", OnBind);
            executable.Add("onStatus", (int)OnCurrentStatus);
            executable.Add("target", Target.With(r => r.ToJqueryObject()));
            executable.Add("onEventStatus", (int)OnEventStatus);
            this.merges.Add(executable);
            if (!LockTarget)
            {
                this.target = null;
            }
        }