Ejemplo n.º 1
0
        /// <summary>
        /// Tells whether a value is stored for a property and subject in the class
        /// </summary>
        /// <param name="property">The property name</param>
        /// <param name="subject">The subject</param>
        /// <returns>Indication of presence of the property and subject</returns>
        public bool Contains(string property, string subject)
        {
            if (property == null)
            {
                return(_classProperties.Contains(subject));
            }

            MetaInfoClass metaInfo = this.GetMetaInfo(property);

            if (metaInfo != null)
            {
                return(metaInfo.Contains(subject));
            }

            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the stored value for a subject and property in the class
        /// </summary>
        /// <param name="property">The property</param>
        /// <param name="subject">The subject</param>
        /// <returns>The stored value, null if not found</returns>
        public object GetValue(string property, string subject)
        {
            if (property == null)
            {
                return(this.GetValue(subject));
            }

            MetaInfoClass metaInfo = this.GetMetaInfo(property);

            if (metaInfo != null)
            {
                return(metaInfo[subject]);
            }

            return(null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Stores a new value for a subject and property in the class
        /// </summary>
        /// <param name="property">The property</param>
        /// <param name="subject">The subject</param>
        /// <param name="targetValue">The new value</param>
        public void SetValue(string property, string subject, object targetValue)
        {
            if (property == null)
            {
                this.SetValue(subject, targetValue);
                return;
            }

            MetaInfoClass metaInfo = this.GetMetaInfo(property);

            if (metaInfo == null)
            {
                metaInfo = new MetaInfoClass(property);
                _properties.Add(metaInfo);
            }

            metaInfo[subject] = targetValue;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Aggregate for the meta info class
 /// An aggregate is an "in between" object between the element set and XmlFile.
 /// <seealso cref="Oatc.OpenMI.Sdk.DevelopmentSupport.IAggregate"></seealso>/>
 /// <seealso cref="Oatc.OpenMI.Sdk.DevelopmentSupport.XmlFile"></seealso>/>
 /// </summary>
 public MetaInfoClassAggregate(object source)
 {
     _class = (MetaInfoClass)source;
     UpdateAggregate();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Stores a new value for a subject and property in the class
        /// </summary>
        /// <param name="property">The property</param>
        /// <param name="subject">The subject</param>
        /// <param name="targetValue">The new value</param>
        public void SetValue(string property, string subject, object targetValue)
        {
            if (property == null)
            {
                this.SetValue (subject, targetValue);
                return;
            }

            MetaInfoClass metaInfo = this.GetMetaInfo (property);
            if (metaInfo == null)
            {
                metaInfo = new MetaInfoClass (property);
                _properties.Add (metaInfo);
            }

            metaInfo[subject] = targetValue;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Aggregate for the meta info class
 /// An aggregate is an "in between" object between the element set and XmlFile.
 /// <seealso cref="Oatc.OpenMI.Sdk.DevelopmentSupport.IAggregate"></seealso>/>
 /// <seealso cref="Oatc.OpenMI.Sdk.DevelopmentSupport.XmlFile"></seealso>/>
 /// </summary>
 public MetaInfoClassAggregate(object source)
 {
     _class = (MetaInfoClass) source;
     UpdateAggregate();
 }