Esempio n. 1
0
        private void Backup(FileAssociations assoc, Group backupGroup)
        {
            if (backupGroup == null)
            {
                return;
            }

            // this method backs up settings for extensions that already exist
            // code for deleting newly-created extensions and types is in BackupPart2

            // NOTE: Delete the %windir%\resources\Icons directory?

            foreach (FileTypeSetting setting in _types)
            {
                FileExtension existingExtension = assoc.GetExtension(setting.TypeExt);
                if (existingExtension == null)
                {
                    continue;
                }

                FileType existingType = existingExtension.FileType;
                if (existingType == null)
                {
                    continue;
                }

                FileTypeOperation op = new FileTypeOperation(backupGroup);
                op.TypeExtension    = setting.TypeExt;
                op.TypeFriendlyName = setting.FriendlyName;
                op.TypeIcon         = existingType.DefaultIcon;

                backupGroup.Operations.Add(op);
            }
        }
Esempio n. 2
0
        public override bool Merge(Operation operation)
        {
            FileTypeOperation other = operation as FileTypeOperation;

            if (other == null)
            {
                return(false);
            }

            _types.AddRange(other._types);

            return(true);
        }