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

CanConvertFrom() public method

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

Usage Example

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

            var mode = (ReinstallModes)converter.ConvertFrom("omUS");
            Assert.AreEqual(Default, mode);
        }
All Usage Examples Of Microsoft.Tools.WindowsInstaller.ReinstallModesConverter::CanConvertFrom