void ConvertProject()
{
List<BaseProjectConverter> convertors = new List<BaseProjectConverter>();
Assembly archiverAssembly = this.GetType().Assembly;
foreach (Type type in archiverAssembly.GetTypes())
{
if (type.IsSubclassOf(typeof(BaseProjectConverter))) //是否是子类
convertors.Add(Activator.CreateInstance(type) as BaseProjectConverter);
}
if (CurrentVersion > Version)
{
for (int i = ; i < convertors.Count; i++)
{
BaseProjectConverter conv = convertors[i];
if (conv.AcceptedVersion == Version && conv.ResultVersion <= CurrentVersion)
{
conv.Convert(this);
convertors.RemoveAt(i);
i = ;
}
}
}
else
{
for (int i = ; i < convertors.Count; i++)
{
BaseProjectConverter conv = convertors[i];
if (conv.ResultVersion == CurrentVersion && conv.AcceptedVersion >= Version)
{
conv.ConvertBack(this);
convertors.RemoveAt(i);
i = ;
}
}
}
}