Prev | Current Page 715 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

SetValue(titledThumbnail.ImageInfo,
textPhotographerFullName.Text);
}
catch (Exception err)
{
MessageBox.Show(this,
"Problem setting photographer's full name property: Source:" +
err.Source + " Message: " + err.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
PropertyDescriptor imageLocation = imageInfoProps["ImageLocation"];
if (imageLocation != null)
{
try
{
imageLocation.SetValue(titledThumbnail.ImageInfo,
imageLocation.Converter.ConvertFrom(
null, Application.CurrentCulture, textLocation.Text));
}
catch (Exception err)
{
MessageBox.Show(this,
"Problem setting image location property: Source:" +
err.Source + " Message: " + err.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
}
The first step in the code is to initialize the form??™s controls with the TitledThumbnail??™s
current values. The string properties ImageTitle, ImageLongDescription, ImageDate, and
PhotographerFullName are simple string assignments. Initializing the Location TextBox takes
advantage of the functionality provided by the LocationConverter type converter by calling the
ToString() method on the Location object to get the customized display of the latitude and
longitude. To initialize the Alignment ComboBox with values, we iterate over the custom enumeration
TitleAlignment with this code:
CHAPTER 11 ?–  DES IGN-TIME S UPPORT 555
private void PopulateAlignment()
{
foreach (object Align in Enum.


Pages:
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727