Example #1
0
        // =========================================================================================
        // Methods
        // =========================================================================================

        /// <summary>
        /// Sets the node property.
        /// </summary>
        /// <param name="propid">Property id.</param>
        /// <param name="value">Property value.</param>
        /// <returns>Returns success or failure code.</returns>
        public override int SetProperty(int propid, object value)
        {
            int         result;
            __VSHPROPID id = (__VSHPROPID)propid;

            switch (id)
            {
            case __VSHPROPID.VSHPROPID_IsNonMemberItem:
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }

                bool boolValue = false;
                CCITracing.TraceCall(this.ID + "," + id.ToString());
                if (bool.TryParse(value.ToString(), out boolValue))
                {
                    this.isNonMemberItem = boolValue;
                }
                else
                {
                    WixHelperMethods.TraceFail("Could not parse the IsNonMemberItem property value.");
                }

                result = VSConstants.S_OK;
                break;

            default:
                result = base.SetProperty(propid, value);
                break;
            }

            return(result);
        }
Example #2
0
        // =========================================================================================
        // Methods
        // =========================================================================================

        /// <summary>
        /// Sets the node property.
        /// </summary>
        /// <param name="propid">Property id.</param>
        /// <param name="value">Property value.</param>
        /// <returns>Returns success or failure code.</returns>
        public override int SetProperty(int propid, object value)
        {
            int         result;
            __VSHPROPID id = (__VSHPROPID)propid;

            switch (id)
            {
            case __VSHPROPID.VSHPROPID_IsNonMemberItem:
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }

                bool boolValue;
                CCITracing.TraceCall(this.ID + "," + id.ToString());
                if (Boolean.TryParse(value.ToString(), out boolValue))
                {
                    this.isNonMemberItem = boolValue;

                    // Reset exclude from scc
                    this.ExcludeNodeFromScc = this.IsNonMemberItem;
                }
                else
                {
                    XHelperMethods.TraceFail("Could not parse the IsNonMemberItem property value.");
                }

                result = VSConstants.S_OK;
                break;

            default:
                ThreadHelper.ThrowIfNotOnUIThread();
                result = base.SetProperty(propid, value);
                break;
            }

            return(result);
        }