예제 #1
0
        /// <summary>
        /// Called when [stop black software un installer].
        /// </summary>
        /// <returns>OnStopBlackSoftwareUnInstallerResponse object.if successful un init object mbsm of _m_Black_Software_Manager and then stop it and return "BlackSoftwareUnInstallerStoped" message if the black fostware manager is already stoped return "BlackSoftwareUnInstallerStopedBefore" message else return error</returns>
        public OnStopBlackSoftwareUnInstallerResponse OnStopBlackSoftwareUnInstaller()
        {
            OnStopBlackSoftwareUnInstallerResponse ROnStopBlackSoftwareUnInstallerResponse = new OnStopBlackSoftwareUnInstallerResponse();

            try
            {
                if (mbsm != null)
                {
                    mbsm.keepRunning = false;
                    mbsm             = null;
                    ROnStopBlackSoftwareUnInstallerResponse.Description = "BlackSoftwareUnInstallerStoped";
                }
                else
                {
                    ROnStopBlackSoftwareUnInstallerResponse.Description = "BlackSoftwareUnInstallerStopedBefore";
                }
            }
            catch (Exception ex)
            {
                ROnStopBlackSoftwareUnInstallerResponse.Errors.AddErrorToErrorList(MethodBase.GetCurrentMethod().ToString(), ex.Message);
            }
            return(ROnStopBlackSoftwareUnInstallerResponse);
        }
예제 #2
0
        /// <summary>
        /// Called when [start black software un installer].
        /// </summary>
        /// <returns>OnStartBlackSoftwareUnInstallerResponse object.if successful init object mbsm of _m_Black_Software_Manager and then start it and return "BlackSoftwareUnInstallerStarted" message if the black process manager is already running return "BlackSoftwareUnInstallerStartedBefore" message else return error</returns>
        public OnStartBlackSoftwareUnInstallerResponse OnStartBlackSoftwareUnInstaller()
        {
            OnStartBlackSoftwareUnInstallerResponse ROnStartBlackSoftwareUnInstallerResponse = new OnStartBlackSoftwareUnInstallerResponse();

            try
            {
                if (mbsm == null)
                {
                    mbsm = new _m_Black_Software_Manager();
                    mbsm.StartWatching();
                    ROnStartBlackSoftwareUnInstallerResponse.Description = "BlackSoftwareUnInstallerStarted";
                }
                else
                {
                    ROnStartBlackSoftwareUnInstallerResponse.Description = "BlackSoftwareUnInstallerStartedBefore";
                }
            }
            catch (Exception ex)
            {
                ROnStartBlackSoftwareUnInstallerResponse.Errors.AddErrorToErrorList(MethodBase.GetCurrentMethod().ToString(), ex.Message);
            }
            return(ROnStartBlackSoftwareUnInstallerResponse);
        }