/// <summary> /// Converts the given value object to the specified type, using the specified context and culture information. /// </summary> /// <param name="context">An ITypeDescriptorContext that provides a format context.</param> /// <param name="culture">A CultureInfo. If a null reference (Nothing in Visual Basic) is passed, the current culture is assumed.</param> /// <param name="value">The Object to convert.</param> /// <param name="destinationType">The Type to convert the value parameter to.</param> /// <returns>An Object that represents the converted value.</returns> public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { // Can always convert to a string representation if (destinationType == typeof(string)) { // Cast to correct type ButtonSpecNavFixed buttonSpec = (ButtonSpecNavFixed)value; // Ask the button spec for the correct string return(buttonSpec.ToString()); } // Let base class attempt other conversions return(base.ConvertTo(context, culture, value, destinationType)); }
/// <summary> /// Gets the appropriate display location for the button. /// </summary> /// <param name="buttonSpec">ButtonSpec instance.</param> /// <returns>HeaderLocation value.</returns> public virtual HeaderLocation GetFixedButtonLocation(ButtonSpecNavFixed buttonSpec) { return(buttonSpec.HeaderLocation); }
/// <summary> /// Gets the appropriate display location for the button. /// </summary> /// <param name="buttonSpec">ButtonSpec instance.</param> /// <returns>HeaderLocation value.</returns> public override HeaderLocation GetFixedButtonLocation(ButtonSpecNavFixed buttonSpec) { // This mode only has a single location, the button bar return HeaderLocation.PrimaryHeader; }