Example #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);
        }
Example #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);
        }
Example #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;
        }
Example #4
0
 /// <summary>
 /// Aggregate for the meta info class
 /// An aggregate is an "in between" object between the element set and XmlFile.
 /// <seealso cref="HydroNumerics.OpenMI.Sdk.DevelopmentSupport.IAggregate"></seealso>/>
 /// <seealso cref="HydroNumerics.OpenMI.Sdk.DevelopmentSupport.XmlFile"></seealso>/>
 /// </summary>
 public MetaInfoClassAggregate(object source)
 {
     _class = (MetaInfoClass)source;
     UpdateAggregate();
 }
Example #5
0
		/// <summary>
		/// Aggregate for the meta info class
		/// An aggregate is an "in between" object between the element set and XmlFile.
		/// <seealso cref="HydroNumerics.OpenMI.Sdk.DevelopmentSupport.IAggregate"></seealso>/>
		/// <seealso cref="HydroNumerics.OpenMI.Sdk.DevelopmentSupport.XmlFile"></seealso>/>
		/// </summary>
		public MetaInfoClassAggregate (object source)
		{
			_class = (MetaInfoClass) source;
			UpdateAggregate();
		}
Example #6
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;
		}