48 {
49 if (destinationType == null)
50 {
51 throw new ArgumentNullException("destinationType");
52 }
53 if (
value is Version version)
54 {
56 {
58 {
59 typeof(int),
60 typeof(int),
61 typeof(int),
62 typeof(int)
63 }, null);
64 return new InstanceDescriptor(constructor,
new object[4] { version.Major, version.Minor, version.Build, version.Revision });
65 }
66 if (destinationType == typeof(string))
67 {
68 return version.ToString();
69 }
70 if (destinationType == typeof(Version))
71 {
72 return new Version(version.Major, version.Minor, version.Build, version.Revision);
73 }
74 }
75 return base.ConvertTo(context,
culture,
value, destinationType);
76 }