Paint.PlaybackToolbox.AddPlayPauseButton C# (CSharp) Method

AddPlayPauseButton() private method

Adds the play pause button.
private AddPlayPauseButton ( ToolboxLayoutDefinitionStandardToolsButtonsButton buttonLayout ) : void
buttonLayout Paint.ToolboxLayout.ToolboxLayoutDefinitionStandardToolsButtonsButton /// Button layout. ///
return void
        private void AddPlayPauseButton(ToolboxLayoutDefinitionStandardToolsButtonsButton buttonLayout)
        {
            this.playButton = new Button(
                this.GraphicsDisplay,
                new ButtonDefinition(buttonLayout, this.Scale, new ImageType[] { ImageType.PlayButton, ImageType.PauseButton }, ImageType.PlayButtonDisabled));

            this.playButton.ButtonPressed += (sender, e) =>
            {
                if (this.playButton.State == 0)
                {
                    this.OnPauseSelected(EventArgs.Empty);
                }
                else
                {
                    this.OnPlaySelected(EventArgs.Empty);
                }
            };

            this.AddTool(this.playButton);
        }