Eplan Platform API
Eplan.EplApi.MasterData Namespace / MDPropertyValue Class
Members Example

In This Topic
    MDPropertyValue Class
    In This Topic
    Class holding value of P8 Master Data property.
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.MasterData.MDPropertyValue

    Syntax
    [DefaultMember("Item")]
    public sealed class MDPropertyValue 
    [DefaultMember("Item")]
    public ref class MDPropertyValue sealed 
    Remarks

    MDPropertyValue object can be in one of three states: * Created by user. This object is not connected with any property list or object stored in master data database. It is and off-line property. * Collected from property list. It is an on-line property. * Collected from any master data object. It is an on-line property. In two last cases overloads of the PropertyValue::Set method: Eplan::EplApi::MDPropertyValue:, Eplan::EplApi::MDPropertyValue:, Eplan::EplApi::MDPropertyValue::Set(System: etc, are setting values in original locations.

    MDPropertyValue object can hold values of following types: * int, * string, * double, * bool, * DateTime * Eplan.EplApi.Base.MultiLangString, * Eplan.EplApi.Base.PointD. Class implements conversion operators that will simplify access to P8 property values stored inside of MDPropertyList class object. User does not have to use this class explicitly, it allows to assign P8 property value in a simple way. See example. Value of the property can be changed using overloads of the PropertyValue::Set method: Eplan::EplApi::MDPropertyValue:, Eplan::EplApi::MDPropertyValue:, Eplan::EplApi::MDPropertyValue::Set(System: etc.
    Example
    Please note that following code:
    MDPropertyValue oPv = oPart.Properties[Properties.MDPartsDatabaseItem.ARTICLE_DESCR1];
    oPv = oPv + " additional comment";
    //will create new off-line property value object and assign it into variable oPv.
    MDPart oPart = m_MDPartsDatabase.Parts[0]; //a valid master data part object
    
    //here MDPropertyValue is implicit created from int constant ('5') and it is assigned to the property list.
    oPart.Properties[Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.ARTICLE_HEIGHT] = 5;
    
    //here MDPropertyValue is implicit created from string constant ("7") and it is assigned to the property list.
    oPart.Properties[Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.ARTICLE_HEIGHT] = "7";
    
    //here MDPropertyValue is read form property list and implicit converted to string.
    string s = oPart.Properties[Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.ARTICLE_HEIGHT];
    
    //here MDPropertyValue is read form property list and implicit converted to int.
    int i = oPart.Properties[Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.ARTICLE_HEIGHT];
    Public Constructors
     NameDescription
    Public ConstructorDefault constructor. Creates a MDPropertyValue object.  
    Top
    Public Properties
     NameDescription
    Public PropertyReturns an object that provides information about the property and its definition. The information includes: name of the property, it's data type, whether it is indexed or not, whether it is read-only, upper/lower bounds of values for numerical properties.  
    Public PropertyReturns P8-Property descriptor ( id and index ) of the object. Off-line MDPropertyValue objects don't have descriptors because they point to value directly. off-line MDPropertyValue is created by operators that take base types values.  
    Public PropertyReturns array of indexes for which property value is not empty. It can be used with MDPropertyValue::operator [];  
    Public PropertyChecks if property value is empty. If its not it can be read. IMPORTANT: If property is indexed you have to specify index.  
    Public PropertyReturns MDPropertyValue object at specified index.  
    Public PropertyReturns number of highest used index. Index value starts from 1. If it is not indexed-property or there index is not used, LastUsedIndex is 0; Object of MDPropertyValue have to point to on-line property.  
    Public PropertyProperty list to which this property value is connected.  
    Top
    Public Methods
     NameDescription
    Public MethodDestructor for deterministic finalization of MDPropertyValue object.  
    Public MethodDisplay value of property as Eplan.EplApi.Base.MultiLangString.  
    Public MethodOverloaded. Sets System.DateTime value in MDPropertyValue object.  
    Public MethodConverts this MDPropertyValue object to System::Boolean.  
    Public MethodConverts this MDPropertyValue object to doule.  
    Public MethodConverts this MDPropertyValue object to long.  
    Public MethodConverts this MDPropertyValue object to Eplan.EplApi.Base.MultiLangString.  
    Public MethodConversion this MDPropertyValue object to Eplan.EplApi.Base.PointD.  
    Public MethodOverloaded. Returns string value of this property. When type of property is MultiLangString then only specified language is returned. In case of off-line MDPropertyValue object, stored value is returned without any cast. When property can not be read, default_value is returned instead of throwing MDEmptyPropertyException .  
    Public MethodConverts this MDPropertyValue object to System::DateTime.  
    Top
    Public Operators
    Overloaded. Converts MDPropertyValue object to long.
    Top
    See Also