Microsoft.Tools.WindowsInstaller.ReinstallModesConverter.CanConvertTo C# (CSharp) Method

CanConvertTo() public method

Returns True when destinationType is a String.
public CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool
context ITypeDescriptorContext Additional context for conversion.
destinationType System.Type The type of the destination object.
return bool
        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
        {
            return typeof(string) == destinationType;
        }

Usage Example

        public void ConvertReinstallModesToShortForm()
        {
            var converter = new ReinstallModesConverter();
            Assert.IsTrue(converter.CanConvertTo(typeof(string)));

            var mode = (string)converter.ConvertTo(Default, typeof(string));
            Assert.AreEqual("omus", mode);
        }
All Usage Examples Of Microsoft.Tools.WindowsInstaller.ReinstallModesConverter::CanConvertTo