New

Item Type Property: provide method to set Read-Only in schema definition

An Item Type property has several attributes that can be set, along these lines...

CustomPropertyP p1 = ecItemType.AddProperty (L"prop-name", false);
if (nullptr != p1)
{
  p1->SetType (prop.CustomPropertyType ());
  p1->SetIsArray (false);
  p1->SetDefaultValue (value);
}

An attribute that is not provided is Read-Only.  That is, a user should not be able to change that property's value in the user interface.  My idea is for a CustomProperty::SetReadOnly() method.

Parents
  • I down-voted the idea because of these reasons:

    • By definition, Item Types provide a simplified way for users and (consequently) applications. To extend API when it's not really necessary and well justified, it polutes API.
    • ItemTypes are user tool. It means API should follow GUI features; GUI and API should be equal. To allow to define read-only property does not make any sense from user perspective, because such property cannot be edited consequently. When it makes no sense at GUI level, there is no reason to add it to API only.
    • In fact this feature exists already in MicroStation API: custom EC schema. To try to hack ItemType (as users oriented tool), to be used for other purposes, is a proof that a wrong tool is used. When read-only property is required, in my opinion the right solution is to leave ItemTypes API and to move to full EC API where literaly anything can be defined.

    Regards,

      Jan

  • Take a  look at DgnECInstance::SetReadOnly.  By your reasoning, we should petition Bentley to remove that method.

Comment Children
No Data