1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Sample Code for implementing Telerik.Web.ICommandPanel

Sample Code for implementing Telerik.Web.ICommandPanel

2 posts, 0 answered
  1. Joel
    Joel avatar
    4 posts
    Registered:
    24 Oct 2007
    11 Mar 2008
    Link to this post
    When using Telerik.IControlPanelCommand as the job intra site module and help files suggest VS tells me it's obsolete and I should use Telerik.Web.ICommandPanel.  The new interface appears to be different and I was wondering if we could get a new jobs intra site example with the updated code through out it.  It's used in a couple different places and I haven't got familiar enough with the modules yet to be able to figure it out.  Thanks.

    Joel
  2. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    11 Mar 2008
    Link to this post
    Hi Joel,

    We will include this task in our ToDo list. Meanwhile, you could have a look at the following information about the ICommandPanel interface:

    1. Commented Interface Structure of ICommandPanel:
    The interface defines members for command panel implementation. CommandPanels are used for Modules. They are connected to control panel and can not exist without it. Most often they are used as a left side navigation for the modules admin part.

    public interface ICommandPanel  
    {  
        /// <summary>Name for the command panel.</summary>  
        /// <value>Command panel name.</value>  
        /// <remarks>  
        /// Could be used as command panel identifier if there are more than one command  
        /// panels for a module.  
        /// </remarks>  
        /// <example>  
        ///   You can refer to <see cref="ICommandPanel">ICommandPanel</see> interface for more  
        ///     complicated example implementing the whole  
        ///     <see cref="ICommandPanel">ICommandPanel</see> interface.  
        /// </example>  
        string Name  
        {  
            get;  
        }  
      
        /// <summary>Title of the command panel.</summary>  
        /// <example>  
        ///     You can refer to <see cref="ICommandPanel">ICommandPanel</see> interface for more  
        ///     complicated example implementing the whole  
        ///     <see cref="ICommandPanel">ICommandPanel</see> interface.  
        /// </example>  
        string Title  
        {  
            get;  
        }  
      
        /// <summary>Reference to the control panel tied to the command panel instance.</summary>  
        /// <remarks>  
        /// This property is used for communication between the command panel and its control  
        /// panel.  
        /// </remarks>  
        /// <example>  
        ///     You can refer to <see cref="ICommandPanel">ICommandPanel</see> interface for more  
        ///     complicated example implementing the whole  
        ///     <see cref="ICommandPanel">ICommandPanel</see> interface.  
        /// </example>  
        IControlPanel ControlPanel  
        {  
            get;  
        }  
      
        /// <summary>Refreshes the command panel information.</summary>  
        /// <requirements>  
        /// This method could be used to refresh the command panel information. For example  
        /// when there is some change in the ControlPanel which reflects on the information of the  
        /// CommandPanel.  
        /// </requirements>  
        /// <example>  
        ///     You can refer to <see cref="ICommandPanel">ICommandPanel</see> interface for more  
        ///     complicated example implementing the whole  
        ///     <see cref="ICommandPanel">ICommandPanel</see> interface.  
        /// </example>  
        void Refresh();  
     



    2. Implementation Example for ICommandPanel:
    The following example provides implementation for the ICommandPanel interface. It provides two constructors that assign the CommandPanel control's ControlPanel member.

    public abstract class CommandPanelBase : CompositeControl, ICommandPanel 
         public CommandPanelBase(IControlPanel controlPanel) 
         { 
             this.controlPanel = controlPanel; 
         } 
       
         public CommandPanelBase(IControlPanel controlPanel, string name) 
             : this(controlPanel) 
         { 
             this.name = name; 
         } 
       
         public virtual string Name 
         { 
             get  
             { 
                 return this.name;             
             } 
         } 
       
         public virtual string Title 
         { 
             get  
             { 
                 return this.titleImpl;  
             } 
         } 
       
         public virtual IControlPanel ControlPanel 
         { 
           get  
           {  
             return this.controlPanel;  
           } 
         } 
     
         public virtual void Refresh() 
         { 
           base.RecreateChildControls(); 
         } 
      
         private string name; 
         protected string titleImpl; 
         private IControlPanel controlPanel; 


    Hope this helps. For more information on other Sitefinity members, please take a look at the API Reference in the Developer manual.


    All the best,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered