/// ----------------------------------------------------------------------------- /// <summary> /// OnLoad runs when the control is loaded into the Control Tree /// </summary> /// <history> /// [cnurse] 12/23/2007 created /// </history> /// ----------------------------------------------------------------------------- protected override void OnLoad(EventArgs e) { base.OnLoad(e); foreach (ModuleAction action in ModuleActions) { if (action != null && ActionManager.IsVisible(action)) { //Create a new ActionCommandButton var actionButton = new ActionCommandButton(); //Set all the properties actionButton.ModuleAction = action; actionButton.ModuleControl = ModuleControl; actionButton.CommandName = CommandName; actionButton.CssClass = CssClass; actionButton.DisplayLink = DisplayLink; actionButton.DisplayIcon = DisplayIcon; actionButton.ImageUrl = ImageURL; //Add a handler for the Action Event actionButton.Action += ActionButtonClick; Controls.Add(actionButton); Controls.Add(new LiteralControl(ButtonSeparator)); } } Visible = (Controls.Count > 0); }
/// ----------------------------------------------------------------------------- /// <summary> /// OnLoad runs when the control is loaded into the Control Tree. /// </summary> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.ModuleControl == null) { return; } foreach (ModuleAction action in this.ModuleActions) { if (action != null && this.ActionManager.IsVisible(action)) { // Create a new ActionCommandButton var actionButton = new ActionCommandButton(); // Set all the properties actionButton.ModuleAction = action; actionButton.ModuleControl = this.ModuleControl; actionButton.CommandName = this.CommandName; actionButton.CssClass = this.CssClass; actionButton.DisplayLink = this.DisplayLink; actionButton.DisplayIcon = this.DisplayIcon; actionButton.ImageUrl = this.ImageURL; // Add a handler for the Action Event actionButton.Action += this.ActionButtonClick; this.Controls.Add(actionButton); this.Controls.Add(new LiteralControl(this.ButtonSeparator)); } } this.Visible = this.Controls.Count > 0; }
/// ----------------------------------------------------------------------------- /// <summary> /// OnLoad runs when the control is loaded into the Control Tree /// </summary> /// <history> /// [cnurse] 12/23/2007 created /// </history> /// ----------------------------------------------------------------------------- protected override void OnLoad(EventArgs e) { base.OnLoad(e); foreach (ModuleAction action in ModuleActions) { if (action != null && ActionManager.IsVisible(action)) { //Create a new ActionCommandButton var actionButton = new ActionCommandButton(); //Set all the properties actionButton.ModuleAction = action; actionButton.ModuleControl = ModuleControl; actionButton.CommandName = CommandName; actionButton.CssClass = CssClass; actionButton.DisplayLink = DisplayLink; actionButton.DisplayIcon = DisplayIcon; actionButton.ImageUrl = ImageURL; //Add a handler for the Action Event actionButton.Action += ActionButtonClick; Controls.Add(actionButton); Controls.Add(new LiteralControl(ButtonSeparator)); } } Visible = (Controls.Count > 0); }