示例#1
0
            public void LoginUser(String UserName, LoginUserCallback callback = null, ExceptionCallback ExCal = null)
            {
                DSRESTCommand cmd = getConnection().CreateCommand();

                cmd.setRequestType(DSHTTPRequestType.GET);
                cmd.setText("TCompanyTweet.LoginUser");
                cmd.prepare(get_TCompanyTweet_LoginUser_Metadata());
                InternalConnectionDelegate LoginUserDel = () =>
                {
                    if (callback != null)
                    {
                        try
                        {
                            LoginUserReturns ret = new LoginUserReturns();
                            ret.ReturnMessage = cmd.getParameter(1).getValue().GetAsString();
                            ret.returnValue   = cmd.getParameter(2).getValue().GetAsBoolean();
                            callback.DynamicInvoke(ret);
                        }
                        catch (Exception ex)
                        {
                            if (ExCal != null)
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => ExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                            else
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => BaseExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                        }
                    }
                };

                cmd.getParameter(0).getValue().SetAsString(UserName);
                getConnection().execute(cmd, this, LoginUserDel, ExCal);
            }
示例#2
0
            public void SendTweet(String Tweet, SendTweetCallback callback = null, ExceptionCallback ExCal = null)
            {
                DSRESTCommand cmd = getConnection().CreateCommand();

                cmd.setRequestType(DSHTTPRequestType.GET);
                cmd.setText("TCompanyTweet.SendTweet");
                cmd.prepare(get_TCompanyTweet_SendTweet_Metadata());
                InternalConnectionDelegate SendTweetDel = () =>
                {
                    if (callback != null)
                    {
                        try
                        {
                            callback.DynamicInvoke();
                        }
                        catch (Exception ex)
                        {
                            if (ExCal != null)
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => ExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                            else
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => BaseExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                        }
                    }
                };

                cmd.getParameter(0).getValue().SetAsString(Tweet);
                getConnection().execute(cmd, this, SendTweetDel, ExCal);
            }
示例#3
0
            public void ConnectedUsers(ConnectedUsersCallback callback = null, ExceptionCallback ExCal = null)
            {
                DSRESTCommand cmd = getConnection().CreateCommand();

                cmd.setRequestType(DSHTTPRequestType.GET);
                cmd.setText("TCompanyTweet.ConnectedUsers");
                cmd.prepare(get_TCompanyTweet_ConnectedUsers_Metadata());
                InternalConnectionDelegate ConnectedUsersDel = () =>
                {
                    if (callback != null)
                    {
                        try
                        {
                            callback.DynamicInvoke((TJSONArray)cmd.getParameter(0).getValue().GetAsJSONValue());
                        }
                        catch (Exception ex)
                        {
                            if (ExCal != null)
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => ExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                            else
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => BaseExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                        }
                    }
                };

                getConnection().execute(cmd, this, ConnectedUsersDel, ExCal);
            }