ComponentFactory.Krypton.Toolkit.ViewDrawMenuHeading.ViewDrawMenuHeading C# (CSharp) Method

ViewDrawMenuHeading() public method

Initialize a new instance of the ViewDrawMenuHeading class.
public ViewDrawMenuHeading ( KryptonContextMenuHeading heading, PaletteTripleRedirect palette ) : System
heading KryptonContextMenuHeading Reference to owning heading entry.
palette PaletteTripleRedirect Reference to palette source.
return System
        public ViewDrawMenuHeading(KryptonContextMenuHeading heading,
                                   PaletteTripleRedirect palette)
        {
            // Create fixed storage of the content values
            _contentValues = new FixedContentValue(heading.Text,
                                                   heading.ExtraText,
                                                   heading.Image,
                                                   heading.ImageTransparentColor);

            // Give the heading object the redirector to use when inheriting values
            heading.SetPaletteRedirect(palette);

            // Create the content for the actual heading text/image
            _drawContent = new ViewDrawContent(heading.StateNormal.Content, _contentValues, VisualOrientation.Top);

            // Use the docker to provide the background and border
            _drawDocker = new ViewDrawDocker(heading.StateNormal.Back, heading.StateNormal.Border);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Add docker as the composite content
            Add(_drawDocker);
        }