Reply to thread

no problem..


u can even do something like:


[code]


IList<TuningDetail> tuningDetails;

bool hasTuningDetails = d.TryGetValue(channel.IdChannel, out tuningDetails);

if (hasTuningDetails)

{

   foreach (TuningDetail detail in tuningDetails)

          {

            if (detail.FreeToAir)

            {

              hasFta = true;

            }

            if (!detail.FreeToAir)

            {

              hasScrambled = true;

            }

          }

}


...


if (hasTuningDetails && tuningDetails.Count > 0)

{

  item.SubItems.Add(tuningDetails[0].ChannelNumber.ToString());

}


[/code]


this way we avoid the  "tuningDetails = new List<TuningDetail>();"


try catch in a loop is often costly, but only if it runs into the catch part ... try is for "free" though :)


/gibman


Top Bottom