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); }
public static void ResetProxy() { instance = null; manager = null; manager_cmd = null; }