Ejemplo n.º 1
0
        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.";
            }
        }
Ejemplo n.º 2
0
 public void SetPropertyGridDataSource(MsiPropertyInfo[] props)
 {
     msiPropertyGrid.DataSource = props;
 }