示例#1
0
        /// <summary>
        /// Called when [start get tree].
        /// </summary>
        /// <returns>OnStartCreateDrivesTreeResponse object.if successful return a "CreateDrivesTreeStarted" Message and record tree to Tree_Creator.sqlite database of windows dir include files else return error</returns>
        public OnStartCreateDrivesTreeResponse OnStartCreateDrivesTree()
        {
            OnStartCreateDrivesTreeResponse ROnStartCreateDrivesTreeResponse = new OnStartCreateDrivesTreeResponse();

            try
            {
                JArray JTrees = new JArray();

                if (mfmt == null)
                {
                    mfmt = new Tree_Creator._m_File_Manager_Tree();
                    Thread Tree_CreatorThread = new Thread(new ThreadStart(mfmt.Record_Drive_Tree));
                    Tree_CreatorThread.Start();
                    ROnStartCreateDrivesTreeResponse.Description = "CreateDrivesTreeStarted";
                }
                else
                {
                    ROnStartCreateDrivesTreeResponse.Description = "CreateDrivesTreeStartedBefore";
                }
            }
            catch (Exception ex)
            {
                ROnStartCreateDrivesTreeResponse.Errors.AddErrorToErrorList(MethodBase.GetCurrentMethod().ToString(), ex.Message);
            }

            return(ROnStartCreateDrivesTreeResponse);
        }
示例#2
0
        /// <summary>
        /// Called when [stop create drives tree].
        /// </summary>
        /// <returns>OnStopCreateDrivesTreeResponse object</returns>
        public OnStopCreateDrivesTreeResponse OnStopCreateDrivesTree()
        {
            OnStopCreateDrivesTreeResponse ROnStopCreateDrivesTreeResponse = new OnStopCreateDrivesTreeResponse();

            try
            {
                if (mfmt != null)
                {
                    mfmt.keepRunning = false;
                    mfmt             = null;
                    ROnStopCreateDrivesTreeResponse.Description = "CreateDrivesTreeStoped";
                }
                else
                {
                    ROnStopCreateDrivesTreeResponse.Description = "CreateDrivesTreeStopedBefore";
                }
            }
            catch (Exception ex)
            {
                ROnStopCreateDrivesTreeResponse.Errors.AddErrorToErrorList(MethodBase.GetCurrentMethod().ToString(), ex.Message);
            }
            return(ROnStopCreateDrivesTreeResponse);
        }