private MsiPropertyInfo(int id, object value) { ID = id; Value = value; MsiPropertyInfo prototype = GetPropertyInfoByID(id); if (prototype != null) { Name = prototype.Name; _propertyType = prototype._propertyType; Description = prototype.Description; _valueFormatString = prototype._valueFormatString; switch (_propertyType) { case VT.FILETIME: //everything is coming from wix as a string, need to submit patch to wix: // _value = DateTime.FromFileTime((long)_value); break; case VT.I2: case VT.I4: if (Value is string && Value != null && ((string)Value).Length > 0) { try { Value = Int32.Parse((string)Value); } catch (FormatException) {} } break; } } else { Name = "non-standard"; _propertyType = VT.EMPTY; Description = "Unknown."; } }
private MsiPropertyInfo(MsiPropertyInfo prototype, object value) { ID = prototype.ID; Value = value; if (prototype != null) { Name = prototype.Name; PropertyType = prototype.PropertyType; Description = prototype.Description; _valueFormatString = prototype._valueFormatString; switch (PropertyType) { case VT.FILETIME: // Nothing to do here, we already converted it break; case VT.I2: case VT.I4: if (Value is string && Value != null && ((string)Value).Length > 0) { try { Value = Int32.Parse((string)Value); } catch (FormatException) {} } break; } } else { Name = "non-standard"; PropertyType = VT.EMPTY; Description = "Unknown."; } }
public void SetPropertyGridDataSource(MsiPropertyInfo[] props) { msiPropertyGrid.DataSource = props; }