/// <summary> /// Fires the before content control load. /// </summary> /// <param name="e">The <see cref="umbraco.controls.ContentControlLoadEventArgs"/> instance containing the event data.</param> protected virtual void FireAfterContentControlLoad(ContentControlLoadEventArgs e) { if (AfterContentControlLoad != null) { AfterContentControlLoad(this, e); } }
/// <summary> /// Fires the before content control load. /// </summary> /// <param name="e">The <see cref="umbraco.controls.ContentControlLoadEventArgs"/> instance containing the event data.</param> protected virtual void FireBeforeContentControlLoad(ContentControlLoadEventArgs e) { if (BeforeContentControlLoad != null) { BeforeContentControlLoad(this, e); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ContentControlLoadEventArgs contentcontrolEvent = new ContentControlLoadEventArgs(); FireAfterContentControlLoad(contentcontrolEvent); }
/// <summary> /// Initializes the control and ensures child controls are setup /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { base.OnInit(e); EnsureChildControls(); // Add extras for the property tabpage. . ContentControlLoadEventArgs contentcontrolEvent = new ContentControlLoadEventArgs(); FireBeforeContentControlLoad(contentcontrolEvent); if (!contentcontrolEvent.Cancel) { NameTxt.ID = "NameTxt"; if (!Page.IsPostBack) { NameTxt.Text = _content.Text; } // Name validation NameTxtValidator.ControlToValidate = NameTxt.ID; _nameTxtCustomValidator.ControlToValidate = NameTxt.ID; string[] errorVars = { ui.Text("name") }; NameTxtValidator.ErrorMessage = " " + ui.Text("errorHandling", "errorMandatoryWithoutTab", errorVars, null) + "<br/>"; NameTxtValidator.EnableClientScript = false; NameTxtValidator.Display = ValidatorDisplay.Dynamic; _nameTxtCustomValidator.EnableClientScript = false; _nameTxtCustomValidator.Display = ValidatorDisplay.Dynamic; _nameTxtCustomValidator.ServerValidate += NameTxtCustomValidatorServerValidate; _nameTxtCustomValidator.ValidateEmptyText = false; NameTxtHolder.Controls.Add(NameTxt); NameTxtHolder.Controls.Add(NameTxtValidator); NameTxtHolder.Controls.Add(_nameTxtCustomValidator); PropertiesPane.addProperty(ui.Text("general", "name", null), NameTxtHolder); Literal ltt = new Literal(); ltt.Text = _content.User.Name; PropertiesPane.addProperty(ui.Text("content", "createBy", null), ltt); ltt = new Literal(); ltt.Text = _content.CreateDateTime.ToString(); PropertiesPane.addProperty(ui.Text("content", "createDate", null), ltt); ltt = new Literal(); ltt.Text = _content.Id.ToString(); PropertiesPane.addProperty("Id", ltt); if (_content is Media) { PropertiesPane.addProperty(ui.Text("content", "mediatype"), new LiteralControl(_content.ContentType.Alias)); } tpProp.Controls.AddAt(0, PropertiesPane); tpProp.Style.Add("text-align", "center"); } }
/// <summary> /// Fires the before content control load. /// </summary> /// <param name="e">The <see cref="umbraco.controls.ContentControlLoadEventArgs"/> instance containing the event data.</param> protected virtual void FireAfterContentControlLoad(ContentControlLoadEventArgs e) { if (AfterContentControlLoad != null) AfterContentControlLoad(this, e); }
/// <summary> /// Fires the before content control load. /// </summary> /// <param name="e">The <see cref="umbraco.controls.ContentControlLoadEventArgs"/> instance containing the event data.</param> protected virtual void FireBeforeContentControlLoad(ContentControlLoadEventArgs e) { if (BeforeContentControlLoad != null) BeforeContentControlLoad(this, e); }