public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { if ((value == null)) { return(null); } SealKind valueCasted = ((SealKind)(value)); if ((valueCasted == SealKind.Lead)) { return("lead"); } if ((valueCasted == SealKind.Other)) { return("other"); } if ((valueCasted == SealKind.Steel)) { return("steel"); } if ((valueCasted == SealKind.Lock)) { return("lock"); } throw new ArgumentOutOfRangeException("value"); }
public override void SetProperty(Property property) { switch (property.Id) { case ModelCode.SEAL_APPLIEDTIME: appliedDateTime = property.AsLong(); break; case ModelCode.SEAL_CONDITION: condition = (SealConditionKind)property.AsEnum(); break; case ModelCode.SEAL_KIND: kind = (SealKind)property.AsEnum(); break; case ModelCode.SEAL_SEALNUMBER: sealNumber = property.AsString(); break; default: base.SetProperty(property); break; } }