/// <summary> /// the constructor. /// </summary> public SettingsModel() { //getting a communcation instance. communicate = ModelCommunication.GetInstance(); //in case the connection had failed. if (!communicate.IsConnected()) { return; } Config = Configure.GetInstance(); //Request from the service the configurations try { communicate.SendCommend((int)CommandEnum.GetConfigCommand, null); communicate.GetConfig += GetConfig; communicate.RemoveHandler += GetHandlerClosed; //Waiting until adding the config file until we continue; while (!addedConfig) { ; } } catch (Exception) { return; } }
public bool IsConnected() { return(communicate.IsConnected()); }