SetPaletteRedirect() private method

private SetPaletteRedirect ( PaletteTripleRedirect redirector ) : void
redirector PaletteTripleRedirect
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawMenuHeading class.
        /// </summary>
        /// <param name="heading">Reference to owning heading entry.</param>
        /// <param name="palette">Reference to palette source.</param>
        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);
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawMenuHeading class.
        /// </summary>
        /// <param name="heading">Reference to owning heading entry.</param>
        /// <param name="palette">Reference to palette source.</param>
        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);
        }