public void Initialize ()
{
ErrorType = ERROR_TYPE.NULL;
OnIdle += delegate()
{
UIManager.GetInstance().BuildMenu();
};
checkConnection = new Thread(delegate()
{
while (true)
{
try
{
bool hasCon = CheckConnection();
if (hasCon)
{
if (disconected || ErrorType == ERROR_TYPE.DISCONNECTION)
{
if (loadedSynchronizers)
{
disconected = false;
HandleReconnection();
ErrorType = ERROR_TYPE.NULL;
}
else
{
disconected = false;
InitializeSynchronizers();
ErrorType = ERROR_TYPE.NULL;
}
}
}
else
{
if (!disconected)
{
disconected = true;
HandleDisconnection();
}
}
Thread.Sleep(5000);
}
catch { Logger.LogInfo("ERROR", "Failed to check connection"); };
}
});
CreateConfigFolder();
UpdateConfigFile();
if (CreateHomeFolder())
AddToBookmarks();
}