Example #1
0
 public void SetProgressTarget(ProgressReporterInterface progressTarget)
 {
     trace.TraceInformation("FamilyFileEncoderCollection.SetProgressTarget()");
     if (selectedEncoder != null)
     {
         selectedEncoder.SetProgressTarget(progressTarget);
     }
     else
     {
         storedProgressTarget = progressTarget;
     }
 }
Example #2
0
        public void StoreFile(FamilyTreeStoreBaseClass familyTree, string filename, FamilyFileTypeOperation operation, int variant = 0)
        {
            trace.TraceInformation("FamilyFileEncoderCollection.StoreFile({0},{1})", filename, variant);

            if (encoderMapList.Count == 0)
            {
                // We should never have to generate a filter
                // list with only one variant at this level...
                // The variant parameter has another meaning in this
                // class compared to real encoder classes...
                GetFileTypeFilter(operation);
            }
            if (variant < encoderMapList.Count)
            {
                selectedEncoder = encoderMapList[variant].encoder;
                if (storedProgressTarget != null)
                {
                    selectedEncoder.SetProgressTarget(storedProgressTarget);
                    storedProgressTarget = null;
                }
                selectedEncoder.StoreFile(familyTree, filename, operation, encoderMapList[variant].variant);
                return;
            }
            foreach (FamilyFileEncoder encoder in encoderList)
            {
                if (encoder.IsKnownFileType(filename))
                {
                    selectedEncoder = encoder;
                    if (storedProgressTarget != null)
                    {
                        encoder.SetProgressTarget(storedProgressTarget);
                        storedProgressTarget = null;
                    }
                    encoder.StoreFile(familyTree, filename, operation, variant);
                }
            }
        }