ChangeDetector.DetectorUtilitiesRegistry.MakeRegistrySnapshot C# (CSharp) Method

MakeRegistrySnapshot() public static method

Makes a complete snapshot of all registry hives in both the Win64 view (if available) and the Win32 view.
public static MakeRegistrySnapshot ( ) : SnapshotRegistry
return SnapshotRegistry
        public static SnapshotRegistry MakeRegistrySnapshot()
        {
            SnapshotRegistry res = new SnapshotRegistry();

            SnapshotRegistryPartial partial = new SnapshotRegistryPartial();
            partial.BasePath = "HKEY_CLASSES_ROOT";
            partial.Items = DoRegistrySnapshotHive(RegistryHive.ClassesRoot);

            res.PartialSnapshots.Add(partial);

            partial = new SnapshotRegistryPartial();
            partial.BasePath = "HKEY_CURRENT_CONFIG";
            partial.Items = DoRegistrySnapshotHive(RegistryHive.CurrentConfig);

            res.PartialSnapshots.Add(partial);

            partial = new SnapshotRegistryPartial();
            partial.BasePath = "HKEY_CURRENT_USER";
            partial.Items = DoRegistrySnapshotHive(RegistryHive.CurrentUser);

            res.PartialSnapshots.Add(partial);

            partial = new SnapshotRegistryPartial();
            partial.BasePath = "HKEY_LOCAL_MACHINE";
            partial.Items = DoRegistrySnapshotHive(RegistryHive.LocalMachine);

            res.PartialSnapshots.Add(partial);

            partial = new SnapshotRegistryPartial();
            partial.BasePath = "HKEY_PERFORMANCE_DATA";
            partial.Items = DoRegistrySnapshotHive(RegistryHive.PerformanceData);

            res.PartialSnapshots.Add(partial);

            partial = new SnapshotRegistryPartial();
            partial.BasePath = "HKEY_USERS";
            partial.Items = DoRegistrySnapshotHive(RegistryHive.Users);

            res.PartialSnapshots.Add(partial);

            return res;
        }