Exemplo n.º 1
0
        static public DSProxy.TCompanyTweet getCompanyTweet(DSAdmin.ExceptionCallback ManageExceptionCallback = null)
        {
            if (instance == null)
            {
                string hostname;
                string port;
                if (!settings.TryGetValue <string>("hostname", out hostname))
                {
                    hostname = "datasnap.embarcadero.com";
                }

                if (!settings.TryGetValue <string>("port", out port))
                {
                    port = "8086";
                }

                DSRESTConnection connection = new DSRESTConnection();
                connection.setHost(hostname);
                connection.setPort(Convert.ToInt32(port));
                connection.setProtocol("http");
                if (ManageExceptionCallback == null)
                {
                    instance = new DSProxy.TCompanyTweet(connection, (e) => { MessageBox.Show("Session expired. Try to login again."); });
                }
                else
                {
                    instance = new DSProxy.TCompanyTweet(connection, ManageExceptionCallback);
                }
            }
            return(instance);
        }
Exemplo n.º 2
0
        static public DSProxy.TLoginUser getLoginUserInstance(DSAdmin.ExceptionCallback ManageExceptionCallback = null)
        {
            if (instance == null)
            {
                string hostname;
                string port;
                if (!settings.TryGetValue <string>("hostname", out hostname))
                {
                    hostname = "localhost";
                }

                if (!settings.TryGetValue <string>("port", out port))
                {
                    port = "8080";
                }

                DSRESTConnection connection = new DSRESTConnection();
                connection.setHost(hostname);
                connection.setPort(Convert.ToInt32(port));
                connection.setProtocol("http");
                connection.setUserName("FSAdmin");
                connection.setPassword("fs123!@#");
                if (ManageExceptionCallback == null)
                {
                    instance = new DSProxy.TLoginUser(connection, (e) => { MessageBox.Show("会话已过期,请重新登录."); });
                }
                else
                {
                    instance = new DSProxy.TLoginUser(connection, ManageExceptionCallback);
                }
            }
            return(instance);
        }
Exemplo n.º 3
0
 public DSAdminRestClient(DSRESTConnection Connection)
     : base()
 {
     this.Connection = Connection;
 }
Exemplo n.º 4
0
 public DSAdminRestClient(DSRESTConnection Connection) : base()
 {
     this.Connection = Connection;
 }