Exemplo n.º 1
0
        public static void DequeueCallbacks()
        {
            while (Callbacks.Count > 0)
            {
                ICallback item;

                if (Callbacks.TryDequeue(out item))
                {
                    try
                    {
                        if (item is Objects.JSHttpRequestResult)
                        {
                            Objects.JSHttpRequestResult obj = (Objects.JSHttpRequestResult)item;
                            JSScript script = Scripts.Find(x => x.ScriptName == item.ScriptName);

                            if (script != null)
                            {
                                obj.Callback.Call(obj, !String.IsNullOrEmpty(obj.Data));
                            }
                        }
                        else if (item is Objects.JSAvatarImage)
                        {
                            Objects.JSAvatarImage obj = (Objects.JSAvatarImage)item;
                            JSScript script           = Scripts.Find(x => x.ScriptName == item.ScriptName);

                            if (script != null)
                            {
                                obj.Callback.Call(obj, obj.Data != null);
                            }
                        }
                        else if (item is Objects.JSScribbleImage)
                        {
                            Objects.JSScribbleImage obj = (Objects.JSScribbleImage)item;
                            JSScript script             = Scripts.Find(x => x.ScriptName == item.ScriptName);

                            if (script != null)
                            {
                                obj.Callback.Call(obj, obj.Data != null);
                            }
                        }
                        else if (item is Objects.JSProxyCheckResult)
                        {
                            Objects.JSProxyCheckResult obj = item as Objects.JSProxyCheckResult;
                            JSScript script = Scripts.Find(x => x.ScriptName == item.ScriptName);

                            if (script != null)
                            {
                                obj.Callback.Call(obj, obj.User, obj);
                            }
                        }
                    }
                    catch { }
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public JSScribbleImage ToScribble()
        {
            if (this.Data != null)
            {
                JSScribbleImage s = new JSScribbleImage(this.Engine.Object.InstancePrototype);
                s.FromAvatar(this.Data);
                return(s);
            }

            return(null);
        }
Exemplo n.º 3
0
 public void Scribble(object a, object b)
 {
     if (a is JSScribbleImage)
     {
         JSScribbleImage scr = (JSScribbleImage)a;
         scr.SendScribble(Server.Chatroom.BotName, this.parent);
     }
     else if (!(a is Undefined) && b is JSScribbleImage)
     {
         JSScribbleImage scr = (JSScribbleImage)b;
         scr.SendScribble(a.ToString(), this.parent);
     }
 }