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 OpenFrmMain()
 {
     try
     {
         PinDominator.MainWindow frmwinMain = new PinDominator.MainWindow();
         frmwinMain.Show();
         this.Hide();
     }
     catch (Exception ex)
     {
         GlobusFileHelper.AppendStringToTextfileNewLine(ex.Message, PDGlobals.pathErrorLog + "\\ErrorLogLicensing.txt");
     }
 }
	public MainWindow () : base (Gtk.WindowType.Toplevel)
	{
			Build ();

			Gdk.Color fontcolor = new Gdk.Color(67,96,156);
	//		MenuBarControls.ModifyBg (StateType.Normal, fontcolor);
			BackGroundColorChangeMenuBar ();
			BackGroundColorChange ();

		new Thread(()=>
				{
					GlobusLogHelper.objAddToLoggerDelegate = new AddToLoggerDelegate(Addtologger);
					CheckOperatingSystem();
					CreateAppDirectories();
					CopyDatabase();
					AddDataToGridColumnNew();
					AddDataToGridColumnForSelectAccount();
					Thread.Sleep(500);

				Gtk.Application.Invoke (delegate {

				});
				}).Start();

			AccountChecker.objDelegateNoOfAcc = new CheckAccount(AccountReportNoOfAccount_AccChecker);
			AccountChecker.objDelegateNoOfActiveAcc = new CheckAccount(AccountReportNoOfActiveAccount);
			AccountChecker.objDelegateNoOfDeadAcc = new CheckAccount(AccountReportNoOfDeadAccount);

			BoardsManager.objDelegateNoOfActiveAcc = new BoardAccount (AccountReportActiveAccount_Board);
			BoardsManager.objDelegateNoOfDeadAcc = new BoardAccount (AccountReportDeadAccount_Board);
			BoardsManager.objBoardDelegate = new AccountReport_Board (AccountReport_Board);

			AddBoardNameManager.objAddBoardDelegate = new AccountReport_AddBoard (AccountReport_AddBoard);
			AddBoardNameManager.objDelegateNoOfActiveAcc = new AddBoardAccount (AccountReportActiveAccount_AddBoard);
			AddBoardNameManager.objDelegateNoOfDeadAcc = new AddBoardAccount (AccountReportDeadAccount_AddBoard);

			AddUsersToBoardManager.objAddUserToBoarddelegate = new AccountReport_AddUserToBoard (AccountReport_AddUserToBoard);
			AddUsersToBoardManager.objDelegateNoOfActiveAcc = new AddUserToBoardAccount (AccountReportActiveAccount_AddUserToBoard);
			AddUsersToBoardManager.objDelegateNoOfDeadAcc = new AddUserToBoardAccount (AccountReportDeadAccount_AddUserToBoard);

			CommentManagers.objCommentDelegate = new AccountReport_Comments (AccountReport_Comment);
			CommentManagers.objDelegateNoOfActiveAcc = new CommentAccount (AccountReportActiveAccount_Comment);
			CommentManagers.objDelegateNoOfDeadAcc = new CommentAccount (AccountReportDeadAccount_Comment);

			CommentByKeywordManager.objCommentByKeywordDelegate = new AccountReport_CommentByKeyword (AccountReport_CommentByKeyword);
			CommentByKeywordManager.objDelegateNoOfActiveAcc_CommentByKeyword = new CommentByKeywordAccount (AccountReportActiveAccount_CommentByKeyword);
			CommentByKeywordManager.objDelegateNoOfDeadAcc_CommentByKeyword = new CommentByKeywordAccount (AccountReportDeadAccount_CommentByKeyword);

			FollowByKeywordManager.objFollowByKeywordDelegate = new AccountReport_FollowByKeyword (AccountReport_FollowByKeyword);
			FollowByKeywordManager.objDelegateNoOfActiveAcc_FollowByKeyword = new FollowByKeywordAccount (AccountReportActiveAccount_FollowByKeyword);
			FollowByKeywordManager.objDelegateNoOfDeadAcc_FollowByKeyword = new FollowByKeywordAccount (AccountReportDeadAccount_FollowByKeyword);

			FollowByUsernameManager.objFollowByUsernameDelegate = new AccountReport_FollowByUsername (AccountReport_FollowByUsername);
			FollowByUsernameManager.objDelegateNoOfActiveAcc_FollowByUsername = new FollowByUsernameAccount (AccountReportActiveAccount_FollowByUsername);
			FollowByUsernameManager.objDelegateNoOfDeadAcc_FollowByUsername = new FollowByUsernameAccount (AccountReportDeadAccount_FollowByUsername);

			UnFollowManager.objUnFollowDelegate = new AccountReport_UnFollow (AccountReport_UnFollow);
			UnFollowManager.objDelegateNoOfActiveAcc_UnFollow = new UnFollowAccount (AccountReportActiveAccount_UnFollow);
			UnFollowManager.objDelegateNoOfDeadAcc_UnFollow = new UnFollowAccount (AccountReportDeadAccount_UnFollow);

			LikeManagers.objLikeDelegate = new AccortReport_Like (AccountReport_Like);
			LikeManagers.objDelegateNoOfActiveAcc_Like = new LikeAccount (AccountReportActiveAccount_Like);
			LikeManagers.objDelegateNoOfDeadAcc_Like = new LikeAccount (AccountReportDeadAccount_Like);

			LikeByKeywordManager.objLikeByKeywordDelegate = new AccountReport_LikeByKeyword (AccountReport_LikeByKeyword);
			LikeByKeywordManager.objDelegateNoOfActiveAcc_LikeByKeyword = new LikeByKeywordAccount (AccountReportActiveAccount_LikeByKeyword);
			LikeByKeywordManager.objDelegateNoOfDeadAcc_LikeByKeyword = new LikeByKeywordAccount (AccountReportDeadAccount_LikeByKeyword);

			AddNewPinManager.objAddNewPinDelegate = new AccountReport_AddNewPin (AccountReport_AddNewPin);
			AddNewPinManager.objDelegateNoOfActiveAcc_AddNewPin = new AddNewPinAccount (AccountReportActiveAccount_AddNewPin);
			AddNewPinManager.objDelegateNoOfDeadAcc_AddNewPin = new AddNewPinAccount (AccountReportDeadAccount_AddNewPin);

			//AccountReport_AddNewPin
			try
			{
				AccounLoad();
			}
			catch (Exception ex)
			{
				Console.Write (ex.Message);
			}
			intializeAllDelegate ();
			try
			{
			objMainWindow = this;
			}
			catch{
			};
	}
        private void OpenMainForm()
        {
            try
            {
                Application.Current.Dispatcher.Invoke((Action)(() =>
                {
                    MainWindow mainFrm = new MainWindow();
                    mainFrm.Show();
                    this.Close();
                }));
              

               
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(ex.StackTrace);
            }
        }