Prev | Current Page 835 | Next

Rob Cameron and Dale Michalk

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

ComponentModel;
using System.ComponentModel.Design;
using System.Web.UI;
using System.Web.UI.Design;
namespace ControlsBook2Lib.CH12.LiveSearchControls.Design
{
///
/// Designer class for the Result server control
///

public class ResultDesigner : ControlDesigner
{
TemplateGroupCollection templateGroupCol;
///
/// Initialize the resources of the designer
///

/// Component which the designer is linked to
public override void Initialize(IComponent component)
{
base.Initialize(component);
if (!(component is Result) && !(component is INamingContainer))
{
throw new ArgumentException(
"This control is not a Result control.", "component");
}
else
SetViewFlags(ViewFlags.TemplateEditing, true);
}
///
/// Pointer to template editing menu items
///

public override TemplateGroupCollection TemplateGroups
{
get
{
if (templateGroupCol == null)
{
// Get the base collection
templateGroupCol = base.TemplateGroups;
CHAPTER 13 ?–  P ACKAGI NG AND DEPLOYMENT 661
TemplateGroup templateGroup;
TemplateDefinition templateDef;
Result ctl;
//Get reference to the component as Result
ctl = (Result)Component;
//Create Template Group
templateGroup = new TemplateGroup("TemplateMenu Templates");
//Status
templateDef = new TemplateDefinition(this, "Status",
ctl, "StatusTemplate", false);
templateGroup.


Pages:
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847