예제 #1
0
        public void StartLogging(string strOperation, bool bWriteOperationToLog)
        {
            Debug.Assert(!m_bActive);

            if (m_sbDefault != null)
            {
                m_sbDefault.StartLogging(strOperation, bWriteOperationToLog);
            }
            if (m_slForm != null)
            {
                m_slForm.StartLogging(strOperation, bWriteOperationToLog);
            }
            if (m_fTaskbarWindow != null)
            {
                TaskbarList.SetProgressValue(m_fTaskbarWindow, 0, 100);
                SetStyle(TbpFlag.Indeterminate);
            }

            m_bActive = true;

            if (bWriteOperationToLog)
            {
                m_vCachedMessages.Add(new KeyValuePair <LogStatusType, string>(
                                          LogStatusType.Info, strOperation));
            }
        }
예제 #2
0
        public bool SetProgress(uint uPercent)
        {
            Debug.Assert(m_bActive);

            bool b = !m_bCancelled;

            if (m_sbDefault != null)
            {
                if (!m_sbDefault.SetProgress(uPercent))
                {
                    b = false;
                }
            }
            if (m_slForm != null)
            {
                if (!m_slForm.SetProgress(uPercent))
                {
                    b = false;
                }
            }
            if (m_fTaskbarWindow != null)
            {
                TaskbarList.SetProgressValue(m_fTaskbarWindow, uPercent, 100);
                SetStyle((uPercent != 0) ? TbpFlag.Normal : TbpFlag.Indeterminate);
            }

            return(b);
        }
        public void StartLogging(string strOperation, bool bWriteOperationToLog)
        {
            Debug.Assert(!m_bStartedLogging && !m_bEndedLogging);

            if (m_sbDefault != null)
            {
                m_sbDefault.StartLogging(strOperation, bWriteOperationToLog);
            }
            if (m_slForm != null)
            {
                m_slForm.StartLogging(strOperation, bWriteOperationToLog);
            }
            if (m_fTaskbarWindow != null)
            {
                TaskbarList.SetProgressValue(m_fTaskbarWindow, 0, 100);
                TaskbarList.SetProgressState(m_fTaskbarWindow, TbpFlag.Normal);
            }

            m_bStartedLogging = true;

            if (bWriteOperationToLog)
            {
                m_vCachedMessages.Add(new KeyValuePair <LogStatusType, string>(
                                          LogStatusType.Info, strOperation));
            }
        }
        /// <summary>
        /// Set the current progress in percent.
        /// </summary>
        /// <param name="uPercent">Percent of work finished.</param>
        /// <returns>Returns <c>true</c> if the caller should continue
        /// the current work.</returns>
        public bool SetProgress(uint uPercent)
        {
            Debug.Assert(m_bStartedLogging && !m_bEndedLogging);

            bool b = true;

            if (m_sbDefault != null)
            {
                if (!m_sbDefault.SetProgress(uPercent))
                {
                    b = false;
                }
            }
            if (m_slForm != null)
            {
                if (!m_slForm.SetProgress(uPercent))
                {
                    b = false;
                }
            }
            if (m_fTaskbarWindow != null)
            {
                TaskbarList.SetProgressValue(m_fTaskbarWindow, uPercent, 100);
            }

            return(b);
        }
예제 #5
0
 public void EndLogging()
 {
     if (m_mf != null)
     {
         m_mf.UIBlockInteraction(false);
         TaskbarList.SetProgressState(m_mf, TbpFlag.NoProgress);
     }
 }
예제 #6
0
 public void StartLogging(string strOperation, bool bWriteOperationToLog)
 {
     if (m_mf != null)
     {
         TaskbarList.SetProgressState(m_mf, TbpFlag.Indeterminate);
         m_mf.UIBlockInteraction(true);
     }
 }
예제 #7
0
        private void SetStyle(TbpFlag f)
        {
            if (m_fTaskbarWindow == null)
            {
                return;
            }

            if (f != m_tbpfLast)
            {
                TaskbarList.SetProgressState(m_fTaskbarWindow, f);
                m_tbpfLast = f;
            }
        }
        public void EndLogging()
        {
            Debug.Assert(m_bStartedLogging && !m_bEndedLogging);

            if (m_sbDefault != null)
            {
                m_sbDefault.EndLogging();
            }
            if (m_slForm != null)
            {
                m_slForm.EndLogging();
            }
            if (m_fTaskbarWindow != null)
            {
                TaskbarList.SetProgressState(m_fTaskbarWindow, TbpFlag.NoProgress);
            }

            m_bEndedLogging = true;
        }