Exemplo n.º 1
0
 protected void OnThreadGet(ThreadGetEventArgs e)
 {
     if (ThreadGet != null)
     {
         ThreadGet(this, e);
     }
 }
Exemplo n.º 2
0
        public async Task GetThreadList(int startIndex, int endIndex)
        {
            try
            {
                var     getThreadList = Edge.Func(NodeJSScriptConstant.METHOD_GET_THREADLIST);
                dynamic result        = await getThreadList(new { startIndex = startIndex, endIndex = endIndex });

                if ((string)result.status == FACEBOOK_STATUS_OK)
                {
                    string            threadsJson = (string)result.threadsJson;
                    List <ChatThread> chatThreads = ChatThread.Parse(threadsJson);
                    string            message     = (string)result.message;
                    if (chatThreads.Count == 0)
                    {
                        message += "No result found.";
                    }
                    else
                    {
                        message += chatThreads.Count + " results found.";
                    }
                    ThreadGetEventArgs e = new ThreadGetEventArgs(chatThreads, message);
                    OnThreadGet(e);
                }
            }
            catch (Exception ex)
            {
                var errMsg = "Exception occured at GetThreadList : " + ex.Message + "\nStack Trace : " + ex.StackTrace;
                throw new FacebookChatApiException(errMsg);
            }
        }
Exemplo n.º 3
0
 protected void OnThreadGet(ThreadGetEventArgs e)
 {
     if (ThreadGet != null)
         ThreadGet(this, e);
 }
Exemplo n.º 4
0
 public async Task GetThreadList(int startIndex, int endIndex)
 {
     try
     {
         var getThreadList = Edge.Func(NodeJSScriptConstant.METHOD_GET_THREADLIST);
         dynamic result = await getThreadList(new { startIndex = startIndex, endIndex = endIndex });
         if ((string)result.status == FACEBOOK_STATUS_OK)
         {
             string threadsJson = (string)result.threadsJson;
             List<ChatThread> chatThreads = ChatThread.Parse(threadsJson);
             string message = (string)result.message;
             if (chatThreads.Count == 0)
             {
                 message += "No result found.";
             }
             else
             {
                 message += chatThreads.Count + " results found.";
             }
             ThreadGetEventArgs e = new ThreadGetEventArgs(chatThreads, message);
             OnThreadGet(e);
         }
     }
     catch (Exception ex)
     {
         var errMsg = "Exception occured at GetThreadList : " + ex.Message + "\nStack Trace : " + ex.StackTrace;
         throw new FacebookChatApiException(errMsg);
     }
 }