Exemplo n.º 1
0
        // Method to store the intervals (in percent complete) from the current invocation of
        // the splash screen to the registry.
        private void StoreIncrements()
        {
            string sPercent = "";
            double dblElapsedMilliseconds = ElapsedMilliSeconds();

            for (int i = 0; i < m_alActualTimes.Count; i++)
            {
                sPercent += ((double)m_alActualTimes[i] / dblElapsedMilliseconds).ToString("0.####", System.Globalization.NumberFormatInfo.InvariantInfo) + " ";
            }

            //http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx?df=100&forumid=26207&mpp=50&noise=1&fr=1&select=2603941&fid=26207#xx2603941xx
            TimeStampObserverDataLayer.SetStringValue(REGVALUE_PB_PERCENTS, sPercent);

            m_dblPBIncrementPerTimerInterval = 1.0 / (double)m_iActualTicks;
            //http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx?df=100&forumid=26207&mpp=50&noise=1&fr=1&select=2603941&fid=26207#xx2603941xx
            TimeStampObserverDataLayer.SetStringValue(REGVALUE_PB_MILISECOND_INCREMENT, m_dblPBIncrementPerTimerInterval.ToString("#.000000", System.Globalization.NumberFormatInfo.InvariantInfo));
        }
Exemplo n.º 2
0
        // Function to read the checkpoint intervals from the previous invocation of the
        // splashscreen from the registry.
        private void ReadIncrements()
        {
            //UPDATE : http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx?df=100&forumid=26207&mpp=50&noise=1&fr=1&select=2603941&fid=26207#xx2603941xx
            string sPBIncrementPerTimerInterval = TimeStampObserverDataLayer.GetStringValue(REGVALUE_PB_MILISECOND_INCREMENT, "0.0015");
            double dblResult;

            if (Double.TryParse(sPBIncrementPerTimerInterval, System.Globalization.NumberStyles.Float, System.Globalization.NumberFormatInfo.InvariantInfo, out dblResult) == true)
            {
                m_dblPBIncrementPerTimerInterval = dblResult;
            }
            else
            {
                m_dblPBIncrementPerTimerInterval = .0015;
            }

            //UPDATE : http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx?df=100&forumid=26207&mpp=50&noise=1&fr=1&select=2603941&fid=26207#xx2603941xx
            string sPBPreviousPctComplete = TimeStampObserverDataLayer.GetStringValue(REGVALUE_PB_PERCENTS, "");

            if (sPBPreviousPctComplete != "")
            {
                string[] aTimes = sPBPreviousPctComplete.Split(null);
                m_alPreviousCompletionFraction = new ArrayList();

                for (int i = 0; i < aTimes.Length; i++)
                {
                    double dblVal;
                    if (Double.TryParse(aTimes[i], System.Globalization.NumberStyles.Float, System.Globalization.NumberFormatInfo.InvariantInfo, out dblVal))
                    {
                        m_alPreviousCompletionFraction.Add(dblVal);
                    }
                    else
                    {
                        m_alPreviousCompletionFraction.Add(1.0);
                    }
                }
            }
            else
            {
                m_bFirstLaunch = true;
                // UPDATE :http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx?df=100&forumid=26207&mpp=50&noise=1&fr=1&select=2771540&fid=26207#xx2771540xx
                SetRemainintTimeCrossThread("");
            }
        }