Example #1
0
        /// <summary>
        /// Transforms a string in the short form of REINSTALLMODE to a <see cref="Microsoft.Deployment.WindowsInstaller.ReinstallModes"/> enumeration.
        /// </summary>
        /// <param name="engineIntrinsics">Provides access to the APIs for managing the transformation context.</param>
        /// <param name="inputData">The parameter argument that is to be transformed.</param>
        /// <returns>The transformed object.</returns>
        public override object Transform(EngineIntrinsics engineIntrinsics, object inputData)
        {
            if (null == inputData)
            {
                return null;
            }

            var converter = new ReinstallModesConverter();
            if (converter.CanConvertFrom(inputData.GetType()))
            {
                var mode = converter.ConvertFrom(inputData);
                return mode;
            }

            // Return the source data for other transformations in the chain.
            return inputData;
        }
Example #2
0
        /// <summary>
        /// Transforms a string in the short form of REINSTALLMODE to a <see cref="Microsoft.Deployment.WindowsInstaller.ReinstallModes"/> enumeration.
        /// </summary>
        /// <param name="engineIntrinsics">Provides access to the APIs for managing the transformation context.</param>
        /// <param name="inputData">The parameter argument that is to be transformed.</param>
        /// <returns>The transformed object.</returns>
        public override object Transform(EngineIntrinsics engineIntrinsics, object inputData)
        {
            if (null == inputData)
            {
                return(null);
            }

            var converter = new ReinstallModesConverter();

            if (converter.CanConvertFrom(inputData.GetType()))
            {
                var mode = converter.ConvertFrom(inputData);
                return(mode);
            }

            // Return the source data for other transformations in the chain.
            return(inputData);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RepairProductCommand"/> class.
 /// </summary>
 public RepairProductCommand()
 {
     this.ReinstallMode = RepairProductActionData.Default;
     this.converter     = new ReinstallModesConverter();
 }