Click or drag to resize

RibbonBarAddIn Class

Represents a RibbonBar add-in.
Inheritance Hierarchy
SystemObject
  Dynamicweb.Controls.ExtensibilityRibbonBarAddIn

Namespace:  Dynamicweb.Controls.Extensibility
Assembly:  Dynamicweb.Controls (in Dynamicweb.Controls.dll) Version: 4.2.3
Syntax
public abstract class RibbonBarAddIn

The RibbonBarAddIn type exposes the following members.

Constructors
  NameDescription
Public methodRibbonBarAddIn
Initializes a new instance of an object.
Top
Properties
  NameDescription
Public propertyCanInstantiate
Gets value indicating whether add-in can be instantiated within the current container.
Public propertyPage
Gets an instance of Page object that contains an add-in.
Public propertyRibbon
Gets an instance of RibbonBar object that contains an add-in.
Protected propertyTrace
Gets a reference to a trace object that can be used to write trace information to the output.
Public propertyWindows
Gets a list of all pop-up windows associated with this add-in.
Top
Methods
  NameDescription
Public methodAddWindow
Adds new pop-up window.
Public methodContainsWindow
Determines whether specified add-in contains specified pop-up window.
Public methodStatic memberCreateAddInInstance
Creates an instance of the specified RibbonBar add-in.
Protected methodCreateDefaultContainer
Creates (or retrieves an existing instance) of the default add-ins group within the current RibbonBar control.
Public methodStatic memberGetAddInTypesByLocation
Retrieves the list of add-in types for a given location.
Public methodStatic memberGetAddInTypesByPage
Retrieves the list of add-in types for the given instance of Page object.
Public methodStatic memberGetAllAddInTypes
Retrieves the list of all add-in types that are currently loaded into the app domain.
Public methodInitialize
Performs "Initialize" stage.
Public methodLoad
Performs "Load" stage.
Public methodRemoveWindow(String)
Removes specified pop-up window.
Public methodRemoveWindow(Dialog)
Removes specified pop-up window.
Public methodRender
Sends add-in's output to specified HtmlTextWriter object.
Protected methodRenderWindows
Sends add-in windows' output to specified HtmlTextWriter object.
Top
Remarks
Examples
Ribbon bar addin
using Dynamicweb.Controls.Extensibility;
using Dynamicweb.Core.UI.Icons;
using Dynamicweb.Extensibility.AddIns;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dynamicweb.Controls.Examples
{
    [AddInTarget("/Admin/Module/eCom_Catalog/dw7/PIM/PimProductList.aspx")]
    [AddInTarget("/Admin/Module/eCom_Catalog/dw7/PIM/PimMultiEdit.aspx")]
    [AddInTarget("/Admin/Module/eCom_Catalog/dw7/PIM/PimProduct_Edit.aspx")]
    public class CustomPimProductEditRibbonBarAddin : RibbonBarAddIn
    {
        private RibbonBar ribbon;
        public CustomPimProductEditRibbonBarAddin(RibbonBar ribbon) : base(ribbon)
        {
            this.ribbon = ribbon;
        }
        public override void Load()
        {
            RibbonBarGroup ribbonBarGroup = base.CreateDefaultContainer();
            ribbonBarGroup.Name = "Custom";
            RibbonBarButton saveButton = new RibbonBarButton();
            saveButton.OnClientClick = $"alert('yeah! it is custom'); return false;";
            saveButton.EnableServerClick = true;
            saveButton.Text = "Custom button in PRODUCT edit";
            saveButton.Icon = KnownIcon.Extension;
            saveButton.Size = Dynamicweb.Controls.Icons.Icon.Size.Large;
            ribbonBarGroup.AddItem(saveButton);
        }
    }
}
See Also