public StructureDownloader(Queue<LocalItemDetails> queue, ThreadLockObject lockObject, string rootContainerUrl, CloudService fileCloud)
        {
            LogWrapper.LogMessage("StructureDownloader - Constructor", "Enter");
            //this.queue = queue;
            //this.lockObject = lockObject;
            cRootContainerUrl = rootContainerUrl;
            cFileCloud = fileCloud;
            dbhandler.OpenConnection();

            LogWrapper.LogMessage("StructureDownloader - Constructor Call", "Content Url: " + rootContainerUrl);
            LogWrapper.LogMessage("StructureDownloader - Constructor", "Leave");
        }
        public void SyncNow()
        {
            // TODO:check for offline (Modified for server status thread)

            if (!CanNotTalkToServer())
                EnableSyncManager();

            SetUpSyncNowNotification();

            if (BasicInfo.IsInitialSync)
            {
                ShowNextSyncLabel(false);
                SetUpControlForSync();
                cnotificationManager.NotificationHandler.ShowBalloonTip(1, LanguageTranslator.GetValue("TrayBalloonInitialSyncStartedTitleText"),
                                                                        LanguageTranslator.GetValue("TrayBalloonInitialSyncStartedText"),
                                                                        ToolTipIcon.None);

                queue = new Queue<LocalItemDetails>();
                lockObject = new ThreadLockObject();
                lockObject.StopThread = false;
                stDownloader = new StructureDownloader(queue, lockObject, cLoginDetails.szContainerContentsUri, cMezeoFileCloud);
                stDownloader.downloadEvent += new StructureDownloader.StructureDownloadEvent(stDownloader_downloadEvent);

                analyseThread = new Thread(stDownloader.startAnalyseItemDetails);

                setUpControls();
                SetAnalysisIsCompleted(false);
                analyseThread.Start();
            }
            else
            {
                if (false == EventQueue.QueueNotEmpty())
                {
                    ShowNextSyncLabel(false);
                    PopulateNQEvents();
                }

                if (EventQueue.QueueNotEmpty())
                {
                    ShowNextSyncLabel(false);
                    if (!bwSyncThread.IsBusy)
                        bwSyncThread.RunWorkerAsync();
                }
                else
                {
                   resetAllControls();
                }
            }
            //LogWrapper.LogMessage("frmSyncManager - SyncNow", "leave");
        }