Пример #1
0
 public ToolBarMoveButton(InlineSearchBarCommand command) : base(command)
 {
     if (command == null)
     {
         throw new ArgumentNullException("command");
     }
     this.command   = command;
     this.CssClass += " ToolBarButton";
     this.CssClass += " InlineSearchBarCommand";
 }
Пример #2
0
        protected override void CreateChildControls()
        {
            bool hasViewsPanel = false;

            if (this.Views.Count > 0)
            {
                hasViewsPanel = true;
                WebControl child = this.CreateViewsPanel();
                this.Controls.Add(child);
            }
            WebControl webControl = null;

            if (this.ShowSearchBar)
            {
                webControl = this.CreateSearchBar();
                if (this.ShowSearchBarOnToolBar)
                {
                    InlineSearchBarCommand inlineSearchBarCommand = new InlineSearchBarCommand();
                    inlineSearchBarCommand.ImageAltText    = Strings.SearchCommandText;
                    inlineSearchBarCommand.ImageId         = CommandSprite.SpriteId.SearchDefault;
                    webControl.ClientIDMode                = ClientIDMode.Static;
                    inlineSearchBarCommand.ControlIdToMove = webControl.ClientID;
                    inlineSearchBarCommand.MovedControlCss = "ToolBarSearchBar";
                    this.Commands.Add(inlineSearchBarCommand);
                }
            }
            if (this.Commands.Count > 0 && this.ShowToolBar)
            {
                this.toolbarPanel = (Panel)this.CreateToolBarControl(hasViewsPanel);
                this.Controls.Add(this.toolbarPanel);
            }
            if (webControl != null)
            {
                this.Controls.Add(webControl);
            }
            if (this.IsEditable)
            {
                this.listViewInputPanel = this.CreateInputBar();
                this.Controls.Add(this.listViewInputPanel);
            }
            if (!this.AllowSorting)
            {
                foreach (ColumnHeader columnHeader in this.Columns)
                {
                    columnHeader.IsSortable = false;
                }
            }
            if (this.ServiceUrl != null)
            {
                this.Controls.Add(this.listSource);
            }
            base.Attributes.Add("role", "application");
            base.CreateChildControls();
        }