Esempio n. 1
0
        private Module CreateModule(bool full)
        {
            var hash = string.Empty;

            if (System.IO.File.Exists(_symbolManager.ModulePath))
            {
                hash = HashFile(_symbolManager.ModulePath);
            }
            var module = new Module
            {
                ModuleName = _symbolManager.ModuleName,
                FullName   = _symbolManager.ModulePath,
                ModuleHash = hash
            };

            module.Aliases.Add(_symbolManager.ModulePath);

            if (full)
            {
                module.Files   = _symbolManager.GetFiles();
                module.Classes = _symbolManager.GetInstrumentableTypes();
                foreach (var @class in module.Classes)
                {
                    BuildClassModel(@class, module.Files);
                }
            }
            return(module);
        }
Esempio n. 2
0
        private Module CreateModule(bool full)
        {
            var hash      = string.Empty;
            var timeStamp = DateTime.MinValue;

            if (System.IO.File.Exists(_symbolManager.ModulePath))
            {
                try {
                    timeStamp = System.IO.File.GetLastWriteTimeUtc(_symbolManager.ModulePath);
                } catch (Exception e) {
                    e.InformUser();
                }
                hash = HashFile(_symbolManager.ModulePath);
            }
            var module = new Module
            {
                ModuleName = _symbolManager.ModuleName,
                ModulePath = _symbolManager.ModulePath,
                ModuleHash = hash,
                ModuleTime = timeStamp
            };

            module.Aliases.Add(_symbolManager.ModulePath);

            if (full)
            {
                module.Files   = _symbolManager.GetFiles();
                module.Classes = _symbolManager.GetInstrumentableTypes();
                foreach (var @class in module.Classes)
                {
                    BuildClassModel(@class, module.Files);
                }
            }
            return(module);
        }