protected virtual void CreateFirstTopStripElementChildElements() { if (this.Navigator.Site == null) { this.firstTopStripElement = new CommandBarStripElement(); this.commandBarRowElement.Strips.Add(this.firstTopStripElement); this.firstButton = new CommandBarButton(); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.firstButton); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem) new CommandBarSeparator()); this.previousButton = new CommandBarButton(); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.previousButton); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem) new CommandBarSeparator()); this.currentNumberTextBox = new CommandBarTextBox(); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.currentNumberTextBox); this.pageLabel = new CommandBarLabel(); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.pageLabel); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem) new CommandBarSeparator()); this.nextButton = new CommandBarButton(); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.nextButton); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem) new CommandBarSeparator()); this.lastButton = new CommandBarButton(); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.lastButton); } else { this.firstTopStripElement = (CommandBarStripElement)this.designerHost.CreateComponent(typeof(CommandBarStripElement), this.Navigator.Name + "FirstStrip"); this.firstButton = (CommandBarButton)this.designerHost.CreateComponent(typeof(CommandBarButton), this.Navigator.Name + "MoveFirstItem"); this.previousButton = (CommandBarButton)this.designerHost.CreateComponent(typeof(CommandBarButton), this.Navigator.Name + "MovePreviousItem"); this.currentNumberTextBox = (CommandBarTextBox)this.designerHost.CreateComponent(typeof(CommandBarTextBox), this.Navigator.Name + "PositionItem"); this.pageLabel = (CommandBarLabel)this.designerHost.CreateComponent(typeof(CommandBarLabel), this.Navigator.Name + "CountItem"); this.nextButton = (CommandBarButton)this.designerHost.CreateComponent(typeof(CommandBarButton), this.Navigator.Name + "MoveNextItem"); this.lastButton = (CommandBarButton)this.designerHost.CreateComponent(typeof(CommandBarButton), this.Navigator.Name + "MoveLastItem"); this.changeService.OnComponentChanging((object)this.Navigator.Site.Component, (MemberDescriptor)null); this.commandBarRowElement.Strips.Add(this.firstTopStripElement); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.firstButton); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.designerHost.CreateComponent(typeof(CommandBarSeparator))); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.previousButton); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.designerHost.CreateComponent(typeof(CommandBarSeparator))); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.currentNumberTextBox); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.pageLabel); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.designerHost.CreateComponent(typeof(CommandBarSeparator))); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.nextButton); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.designerHost.CreateComponent(typeof(CommandBarSeparator))); this.firstTopStripElement.Items.Add((RadCommandBarBaseItem)this.lastButton); this.changeService.OnComponentChanged((object)this.Navigator.Site.Component, (MemberDescriptor)null, (object)null, (object)null); } this.firstTopStripElement.MinSize = Size.Empty; this.firstTopStripElement.EnableDragging = false; this.firstTopStripElement.EnableFloating = false; this.firstTopStripElement.Grip.Visibility = ElementVisibility.Collapsed; this.firstTopStripElement.OverflowButton.Visibility = ElementVisibility.Collapsed; this.firstButton.Margin = new Padding(3, 0, 0, 0); this.pageLabel.Text = "of {0}"; }
protected virtual void CreateTextBoxStripElementChildElements() { this.textBoxStripElement = new CommandBarStripElement(); this.textBoxStripElement.MinSize = Size.Empty; this.textBoxStripElement.EnableDragging = false; this.textBoxStripElement.EnableFloating = false; this.textBoxStripElement.DesiredLocation = new PointF(10000f, 0.0f); this.textBoxStripElement.Grip.Visibility = ElementVisibility.Collapsed; this.textBoxStripElement.OverflowButton.Visibility = ElementVisibility.Collapsed; this.commandBarRowElement.Strips.Add(this.textBoxStripElement); this.pageLabel = new CommandBarLabel(); this.pageLabel.Text = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("PagingPanelPagesLabel"); this.textBoxStripElement.Items.Add((RadCommandBarBaseItem)this.pageLabel); this.pageNumberTextBox = new CommandBarTextBox(); this.pageNumberTextBox.TextBoxElement.MinSize = new Size(30, 20); this.textBoxStripElement.Items.Add((RadCommandBarBaseItem)this.pageNumberTextBox); this.ofPagesLabel = new CommandBarLabel(); this.ofPagesLabel.Text = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("PagingPanelOfPagesLabel"); this.textBoxStripElement.Items.Add((RadCommandBarBaseItem)this.ofPagesLabel); this.numberOfPagesLabel = new CommandBarLabel(); this.textBoxStripElement.Items.Add((RadCommandBarBaseItem)this.numberOfPagesLabel); }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(RadPrintPreviewDialog)); this.printPreviewControl = new RadPrintPreviewControl(); this.radCommandBar = new RadCommandBar(); this.commandBarRowElement1 = new CommandBarRowElement(); this.stripElementTools = new CommandBarStripElement(); this.buttonPrint = new CommandBarButton(); this.buttonSettings = new CommandBarButton(); this.commandBarButtonWatermark = new CommandBarButton(); this.stripElementNavigation = new CommandBarStripElement(); this.buttonPrevPage = new CommandBarButton(); this.buttonNextPage = new CommandBarButton(); this.textBoxCurrentPage = new CommandBarTextBox(); this.labelTotalPages = new CommandBarLabel(); this.commandBarSeparator1 = new CommandBarSeparator(); this.buttonZoomOut = new CommandBarButton(); this.buttonZoomIn = new CommandBarButton(); this.dropDownZoom = new CommandBarDropDownList(); this.dropDownButtonLayout = new CommandBarDropDownButton(); this.menuItemFile = new RadMenuItem(); this.menuItemPrint = new RadMenuItem(); this.menuItemExit = new RadMenuItem(); this.menuItemView = new RadMenuItem(); this.radMenuSeparatorItem1 = new RadMenuSeparatorItem(); this.menuItemPreviousPage = new RadMenuItem(); this.menuItemNextPage = new RadMenuItem(); this.radMenuSeparatorItem2 = new RadMenuSeparatorItem(); this.menuItemLayout = new RadMenuItem(); this.menuItemTools = new RadMenuItem(); this.menuItemPrintSettings = new RadMenuItem(); this.menuItemWatermark = new RadMenuItem(); this.radMenu = new RadMenu(); this.radCommandBar.BeginInit(); this.radMenu.BeginInit(); this.BeginInit(); this.SuspendLayout(); this.printPreviewControl.AutoZoom = false; this.printPreviewControl.BackColor = Color.FromArgb(156, 179, 207); this.printPreviewControl.Dock = DockStyle.Fill; this.printPreviewControl.Location = new Point(0, 58); this.printPreviewControl.Name = "printPreviewControl"; this.printPreviewControl.PageBorderColor = Color.White; this.printPreviewControl.PageInnerBorderColor = Color.White; this.printPreviewControl.PageShadowColor = Color.FromArgb(109, 125, 144); this.printPreviewControl.ScrollOffset = new Point(0, 0); this.printPreviewControl.ShadowThickness = 6; this.printPreviewControl.Size = new Size(713, 399); this.printPreviewControl.TabIndex = 1; this.printPreviewControl.StartPageChanged += new EventHandler(this.printPreviewControl1_StartPageChanged); this.printPreviewControl.MouseDown += new MouseEventHandler(this.printPreviewControl1_MouseDown); this.printPreviewControl.MouseMove += new MouseEventHandler(this.printPreviewControl1_MouseMove); this.printPreviewControl.MouseUp += new MouseEventHandler(this.printPreviewControl1_MouseUp); this.printPreviewControl.MouseWheel += new MouseEventHandler(this.printPreviewControl1_MouseWheel); this.radCommandBar.AutoSize = true; this.radCommandBar.Dock = DockStyle.Top; this.radCommandBar.Location = new Point(0, 20); this.radCommandBar.Name = "radCommandBar"; this.radCommandBar.Rows.AddRange(this.commandBarRowElement1); this.radCommandBar.Size = new Size(713, 38); this.radCommandBar.TabIndex = 3; this.radCommandBar.Text = "radCommandBar1"; this.commandBarRowElement1.DisplayName = (string)null; this.commandBarRowElement1.MinSize = new Size(25, 25); this.commandBarRowElement1.Strips.AddRange(this.stripElementTools, this.stripElementNavigation); this.stripElementTools.DisplayName = "Tools"; this.stripElementTools.Items.AddRange((RadCommandBarBaseItem)this.buttonPrint, (RadCommandBarBaseItem)this.buttonSettings, (RadCommandBarBaseItem)this.commandBarButtonWatermark); this.stripElementTools.Name = "commandBarStripElement1"; this.stripElementTools.Text = ""; this.buttonPrint.AccessibleDescription = "Print"; this.buttonPrint.AccessibleName = "Print"; this.buttonPrint.DisplayName = "Print..."; this.buttonPrint.DrawText = false; this.buttonPrint.Image = (Image)componentResourceManager.GetObject("print"); this.buttonPrint.Name = "buttonPrint"; this.buttonPrint.Text = "Print"; this.buttonPrint.ToolTipText = "Print..."; this.buttonPrint.Visibility = ElementVisibility.Visible; this.buttonPrint.MouseDown += new MouseEventHandler(this.buttonPrint_Click); this.buttonSettings.AccessibleDescription = "Settings"; this.buttonSettings.AccessibleName = "Settings"; this.buttonSettings.DisplayName = "Print Settings..."; this.buttonSettings.DrawText = false; this.buttonSettings.Image = (Image)componentResourceManager.GetObject("page-setup"); this.buttonSettings.Name = "buttonSettings"; this.buttonSettings.Text = "Settings"; this.buttonSettings.ToolTipText = "Print Settings..."; this.buttonSettings.Visibility = ElementVisibility.Visible; this.buttonSettings.MouseDown += new MouseEventHandler(this.buttonSettings_Click); this.commandBarButtonWatermark.AccessibleDescription = "Watermark"; this.commandBarButtonWatermark.AccessibleName = "Watermark"; this.commandBarButtonWatermark.DisplayName = "Watermark"; this.commandBarButtonWatermark.DrawText = false; this.commandBarButtonWatermark.Image = (Image)componentResourceManager.GetObject("watermark"); this.commandBarButtonWatermark.Name = "commandBarButtonWatermark"; this.commandBarButtonWatermark.Text = "Watermark"; this.commandBarButtonWatermark.ToolTipText = "Watermark"; this.commandBarButtonWatermark.Visibility = ElementVisibility.Visible; this.commandBarButtonWatermark.MouseUp += new MouseEventHandler(this.commandBarButtonWatermark_Click); this.stripElementNavigation.DisplayName = "Navigation"; this.stripElementNavigation.Items.AddRange((RadCommandBarBaseItem)this.buttonPrevPage, (RadCommandBarBaseItem)this.buttonNextPage, (RadCommandBarBaseItem)this.textBoxCurrentPage, (RadCommandBarBaseItem)this.labelTotalPages, (RadCommandBarBaseItem)this.commandBarSeparator1, (RadCommandBarBaseItem)this.buttonZoomOut, (RadCommandBarBaseItem)this.buttonZoomIn, (RadCommandBarBaseItem)this.dropDownZoom, (RadCommandBarBaseItem)this.dropDownButtonLayout); this.stripElementNavigation.Name = "commandBarStripElement2"; this.stripElementNavigation.Text = ""; this.buttonPrevPage.AccessibleDescription = "<"; this.buttonPrevPage.AccessibleName = "<"; this.buttonPrevPage.DisplayName = "Previous Page"; this.buttonPrevPage.DrawText = false; this.buttonPrevPage.Image = (Image)componentResourceManager.GetObject("arrow-up"); this.buttonPrevPage.Name = "buttonPrevPage"; this.buttonPrevPage.Text = "<"; this.buttonPrevPage.ToolTipText = "Previous Page"; this.buttonPrevPage.Visibility = ElementVisibility.Visible; this.buttonPrevPage.MouseDown += new MouseEventHandler(this.buttonPrevPage_Click); this.buttonNextPage.AccessibleDescription = ">"; this.buttonNextPage.AccessibleName = ">"; this.buttonNextPage.DisplayName = "Next Page"; this.buttonNextPage.DrawText = false; this.buttonNextPage.Image = (Image)componentResourceManager.GetObject("arrow-down"); this.buttonNextPage.Name = "buttonNextPage"; this.buttonNextPage.Text = ">"; this.buttonNextPage.ToolTipText = "Next Page"; this.buttonNextPage.Visibility = ElementVisibility.Visible; this.buttonNextPage.MouseDown += new MouseEventHandler(this.buttonNextPage_Click); this.textBoxCurrentPage.DisplayName = "Current Page"; this.textBoxCurrentPage.Font = new Font("Segoe UI Semibold", 12f, FontStyle.Bold, GraphicsUnit.Point, (byte)204); this.textBoxCurrentPage.MaxSize = new Size(0, 0); this.textBoxCurrentPage.Name = "textBoxCurrentPage"; this.textBoxCurrentPage.StretchVertically = true; this.textBoxCurrentPage.Text = ""; this.textBoxCurrentPage.Visibility = ElementVisibility.Visible; this.textBoxCurrentPage.KeyDown += new KeyEventHandler(this.commandBarTextBox1_KeyDown); ((RadItem)this.textBoxCurrentPage.GetChildAt(0)).Text = ""; this.textBoxCurrentPage.GetChildAt(0).Alignment = ContentAlignment.MiddleCenter; this.textBoxCurrentPage.GetChildAt(0).MinSize = new Size(40, 20); this.labelTotalPages.AccessibleDescription = "of 0"; this.labelTotalPages.AccessibleName = "of 0"; this.labelTotalPages.DisplayName = "Total Pages"; this.labelTotalPages.Font = new Font("Segoe UI Semibold", 12f, FontStyle.Bold, GraphicsUnit.Point, (byte)204); this.labelTotalPages.Name = "labelTotalPages"; this.labelTotalPages.Text = "/ 0"; this.labelTotalPages.Visibility = ElementVisibility.Visible; this.commandBarSeparator1.AccessibleDescription = "commandBarSeparator1"; this.commandBarSeparator1.AccessibleName = "commandBarSeparator1"; this.commandBarSeparator1.DisplayName = "commandBarSeparator1"; this.commandBarSeparator1.Name = "commandBarSeparator1"; this.commandBarSeparator1.Visibility = ElementVisibility.Visible; this.commandBarSeparator1.VisibleInOverflowMenu = false; this.buttonZoomOut.AccessibleDescription = "-"; this.buttonZoomOut.AccessibleName = "-"; this.buttonZoomOut.DisplayName = "Zoom Out"; this.buttonZoomOut.DrawText = false; this.buttonZoomOut.Image = (Image)componentResourceManager.GetObject("zoom-out"); this.buttonZoomOut.Name = "buttonZoomOut"; this.buttonZoomOut.Text = "-"; this.buttonZoomOut.ToolTipText = "Zoom Out"; this.buttonZoomOut.Visibility = ElementVisibility.Visible; this.buttonZoomIn.AccessibleDescription = "+"; this.buttonZoomIn.AccessibleName = "+"; this.buttonZoomIn.DisplayName = "Zoom In"; this.buttonZoomIn.DrawText = false; this.buttonZoomIn.Image = (Image)componentResourceManager.GetObject("zoom-in"); this.buttonZoomIn.Name = "buttonZoomIn"; this.buttonZoomIn.Text = "+"; this.buttonZoomIn.ToolTipText = "Zoom In"; this.buttonZoomIn.Visibility = ElementVisibility.Visible; this.dropDownZoom.DisplayName = "Zoom"; this.dropDownZoom.DropDownAnimationEnabled = true; this.dropDownZoom.MinSize = new Size(90, 22); this.dropDownZoom.Name = "dropDownZoom"; this.dropDownZoom.Text = ""; this.dropDownZoom.Visibility = ElementVisibility.Visible; this.dropDownButtonLayout.AccessibleDescription = "commandBarDropDownButton1"; this.dropDownButtonLayout.AccessibleName = "commandBarDropDownButton1"; this.dropDownButtonLayout.DisplayName = "Layout"; this.dropDownButtonLayout.Image = (Image)componentResourceManager.GetObject("view-thumbnail"); this.dropDownButtonLayout.Name = "dropDownButtonLayout"; this.dropDownButtonLayout.Text = "commandBarDropDownButton1"; this.dropDownButtonLayout.ToolTipText = "Layout"; this.dropDownButtonLayout.Visibility = ElementVisibility.Visible; this.menuItemFile.AccessibleDescription = "File"; this.menuItemFile.AccessibleName = "File"; this.menuItemFile.Items.AddRange((RadItem)this.menuItemPrint, (RadItem)this.menuItemExit); this.menuItemFile.Name = "menuItemFile"; this.menuItemFile.Text = "File"; this.menuItemFile.Visibility = ElementVisibility.Visible; this.menuItemPrint.AccessibleDescription = "Print..."; this.menuItemPrint.AccessibleName = "Print..."; this.menuItemPrint.Name = "menuItemPrint"; this.menuItemPrint.Text = "Print..."; this.menuItemPrint.Visibility = ElementVisibility.Visible; this.menuItemPrint.Click += new EventHandler(this.buttonPrint_Click); this.menuItemExit.AccessibleDescription = "Exit"; this.menuItemExit.AccessibleName = "Exit"; this.menuItemExit.Name = "menuItemExit"; this.menuItemExit.Text = "Exit"; this.menuItemExit.Visibility = ElementVisibility.Visible; this.menuItemExit.Click += new EventHandler(this.radMenuItem6_Click); this.menuItemView.AccessibleDescription = "View"; this.menuItemView.AccessibleName = "View"; this.menuItemView.Items.AddRange((RadItem)this.radMenuSeparatorItem1, (RadItem)this.menuItemPreviousPage, (RadItem)this.menuItemNextPage, (RadItem)this.radMenuSeparatorItem2, (RadItem)this.menuItemLayout); this.menuItemView.Name = "menuItemView"; this.menuItemView.Text = "View"; this.menuItemView.Visibility = ElementVisibility.Visible; this.radMenuSeparatorItem1.Name = "radMenuSeparatorItem1"; this.radMenuSeparatorItem1.Visibility = ElementVisibility.Visible; this.menuItemPreviousPage.AccessibleDescription = "Previous Page"; this.menuItemPreviousPage.AccessibleName = "Previous Page"; this.menuItemPreviousPage.Name = "menuItemPreviousPage"; this.menuItemPreviousPage.Text = "Previous Page"; this.menuItemPreviousPage.Visibility = ElementVisibility.Visible; this.menuItemPreviousPage.Click += new EventHandler(this.buttonPrevPage_Click); this.menuItemNextPage.AccessibleDescription = "Next Page"; this.menuItemNextPage.AccessibleName = "Next Page"; this.menuItemNextPage.Name = "menuItemNextPage"; this.menuItemNextPage.Text = "Next Page"; this.menuItemNextPage.Visibility = ElementVisibility.Visible; this.menuItemNextPage.Click += new EventHandler(this.buttonNextPage_Click); this.radMenuSeparatorItem2.Name = "radMenuSeparatorItem2"; this.radMenuSeparatorItem2.Visibility = ElementVisibility.Visible; this.menuItemLayout.AccessibleDescription = "Layout"; this.menuItemLayout.AccessibleName = "Layout"; this.menuItemLayout.Name = "menuItemLayout"; this.menuItemLayout.Text = "Layout"; this.menuItemLayout.Visibility = ElementVisibility.Visible; this.menuItemTools.AccessibleDescription = "Tools"; this.menuItemTools.AccessibleName = "Tools"; this.menuItemTools.Items.AddRange((RadItem)this.menuItemPrintSettings, (RadItem)this.menuItemWatermark); this.menuItemTools.Name = "menuItemTools"; this.menuItemTools.Text = "Tools"; this.menuItemTools.Visibility = ElementVisibility.Visible; this.menuItemPrintSettings.AccessibleDescription = "Printer Settings"; this.menuItemPrintSettings.AccessibleName = "Printer Settings"; this.menuItemPrintSettings.Name = "menuItemPrintSettings"; this.menuItemPrintSettings.Text = "Printer Settings..."; this.menuItemPrintSettings.Visibility = ElementVisibility.Visible; this.menuItemPrintSettings.Click += new EventHandler(this.buttonSettings_Click); this.menuItemWatermark.AccessibleDescription = "Watermark Settings..."; this.menuItemWatermark.AccessibleName = "Watermark Settings..."; this.menuItemWatermark.Name = "menuItemWatermark"; this.menuItemWatermark.Text = "Watermark Settings..."; this.menuItemWatermark.Visibility = ElementVisibility.Visible; this.menuItemWatermark.Click += new EventHandler(this.commandBarButtonWatermark_Click); this.radMenu.Items.AddRange((RadItem)this.menuItemFile, (RadItem)this.menuItemView, (RadItem)this.menuItemTools); this.radMenu.Location = new Point(0, 0); this.radMenu.Name = "radMenu"; this.radMenu.Size = new Size(713, 20); this.radMenu.TabIndex = 4; this.radMenu.Text = "radMenu1"; this.radMenu.Visible = false; this.AutoScaleDimensions = new SizeF(96f, 96f); this.AutoScaleMode = AutoScaleMode.Dpi; this.ClientSize = new Size(713, 457); this.Controls.Add((Control)this.printPreviewControl); this.Controls.Add((Control)this.radCommandBar); this.Controls.Add((Control)this.radMenu); this.Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); this.MinimizeBox = false; this.Name = nameof(RadPrintPreviewDialog); this.RootElement.ApplyShapeToControl = true; this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "Print Preview"; this.radCommandBar.EndInit(); this.radMenu.EndInit(); this.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
protected virtual void MapControls() { foreach (CommandBarRowElement row in this.Rows) { if (row.Name == this.Navigator.Name + "RowElement" && this.commandBarRowElement == null) { this.commandBarRowElement = row; } foreach (CommandBarStripElement strip in row.Strips) { if (strip.DisplayName == this.Navigator.Name + "FirstStrip" && this.firstTopStripElement == null) { this.firstTopStripElement = strip; } else if (strip.DisplayName == this.Navigator.Name + "SecondStrip" && this.secondBottomStripElement == null) { this.secondBottomStripElement = strip; } foreach (RadCommandBarBaseItem commandBarBaseItem in strip.Items) { string name = commandBarBaseItem.Name; if (commandBarBaseItem.Site != null) { name = commandBarBaseItem.Site.Name; } if (commandBarBaseItem is CommandBarButton && name == this.Navigator.Name + "MoveFirstItem" && this.firstButton == null) { this.firstButton = commandBarBaseItem as CommandBarButton; } else if (commandBarBaseItem is CommandBarButton && name == this.Navigator.Name + "MovePreviousItem" && this.previousButton == null) { this.previousButton = commandBarBaseItem as CommandBarButton; } else if (commandBarBaseItem is CommandBarButton && name == this.Navigator.Name + "MoveNextItem" && this.nextButton == null) { this.nextButton = commandBarBaseItem as CommandBarButton; } else if (commandBarBaseItem is CommandBarButton && name == this.Navigator.Name + "MoveLastItem" && this.lastButton == null) { this.lastButton = commandBarBaseItem as CommandBarButton; } else if (commandBarBaseItem is CommandBarButton && name == this.Navigator.Name + "AddNewItem" && this.addNewButton == null) { this.addNewButton = commandBarBaseItem as CommandBarButton; } else if (commandBarBaseItem is CommandBarButton && name == this.Navigator.Name + "DeleteItem" && this.deleteButton == null) { this.deleteButton = commandBarBaseItem as CommandBarButton; } else if (commandBarBaseItem is CommandBarTextBox && name == this.Navigator.Name + "PositionItem" && this.currentNumberTextBox == null) { this.currentNumberTextBox = commandBarBaseItem as CommandBarTextBox; } else if (commandBarBaseItem is CommandBarLabel && name == this.Navigator.Name + "CountItem" && this.pageLabel == null) { this.pageLabel = commandBarBaseItem as CommandBarLabel; } } } } }