Ejemplo n.º 1
0
        private void BackupDeleteScheme(Group backupGroup, CursorScheme scheme)
        {
            if (backupGroup == null)
            {
                return;
            }

            RegistryOperation deleteSchemeOp = new RegistryOperation(backupGroup);

            deleteSchemeOp.RegKey   = @"HKEY_CURRENT_USER\Control Panel\Cursors\Schemes";
            deleteSchemeOp.RegName  = scheme.SchemeName;
            deleteSchemeOp.RegValue = "###ANOLISREMOVE####";
            deleteSchemeOp.RegKind  = RegistryValueKind.String;

            backupGroup.Operations.Add(deleteSchemeOp);

            foreach (CursorEntry entry in scheme.Cursors)
            {
                if (File.Exists(entry.CursorFilename))
                {
                    FileOperation op = new FileOperation(backupGroup, entry.CursorFilename);
                    backupGroup.Operations.Add(op);
                }
            }
        }
Ejemplo n.º 2
0
        protected static void MakeRegOp(Group backupGroup, String keyPath, String valueName)
        {
            String v = (String)Registry.GetValue(keyPath, valueName, null);

            if (v == null)
            {
                return;
            }

            RegistryOperation op = new RegistryOperation(backupGroup);

            op.RegKey   = keyPath;
            op.RegName  = valueName;
            op.RegValue = v;
            op.RegKind  = RegistryValueKind.String;

            backupGroup.Operations.Add(op);
        }
Ejemplo n.º 3
0
        private void Backup(Group backupGroup)
        {
            if (backupGroup == null)
            {
                return;
            }

            // get the current value and write it

            Object v = Registry.GetValue(RegKey, RegName, null);
            // TODO: In future, get the value's kind before writing, don't use the currently specified RegKind attribute

            RegistryOperation op = new RegistryOperation(backupGroup);

            op.RegKey  = RegKey;
            op.RegName = RegName;
            op.RegKind = RegKind;              // there is an NRE here apparently

            op.RegValue = v == null ? "###ANOLISREMOVE####" : v.ToString();

            backupGroup.Operations.Add(op);
        }