public static bool Convert(ConversionStage stage)
 {
     if (!NeedsConversion(stage.ConverterVersion()))
     {
         return(false);
     }
     return(Instance().RunConversions(stage));
 }
Exemple #2
0
 public static bool Convert(ConversionStage stage)
 {
     if (!NeedsConversion(stage.ConverterVersion()))
     {
         return false;
     }
     return Instance().RunConversions(stage);
 }
Exemple #3
0
 public virtual bool RunConversions(ConversionStage stage)
 {
     var startingVersion = Math.Max(stage.ConverterVersion() + 1, _minimumVersion);
     for (var version = startingVersion; version <= Version; version++)
     {
         var conversion = ConversionFor(version);
         if (conversion == null)
         {
             throw new InvalidOperationException("Could not find a conversion for version " +
                                                 version);
         }
         stage.Accept(conversion);
     }
     return true;
 }
        public virtual bool RunConversions(ConversionStage stage)
        {
            int startingVersion = Math.Max(stage.ConverterVersion() + 1, _minimumVersion);

            for (int version = startingVersion; version <= Version; version++)
            {
                Conversion conversion = ConversionFor(version);
                if (conversion == null)
                {
                    throw new InvalidOperationException("Could not find a conversion for version " +
                                                        version);
                }
                stage.Accept(conversion);
            }
            return(true);
        }