private void RenderVerbsInTitleBar(HtmlTextWriter writer, WebPart webPart, int colspan) { WebPartVerbCollection verbs = GetWebPartVerbs(webPart); verbs = FilterWebPartVerbs(verbs, webPart); if (verbs != null && verbs.Count > 0) { writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap"); colspan++; writer.RenderBeginTag(HtmlTextWriterTag.Td); if (Zone.RenderClientScript && (Zone.WebPartVerbRenderMode == WebPartVerbRenderMode.Menu) && Zone.Menu != null) { if (_designMode) { Zone.Menu.Render(writer, webPart.WholePartID + "Verbs"); } else { // If Zone.RenderClientScript, then WebPartManager must not be null Debug.Assert(WebPartManager != null); Zone.Menu.Render(writer, verbs, webPart.WholePartID + "Verbs", webPart, WebPartManager); } } else { RenderVerbs(writer, webPart, verbs); } writer.RenderEndTag(); // Td } }
private void RenderVerbsInTitleBar(HtmlTextWriter writer, WebPart webPart, int colspan) { WebPartVerbCollection webPartVerbs = this.GetWebPartVerbs(webPart); webPartVerbs = this.FilterWebPartVerbs(webPartVerbs, webPart); if ((webPartVerbs != null) && (webPartVerbs.Count > 0)) { writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap"); colspan++; writer.RenderBeginTag(HtmlTextWriterTag.Td); if ((this.Zone.RenderClientScript && (this.Zone.WebPartVerbRenderMode == WebPartVerbRenderMode.Menu)) && (this.Zone.Menu != null)) { if (this._designMode) { this.Zone.Menu.Render(writer, webPart.WholePartID + "Verbs"); } else { this.Zone.Menu.Render(writer, webPartVerbs, webPart.WholePartID + "Verbs", webPart, this.WebPartManager); } } else { this.RenderVerbs(writer, webPart, webPartVerbs); } writer.RenderEndTag(); } }
protected WebPart() { verbs = new WebPartVerbCollection(); allow = Allow.Close | Allow.Connect | Allow.Edit | Allow.Hide | Allow.Minimize | Allow.ZoneChange; auth_filter = ""; catalog_icon_url = ""; titleIconImageUrl = string.Empty; titleUrl = string.Empty; helpUrl = string.Empty; isStatic = false; hasUserData = false; hasSharedData = false; hidden = false; isClosed = false; }
protected WebPart () { verbs = new WebPartVerbCollection(); allow = Allow.Close | Allow.Connect | Allow.Edit | Allow.Hide | Allow.Minimize | Allow.ZoneChange; auth_filter = ""; catalog_icon_url = ""; titleIconImageUrl = string.Empty; titleUrl = string.Empty; helpUrl = string.Empty; isStatic = false; hasUserData = false; hasSharedData = false; hidden = false; isClosed = false; }
private void Initialize(WebPartVerbCollection existingVerbs, ICollection verbs) { int count = ((existingVerbs != null) ? existingVerbs.Count : 0) + ((verbs != null) ? verbs.Count : 0); _ids = new HybridDictionary(count, /* caseInsensitive */ true); if (existingVerbs != null) { foreach (WebPartVerb existingVerb in existingVerbs) { // Don't need to check arg, since we know it is valid since it came // from a CatalogPartCollection. if (_ids.Contains(existingVerb.ID)) { throw new ArgumentException(SR.GetString(SR.WebPart_Collection_DuplicateID, "WebPartVerb", existingVerb.ID), "existingVerbs"); } _ids.Add(existingVerb.ID, existingVerb); InnerList.Add(existingVerb); } } if (verbs != null) { foreach (object obj in verbs) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "verbs"); } WebPartVerb webPartVerb = obj as WebPartVerb; if (webPartVerb == null) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartVerb"), "verbs"); } if (_ids.Contains(webPartVerb.ID)) { throw new ArgumentException(SR.GetString(SR.WebPart_Collection_DuplicateID, "WebPartVerb", webPartVerb.ID), "verbs"); } _ids.Add(webPartVerb.ID, webPartVerb); InnerList.Add(webPartVerb); } } }
private void RenderVerbs(HtmlTextWriter writer, WebPart webPart, WebPartVerbCollection verbs) { if (verbs == null) { throw new ArgumentNullException("verbs"); } WebPartVerb verb = null; foreach (WebPartVerb verb2 in verbs) { if ((verb != null) && (this.VerbRenderedAsLinkButton(verb2) || this.VerbRenderedAsLinkButton(verb))) { writer.Write(" "); } this.RenderVerb(writer, webPart, verb2); verb = verb2; } }
protected virtual WebPartVerbCollection FilterWebPartVerbs(WebPartVerbCollection verbs, WebPart webPart) { if (verbs == null) { throw new ArgumentNullException("verbs"); } if (webPart == null) { throw new ArgumentNullException("webPart"); } WebPartVerbCollection verbs2 = new WebPartVerbCollection(); foreach (WebPartVerb verb in verbs) { if (this.ShouldRenderVerb(verb, webPart)) { verbs2.Add(verb); } } return(verbs2); }
private void RenderVerbs(HtmlTextWriter writer, WebPart webPart, WebPartVerbCollection verbs) { if (verbs == null) { throw new ArgumentNullException("verbs"); } WebPartVerb priorVerb = null; foreach (WebPartVerb verb in verbs) { // If you are rendering as a linkbutton, OR the prior verb rendered as a linkbutton, // render an " " prior to yourself. This ensures that all linkbuttons are preceeded // and followed by a space. if (priorVerb != null && (VerbRenderedAsLinkButton(verb) || VerbRenderedAsLinkButton(priorVerb))) { writer.Write(" "); } RenderVerb(writer, webPart, verb); priorVerb = verb; } }
private void Initialize(WebPartVerbCollection existingVerbs, ICollection verbs) { int initialSize = ((existingVerbs != null) ? existingVerbs.Count : 0) + ((verbs != null) ? verbs.Count : 0); this._ids = new HybridDictionary(initialSize, true); if (existingVerbs != null) { foreach (WebPartVerb verb in existingVerbs) { if (this._ids.Contains(verb.ID)) { throw new ArgumentException(System.Web.SR.GetString("WebPart_Collection_DuplicateID", new object[] { "WebPartVerb", verb.ID }), "existingVerbs"); } this._ids.Add(verb.ID, verb); base.InnerList.Add(verb); } } if (verbs != null) { foreach (object obj2 in verbs) { if (obj2 == null) { throw new ArgumentException(System.Web.SR.GetString("Collection_CantAddNull"), "verbs"); } WebPartVerb verb2 = obj2 as WebPartVerb; if (verb2 == null) { throw new ArgumentException(System.Web.SR.GetString("Collection_InvalidType", new object[] { "WebPartVerb" }), "verbs"); } if (this._ids.Contains(verb2.ID)) { throw new ArgumentException(System.Web.SR.GetString("WebPart_Collection_DuplicateID", new object[] { "WebPartVerb", verb2.ID }), "verbs"); } this._ids.Add(verb2.ID, verb2); base.InnerList.Add(verb2); } } }
private void Initialize(WebPartVerbCollection existingVerbs, ICollection verbs) { int initialSize = ((existingVerbs != null) ? existingVerbs.Count : 0) + ((verbs != null) ? verbs.Count : 0); this._ids = new HybridDictionary(initialSize, true); if (existingVerbs != null) { foreach (WebPartVerb verb in existingVerbs) { if (this._ids.Contains(verb.ID)) { throw new ArgumentException(System.Web.SR.GetString("WebPart_Collection_DuplicateID", new object[] { "WebPartVerb", verb.ID }), "existingVerbs"); } this._ids.Add(verb.ID, verb); base.InnerList.Add(verb); } } if (verbs != null) { foreach (object obj2 in verbs) { if (obj2 == null) { throw new ArgumentException(System.Web.SR.GetString("Collection_CantAddNull"), "verbs"); } WebPartVerb verb2 = obj2 as WebPartVerb; if (verb2 == null) { throw new ArgumentException(System.Web.SR.GetString("Collection_InvalidType", new object[] { "WebPartVerb" }), "verbs"); } if (this._ids.Contains(verb2.ID)) { throw new ArgumentException(System.Web.SR.GetString("WebPart_Collection_DuplicateID", new object[] { "WebPartVerb", verb2.ID }), "verbs"); } this._ids.Add(verb2.ID, verb2); base.InnerList.Add(verb2); } } }
private void Initialize(WebPartVerbCollection existingVerbs, ICollection verbs) { int count = ((existingVerbs != null) ? existingVerbs.Count : 0) + ((verbs != null) ? verbs.Count : 0); _ids = new HybridDictionary(count, /* caseInsensitive */ true); if (existingVerbs != null) { foreach (WebPartVerb existingVerb in existingVerbs) { // Don't need to check arg, since we know it is valid since it came // from a CatalogPartCollection. if (_ids.Contains(existingVerb.ID)) { throw new ArgumentException(SR.GetString(SR.WebPart_Collection_DuplicateID, "WebPartVerb", existingVerb.ID), "existingVerbs"); } _ids.Add(existingVerb.ID, existingVerb); InnerList.Add(existingVerb); } } if (verbs != null) { foreach (object obj in verbs) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "verbs"); } WebPartVerb webPartVerb = obj as WebPartVerb; if (webPartVerb == null) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartVerb"), "verbs"); } if (_ids.Contains(webPartVerb.ID)) { throw new ArgumentException(SR.GetString(SR.WebPart_Collection_DuplicateID, "WebPartVerb", webPartVerb.ID), "verbs"); } _ids.Add(webPartVerb.ID, webPartVerb); InnerList.Add(webPartVerb); } } }
public WebPartVerbsEventArgs (WebPartVerbCollection verbs) { }
/// <devdoc> /// Load the verbs defined by the page developer or zone subclass. /// </devdoc> private void CreateZoneVerbs() { WebPartVerbsEventArgs args = new WebPartVerbsEventArgs(); OnCreateVerbs(args); _verbs = args.Verbs; }
public WebPartVerbsEventArgs(WebPartVerbCollection verbs) { _verbs = verbs; }
protected virtual new WebPartVerbCollection FilterWebPartVerbs(WebPartVerbCollection verbs, WebPart webPart) { return default(WebPartVerbCollection); }
// Called from WebPartChrome and DesignerWebPartChrome. Can't be passed as argument to // RenderWebPart, since the WebPartZoneDesigner calls RenderWebPart as well. internal WebPartVerbCollection VerbsForWebPart(WebPart webPart) { WebPartVerbCollection verbs = new WebPartVerbCollection(); WebPartVerbCollection partVerbs = webPart.Verbs; if (partVerbs != null) { foreach (WebPartVerb verb in partVerbs) { if (verb.ServerClickHandler != null) { verb.SetEventArgumentPrefix(partVerbEventArgumentWithSeparator); } verbs.Add(verb); } } if (_verbs != null) { foreach (WebPartVerb verb in _verbs) { if (verb.ServerClickHandler != null) { verb.SetEventArgumentPrefix(zoneVerbEventArgumentWithSeparator); } verbs.Add(verb); } } WebPartVerb minimizeVerb = MinimizeVerb; minimizeVerb.SetEventArgumentPrefix(minimizeEventArgumentWithSeparator); verbs.Add(minimizeVerb); WebPartVerb restoreVerb = RestoreVerb; restoreVerb.SetEventArgumentPrefix(restoreEventArgumentWithSeparator); verbs.Add(restoreVerb); WebPartVerb closeVerb = CloseVerb; closeVerb.SetEventArgumentPrefix(closeEventArgumentWithSeparator); verbs.Add(closeVerb); WebPartVerb deleteVerb = DeleteVerb; deleteVerb.SetEventArgumentPrefix(deleteEventArgumentWithSeparator); verbs.Add(deleteVerb); WebPartVerb editVerb = EditVerb; editVerb.SetEventArgumentPrefix(editEventArgumentWithSeparator); verbs.Add(editVerb); WebPartVerb connectVerb = ConnectVerb; connectVerb.SetEventArgumentPrefix(connectEventArgumentWithSeparator); verbs.Add(connectVerb); // Export does not post back verbs.Add(ExportVerb); // Help verb does not post back verbs.Add(HelpVerb); return verbs; }
protected virtual WebPartVerbCollection FilterWebPartVerbs(WebPartVerbCollection verbs, WebPart webPart) { if (verbs == null) { throw new ArgumentNullException("verbs"); } if (webPart == null) { throw new ArgumentNullException("webPart"); } WebPartVerbCollection filteredVerbs = new WebPartVerbCollection(); foreach (WebPartVerb verb in verbs) { if (ShouldRenderVerb(verb, webPart)) { filteredVerbs.Add(verb); } } return filteredVerbs; }
private void RenderVerbs(HtmlTextWriter writer, WebPart webPart, WebPartVerbCollection verbs) { if (verbs == null) { throw new ArgumentNullException("verbs"); } WebPartVerb priorVerb = null; foreach (WebPartVerb verb in verbs) { // If you are rendering as a linkbutton, OR the prior verb rendered as a linkbutton, // render an " " prior to yourself. This ensures that all linkbuttons are preceeded // and followed by a space. if (priorVerb != null && (VerbRenderedAsLinkButton(verb) || VerbRenderedAsLinkButton(priorVerb))) { writer.Write(" "); } RenderVerb(writer, webPart, verb); priorVerb = verb; } }
protected virtual new WebPartVerbCollection FilterWebPartVerbs(WebPartVerbCollection verbs, WebPart webPart) { return(default(WebPartVerbCollection)); }
public WebPartVerbCollection(WebPartVerbCollection existingVerbs, ICollection verbs) { Initialize(existingVerbs, verbs); }
public WebPartVerbCollection(WebPartVerbCollection existingVerbs, ICollection verbs) { InnerList.AddRange(existingVerbs.InnerList); InnerList.AddRange(verbs); }
private void CreateZoneVerbs() { WebPartVerbsEventArgs e = new WebPartVerbsEventArgs(); this.OnCreateVerbs(e); this._verbs = e.Verbs; }
internal WebPartVerbCollection VerbsForWebPart(WebPart webPart) { WebPartVerbCollection verbs = new WebPartVerbCollection(); WebPartVerbCollection verbs2 = webPart.Verbs; if (verbs2 != null) { foreach (WebPartVerb verb in verbs2) { if (verb.ServerClickHandler != null) { verb.SetEventArgumentPrefix("partverb:"); } verbs.Add(verb); } } if (this._verbs != null) { foreach (WebPartVerb verb2 in this._verbs) { if (verb2.ServerClickHandler != null) { verb2.SetEventArgumentPrefix("zoneverb:"); } verbs.Add(verb2); } } WebPartVerb minimizeVerb = this.MinimizeVerb; minimizeVerb.SetEventArgumentPrefix("minimize:"); verbs.Add(minimizeVerb); WebPartVerb restoreVerb = this.RestoreVerb; restoreVerb.SetEventArgumentPrefix("restore:"); verbs.Add(restoreVerb); WebPartVerb closeVerb = this.CloseVerb; closeVerb.SetEventArgumentPrefix("close:"); verbs.Add(closeVerb); WebPartVerb deleteVerb = this.DeleteVerb; deleteVerb.SetEventArgumentPrefix("delete:"); verbs.Add(deleteVerb); WebPartVerb editVerb = this.EditVerb; editVerb.SetEventArgumentPrefix("edit:"); verbs.Add(editVerb); WebPartVerb connectVerb = this.ConnectVerb; connectVerb.SetEventArgumentPrefix("connect:"); verbs.Add(connectVerb); verbs.Add(this.ExportVerb); verbs.Add(this.HelpVerb); return verbs; }
protected override WebPartVerbCollection FilterWebPartVerbs(WebPartVerbCollection verbs, WebPart webPart) { WebPartVerbCollection filteredVerbs = base.FilterWebPartVerbs(verbs, webPart); var finalVerbs = new List<WebPartVerb>(); foreach (WebPartVerb verb in filteredVerbs) { //get images from the original verbs and set them on our new custom ones if (verb.ID == "customEditVerb") verb.ImageUrl = Zone.EditVerb.ImageUrl; else if (verb.ID == "customDeleteVerb") verb.ImageUrl = Zone.DeleteVerb.ImageUrl; else if (verb.ID == "customMinimizeVerb") verb.ImageUrl = Zone.MinimizeVerb.ImageUrl; else if (verb.ID == "customRestoreVerb") verb.ImageUrl = Zone.RestoreVerb.ImageUrl; if (!(verb.ID == "customRestoreVerb" && webPart.ChromeState == PartChromeState.Normal) && !(verb.ID == "customMinimizeVerb" && webPart.ChromeState == PartChromeState.Minimized)) finalVerbs.Add(verb); } return new WebPartVerbCollection(finalVerbs); }
private void RenderVerbs(HtmlTextWriter writer, WebPart webPart, WebPartVerbCollection verbs) { if (verbs == null) { throw new ArgumentNullException("verbs"); } WebPartVerb verb = null; foreach (WebPartVerb verb2 in verbs) { if ((verb != null) && (this.VerbRenderedAsLinkButton(verb2) || this.VerbRenderedAsLinkButton(verb))) { writer.Write(" "); } this.RenderVerb(writer, webPart, verb2); verb = verb2; } }
public WebPartVerbCollection(WebPartVerbCollection existingVerbs, ICollection verbs) { Initialize(existingVerbs, verbs); }
public WebPartVerbCollection (WebPartVerbCollection existingVerbs, ICollection verbs) { InnerList.AddRange (existingVerbs.InnerList); InnerList.AddRange (verbs); }