Пример #1
0
        /// <summary>
        /// Imports a new ProfilingResult into the current solution and raises
        /// an CountersImported event
        /// </summary>
        /// <returns>A list of all fileNames whose files have been changed since the last parse time</returns>
        public static ArrayList ImportProfilingResults(ProfilingResult sfc)
        {
            ArrayList list = currentSolution.ImportCounters(sfc);

            Changed(ProfItAction.CountersImported, sfc);
            return(list);
        }
Пример #2
0
        /// <summary>
        /// This method completely deletes all previous counters
        /// and imports the new profiling result.
        /// </summary>
        /// <param name="sfc">the new profiling results</param>
        internal ArrayList ImportCounters(ProfilingResult sfc)
        {
            ArrayList changedFiles = new ArrayList();

            foreach (Project project in projects)
            {
                foreach (SourceFile file in project.Files)
                {
                    CounterCollection cc = sfc[file.FileName];
                    if (cc == null)
                    {
                        continue;
                    }
                    if (File.GetLastWriteTime(file.FileName) < sfc[file.FileName].LastParseTime)
                    {
                        file.SetCounters(sfc[file.FileName]);
                    }
                    else
                    {
                        sfc.RemoveCounters(file.FileName);
                        changedFiles.Add(file.FileName);
                    }
                }
            }
            this.sfc = sfc;
            sfc.CalculateStatisticalValues();
            return(changedFiles);
        }
Пример #3
0
 public bool CheckCounters(ProfilingResult sfc)
 {
     foreach (CounterCollection cc in sfc.GetCounters())
     {
         SourceFile file = this.FindFile(cc.FileName);
         if (file == null)
         {
             return(false);
         }
         if (System.IO.File.GetLastWriteTime(file.FileName) >= sfc.LastModification)
         {
             return(false);
         }
     }
     return(true);
 }
Пример #4
0
 internal void UpdateProfilingResult()
 {
     sfc = new ProfilingResult();
     sfc.LastModification = DateTime.Now;
     foreach (Project project in projects)
     {
         foreach (SourceFile file in project.Files)
         {
             if (file.Profile && file.Counters != null)
             {
                 sfc.Add(file.Counters);
             }
         }
     }
     sfc.CalculateStatisticalValues();
 }