/// <summary>
        /// New Start Debug Command Events Before Execution Event Handler. Call the method responsible for building the app.
        /// </summary>
        /// <param name="Guid"> Command GUID. </param>
        /// <param name="ID"> Command ID. </param>
        /// <param name="CustomIn"> Custom IN Object. </param>
        /// <param name="CustomOut"> Custom OUT Object. </param>
        /// <param name="CancelDefault"> Cancel the default execution of the command. </param>
        private void startDebugCommandEvents_BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
        {
            bool bbPlatform = false;

            if (_dte.Solution.SolutionBuild.ActiveConfiguration != null)
            {
                SolutionContexts scCollection = _dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts;
                foreach (SolutionContext sc in scCollection)
                {
                    if (sc.PlatformName == "BlackBerry" || sc.PlatformName == "BlackBerrySimulator")
                    {
                        bbPlatform = true;
                        if (sc.PlatformName == "BlackBerrySimulator")
                        {
                            _isSimulator = true;
                        }
                        else
                        {
                            _isSimulator = false;
                        }
                    }
                }
            }

            Debug.WriteLine("Before Start Debug");

            if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning || !bbPlatform)
            {
                // Disable the override of F5 (this allows the debugged process to continue execution)
                CancelDefault = false;
            }
            else
            {
                // Create a reference to the Output window.
                // Create a tool window reference for the Output window
                // and window pane.
                OutputWindow ow = ((DTE2)_dte).ToolWindows.OutputWindow;

                // Select the Build pane in the Output window.
                _owP = ow.OutputWindowPanes.Item("Build");
                _owP.Activate();


                UpdateManagerData upData = new UpdateManagerData(this);

                if (!upData.validateDeviceVersion(_isSimulator))
                {
                    CancelDefault = true;
                }
                else
                {
                    BuildBar();
                    CancelDefault = true;
                }
            }
        }