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