Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
using System;
using System.Collections.Generic;
using System.Linq;
using Alastri.RR.Ui;
using Alastri.RR.Service;

public class LabelFormat : ILabel
{   
    public string GetLabel(ShadingContext context)
    {
    List<string> temp = context.GetParcels();
	List<string> parcels = context.GetParcels( temp.ConvertAll(low => low.ToLowerInvariant());
	List<string> ores = new List<string>(){ "hg", "mg", "lg" };
		
	double oreTonnes = 0;
		
	foreach(var parcel in parcels)
	{
		if(ores.Any(ore => parcel.StartsWith(ore)))
		{
			oreTonnes += context.GetReserveValue("DryTonnes", parcel);
		}
	}
		
	return oreTonnes.ToString("#,##0");
    }
}

...