Exemplo n.º 1
0
        /// <summary>
        /// get the value for the specified property. If the property does not exist, get default value
        /// without creating the property object
        /// </summary>
        /// <param name="control"></param>
        /// <param name="propId"></param>
        /// <param name="isDefaultValue"></param>
        /// <returns></returns>
        private static string GetRuntimeValueAsString(MgControlBase control, int propId, ref bool isDefaultValue)
        {
            Property prop = null;

            if (!control.PropertyExists(propId))
            {
                isDefaultValue = true;
            }
            else
            {
                prop = control.getProp(propId);
            }

            return(prop != null?prop.getValue() : string.Empty);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        /// <param name="properties"></param>
        static void BuildVisibleProperty(MgControlBase control, Dictionary <string, DesignerPropertyInfo> properties)
        {
            bool isDefaultvalue = false;
            bool value          = true;
            bool runtimeValue   = true;

            // value is always "true", unless defined otherwise in previous runtime designer executions
            if (control.PropertyExists(PropInterface.PROP_TYPE_VISIBLE))
            {
                Property prop = control.getProp(PropInterface.PROP_TYPE_VISIBLE);
                value        = !prop.IsDesignerValue();
                runtimeValue = GetRuntimeValueAsBool(control, PropInterface.PROP_TYPE_VISIBLE, ref isDefaultvalue);
            }
            properties.Add(Constants.WinPropVisible, new DesignerPropertyInfo()
            {
                VisibleInPropertyGrid = false, Value = value, IsDefaultValue = false, IsNativeProperty = false, RuntimeValue = runtimeValue
            });
        }