コード例 #1
0
        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());
        }
コード例 #2
0
 ///<summary>Sets the value of the <c>&lt;UsageLocationInfo&gt;</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 ) );
 }
コード例 #3
0
 /// <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;
 }