public void CreateEnergyUsage() { BinaryData binaryData = new BinaryData() { Value = "urn:sif:school:AcmeMiddleSchool1.CoyoteDistrict.Arizona" }; UsageLocationInfo usageLocationInfo = new UsageLocationInfo() { SchoolId = binaryData }; ReadingData readingData = new ReadingData() { EnergyUnits = "$Kilowatt-Hour" }; ReadingDataList readingDataList = new ReadingDataList() { readingData }; DataSource dataSource = new DataSource() { ReadingDataList = readingDataList }; EnergyUsage energyUsage = new EnergyUsage() { UsageLocationInfo = usageLocationInfo, DataSource = dataSource }; if (log.IsDebugEnabled) log.Debug("EnergyUsage instance: " + energyUsage.ToXml()); Console.WriteLine("EnergyUsage instance: " + energyUsage.ToXml()); }
///<summary>Sets the value of the <c><UsageLocationInfo></c> element.</summary> /// <param name="SchoolId">"e.g., urn:sif:school:AcmeMiddleSchool1.CoyoteDistrict.Arizona. /// e.g., urn:sif:school:AcmeMiddleSchool1.CoyoteDistrict.Arizona."</param> /// <param name="Building">Name of the School Building.</param> ///<remarks> /// <para>This form of <c>setUsageLocationInfo</c> is provided as a convenience method /// that is functionally equivalent to the <c>UsageLocationInfo</c></para> /// <para>Version: 2.6</para> /// <para>Since: 2.6</para> /// </remarks> public void SetUsageLocationInfo( BinaryData SchoolId, string Building ) { RemoveChild( EnergymanagementDTD.ENERGYUSAGE_USAGELOCATIONINFO); AddChild( EnergymanagementDTD.ENERGYUSAGE_USAGELOCATIONINFO, new UsageLocationInfo( SchoolId, Building ) ); }
/// <summary> /// Constructor that accepts values for all mandatory fields /// </summary> ///<param name="schoolId">"e.g., urn:sif:school:AcmeMiddleSchool1.CoyoteDistrict.Arizona. /// e.g., urn:sif:school:AcmeMiddleSchool1.CoyoteDistrict.Arizona."</param> ///<param name="building">Name of the School Building.</param> /// public UsageLocationInfo( BinaryData schoolId, string building ) : base(EnergymanagementDTD.USAGELOCATIONINFO) { this.SchoolId = schoolId; this.Building = building; }