Exemple #1
0
 private void ExtractFileList <T>(HACmdLineFSEntityList <T> aList, SXILElementCategory aCategory, bool aExpandDirectoriesToUnderlyingFiles) where T : HACmdLineFSEntity, new()
 {
     foreach (SXILElement element in aCategory)
     {
         if (element is SXILElementFile)
         {
             SXILElementFile file = (SXILElementFile)element;
             Trace("[CmdInput] ExtractFileList() - file: " + file);
             if (!file.Exists)
             {
                 throw new FileNotFoundException("File not found", file.Name);
             }
             //
             aList.Add(file);
         }
         else if (element is SXILElementDirectory)
         {
             SXILElementDirectory dir = (SXILElementDirectory)element;
             Trace("[CmdInput] ExtractFileList() - dir:  " + dir);
             if (!dir.Exists)
             {
                 throw new DirectoryNotFoundException("Directory not found: " + dir.Name);
             }
             //
             if (aExpandDirectoriesToUnderlyingFiles)
             {
                 aList.AddRange(dir.Files);
             }
             else
             {
                 aList.Add(dir.Directory);
             }
         }
     }
 }
Exemple #2
0
        private void PrimeDebugEngine()
        {
            DbgEngine debugEngine = base.Engine.DebugEngine;
            //
            Exception primerException = null;
            HACmdLineFSEntityList <HACmdLineFSEntity> metaDataFiles = iInputs.MetaDataFiles;

            //
            try
            {
                debugEngine.Clear();

                foreach (HACmdLineFSEntity entry in metaDataFiles)
                {
                    Trace("[HA Cmd] Seeding debug meta engine with entry: " + entry.Name);
                    DbgEntity entity = debugEngine.Add(entry.Name);
                    if (entity != null)
                    {
                        Trace("[HA Cmd] Entry type detected as: [" + entity.CategoryName + "]");
                        entity.Tag = entry;
                    }
                    else
                    {
                        Trace("[HA Cmd] Entry not handled: " + entry.Name);
                    }
                }

                // Listen to prime events
                try
                {
                    Trace("[HA Cmd] Starting prime operation... ");
                    debugEngine.EntityPrimingStarted  += new DbgEngine.EventHandler(DbgEngine_EntityPrimingStarted);
                    debugEngine.EntityPrimingProgress += new DbgEngine.EventHandler(DbgEngine_EntityPrimingProgress);
                    debugEngine.EntityPrimingComplete += new DbgEngine.EventHandler(DbgEngine_EntityPrimingComplete);
                    debugEngine.Prime(TSynchronicity.EAsynchronous);
                    Trace("[HA Cmd] Debug meta data priming completed successfully.");
                }
                finally
                {
                    debugEngine.EntityPrimingStarted  -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingStarted);
                    debugEngine.EntityPrimingProgress -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingProgress);
                    debugEngine.EntityPrimingComplete -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingComplete);
                }
            }
            catch (Exception exception)
            {
                Trace("[HA Cmd] Debug meta data priming exception: " + exception.Message + ", " + exception.StackTrace);
                primerException = exception;
            }
        }