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); }
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); }
public DSAdminRestClient(DSRESTConnection Connection) : base() { this.Connection = Connection; }
public DSAdminRestClient(DSRESTConnection Connection) : base() { this.Connection = Connection; }