public frmIssues(CloudService mezeoFileCloud, frmSyncManager manager)
        {
            InitializeComponent();
            syncmanager = manager;
            dbHandler = new DbHandler();
            ClearInfoLabels();

            cMezeoFileCloud = mezeoFileCloud;
        }
        private void ShowSyncManagerOfffline()
        {
            BasicInfo.UserName = txtUserName.Text;
            BasicInfo.Password = txtPasswrod.Text;
            BasicInfo.ServiceUrl = txtServerUrl.Text;

            isLoginSuccess = false;

            if (showLogin)
            {
                this.Close();
            }

            niSystemTray.ContextMenuStrip = cmSystemTraySyncMgr;

            if (syncManager == null)
            {
                syncManager = new frmSyncManager(mezeoFileCloud, loginDetails, notificationManager);

                mezeoFileCloud.SetSynManager(ref syncManager);
                syncManager.CreateControl();
                syncManager.ParentForm = this;
            }

            if (checkReferenceCode() > 0)
            {
                //If we are login and talk with server do not do anything
            }
            else
            {
                //If we are login and can not talk with server show app is offline
                 syncManager.DisableSyncManager();
                 syncManager.ShowSyncManagerOffline();
            }

            syncManager.SyncOfflineMessage();
        }
 public void SetSynManager(ref frmSyncManager Manager)
 {
     syncManager = Manager;
 }
        private void bwLogin_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            this.UseWaitCursor = false;
            if (loginDetails == null)
            {
                if ((int)e.Result == 403 || (int)e.Result == 401)
                {
                    if (showLogin)
                    {
                        ShowLoginError();
                    }
                    else
                    {
                        this.labelError.Text = LanguageTranslator.GetValue("LoginErrorText");
                        this.txtUserName.Enabled = false;
                        this.txtPasswrod.Enabled = true;
                        this.txtServerUrl.Enabled = false;

                        this.btnLogin.Enabled = true;

                        showLogin = true;
                    }
                    this.Show();
                }
                else
                {
                    if (BasicInfo.IsCredentialsAvailable)
                        ShowSyncManagerOfffline();
                    else
                        ShowLoginError();
                }
                return;
            }
            else if (loginDetails.nAccountType == 0)
            {
                ShowGuestLoginError();
                return;
            }
            else if (loginDetails.szContainerContentsUri == "")
            {
                /* Fogbugzid: 2295 login - return message when account has no default storage container or no
                containers at all */
                ShowNoRootContainerError();
                return;
            }
            else
            {
                BasicInfo.UserName = txtUserName.Text;
                BasicInfo.Password = txtPasswrod.Text;
                BasicInfo.ServiceUrl = txtServerUrl.Text;

                isLoginSuccess = true;
              //  SyncEvaluatingBalloonMessage();
            }

            if (showLogin)
            {
                this.Close();
            }
               // mezeoFileCloud.AppEventViewer(AboutBox.AssemblyTitle, LanguageTranslator.GetValue("LoginSuccess"), 3);
            niSystemTray.ContextMenuStrip = cmSystemTraySyncMgr;

            CheckAndCreateSyncDirectory();
            CheckAndCreateNotificationQueue();
            HandleUpdates();
            if (syncManager == null)
            {
                syncManager = new frmSyncManager(mezeoFileCloud, loginDetails, notificationManager);

                //Set Sync Manager for Progress bar
                mezeoFileCloud.SetSynManager(ref syncManager);
                syncManager.CreateControl();
                syncManager.ParentForm = this;
            }

            if (isLoginSuccess)
            {
                LoginSuccessTask();
            }
        }