public MainWindow()
        {
            XmlConfigurator.Configure();
            InitializeComponent();
            AppearanceManager.Current.AccentColor = Colors.Red;
            CopyDatabase();
            UploadAccount objUploadAccount = new UploadAccount();

            objUploadAccount.AccounLoad();
            mainFormReference = this;

            Thread Obj_CheckVersion = new Thread(CheckVersion);

            Obj_CheckVersion.SetApartmentState(ApartmentState.STA);
            Obj_CheckVersion.Start();

            string GetFolderPath = (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\PinDominator3.0" + "\\favicon(1).ico").Replace("\\", "/");

            this.objNotifyIcon.Icon = new Icon(@GetFolderPath);

            objNotifyIcon.Click +=
                delegate(object o, EventArgs e)
            {
                this.Show();
                this.WindowState = WindowState.Normal;
            };

            InitializeAllDelegates();//objRepin_Comments_UserPins_Repin
        }
        private void btnSave_AddSingleAcc_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                QueryManager QM            = new QueryManager();
                string       accountUser   = string.Empty;
                string       accountPass   = string.Empty;
                string       niches        = string.Empty;
                string       proxyAddress  = string.Empty;
                string       proxyPort     = string.Empty;
                string       proxyUserName = string.Empty;
                string       proxyPassword = string.Empty;
                //string Useragent = string.Empty;
                string BoardsName  = string.Empty;
                string ScreenName  = string.Empty;
                string LoginStatus = string.Empty;

                if (string.IsNullOrEmpty(txtEmail_AddSingleAcc.Text))
                {
                    try
                    {
                        GlobusLogHelper.log.Info("Please Enter Account");
                        ModernDialog.ShowMessage("Please Enter Account", "Enter Account", MessageBoxButton.OK);
                        return;
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                    }
                }
                else
                {
                    accountUser = (txtEmail_AddSingleAcc.Text).ToString();
                }

                if (string.IsNullOrEmpty(txtPassword_AddSingleAcc.Text))
                {
                    try
                    {
                        GlobusLogHelper.log.Info("Please Enter Account");
                        ModernDialog.ShowMessage("Please Enter Account", "Enter Account", MessageBoxButton.OK);
                        return;
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                    }
                }
                else
                {
                    accountPass = (txtPassword_AddSingleAcc.Text).ToString();
                }

                try
                {
                    niches = (txtNiche_AddSinleAcc.Text).ToString();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                }

                try
                {
                    proxyAddress = (txtProxyAddress_AddSingleAcc.Text).ToString();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                }

                try
                {
                    proxyPort = (txtProxyPort_AddSingleAcc.Text).ToString();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                }

                try
                {
                    proxyUserName = (txtProxyUsername_AddSingleAcc.Text).ToString();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                }

                try
                {
                    proxyPassword = (txtProxyPassword_AddSingleAcc.Text).ToString();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                }
                LoginStatus = "NotChecked";

                QM.AddAccountInDataBase(accountUser, accountPass, niches, proxyAddress, proxyPort, proxyUserName, proxyPassword, ScreenName, LoginStatus);
                UploadAccount objUploadAccount = new UploadAccount();
                objUploadAccount.AccounLoad();

                Window parentWindow = (Window)this.Parent;
                parentWindow.Close();
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }