private bool GetBuilderGuidString(NativeMethods.IProvidePropertyBuilder target, int dispid, ref string strGuidBldr, int[] bldrType)
        {
            bool builderAvailable = false;

            string[] pbstrGuidBldr = new string[1];
            if (NativeMethods.Failed(target.MapPropertyToBuilder(dispid, bldrType, pbstrGuidBldr, ref builderAvailable)))
            {
                builderAvailable = false;
            }
            if (builderAvailable && ((bldrType[0] & 2) == 0))
            {
                builderAvailable = false;
            }
            if (!builderAvailable)
            {
                return(false);
            }
            if (pbstrGuidBldr[0] == null)
            {
                strGuidBldr = Guid.Empty.ToString();
            }
            else
            {
                strGuidBldr = pbstrGuidBldr[0];
            }
            return(true);
        }
        private bool GetBuilderGuidString(NativeMethods.IProvidePropertyBuilder target, int dispid, ref string strGuidBldr, int[] bldrType)
        {
            bool valid = false;

            string[] pGuidBldr = new string[1];
            if (NativeMethods.Failed(target.MapPropertyToBuilder(dispid, bldrType, pGuidBldr, ref valid)))
            {
                valid = false;
            }

            if (valid && (bldrType[0] & _CTLBLDTYPE.CTLBLDTYPE_FINTERNALBUILDER) == 0)
            {
                valid = false;
                Debug.Fail("Property Browser doesn't support standard builders -- NYI");
            }

            if (!valid)
            {
                return(false);
            }

            if (pGuidBldr[0] == null)
            {
                strGuidBldr = Guid.Empty.ToString();
            }
            else
            {
                strGuidBldr = pGuidBldr[0];
            }
            return(true);
        }
Exemple #3
0
        private unsafe bool GetBuilderGuidString(NativeMethods.IProvidePropertyBuilder target, Ole32.DispatchID dispid, ref string strGuidBldr, int[] bldrType)
        {
            BOOL valid     = BOOL.FALSE;
            var  pGuidBldr = new string[1];

            if (!target.MapPropertyToBuilder(dispid, bldrType, pGuidBldr, &valid).Succeeded())
            {
                return(false);
            }

            if (valid.IsTrue() && (bldrType[0] & _CTLBLDTYPE.CTLBLDTYPE_FINTERNALBUILDER) == 0)
            {
                Debug.Fail("Property Browser doesn't support standard builders -- NYI");
                return(false);
            }

            strGuidBldr = pGuidBldr[0] ?? Guid.Empty.ToString();
            return(true);
        }