System.ComponentModel.AmbientValueAttribute.AmbientValueAttribute C# (CSharp) Method

AmbientValueAttribute() public method

public AmbientValueAttribute ( Type type, string value ) : System
type Type
value string
return System
        public AmbientValueAttribute(Type type, string value) {
        
            // The try/catch here is because attributes should never throw exceptions.  We would fail to
            // load an otherwise normal class.
            try {
                this.value = TypeDescriptor.GetConverter(type).ConvertFromInvariantString(value);
            }
            catch {
                Debug.Fail("Ambient value attribute of type " + type.FullName + " threw converting from the string '" + value + "'.");
            }
        }

Same methods

AmbientValueAttribute::AmbientValueAttribute ( bool value ) : System
AmbientValueAttribute::AmbientValueAttribute ( byte value ) : System
AmbientValueAttribute::AmbientValueAttribute ( char value ) : System
AmbientValueAttribute::AmbientValueAttribute ( double value ) : System
AmbientValueAttribute::AmbientValueAttribute ( float value ) : System
AmbientValueAttribute::AmbientValueAttribute ( int value ) : System
AmbientValueAttribute::AmbientValueAttribute ( long value ) : System
AmbientValueAttribute::AmbientValueAttribute ( object value ) : System
AmbientValueAttribute::AmbientValueAttribute ( short value ) : System
AmbientValueAttribute::AmbientValueAttribute ( string value ) : System