Paint.ToolBox.ToolBox C# (CSharp) Méthode

ToolBox() public méthode

Initializes a new instance of the Paint.ToolBox class.
public ToolBox ( ToolboxLayoutDefinition toolboxLayoutDefinition, IGraphicsDisplay graphicsDisplay, int scale ) : System
toolboxLayoutDefinition Paint.ToolboxLayout.ToolboxLayoutDefinition
graphicsDisplay IGraphicsDisplay
scale int
Résultat System
        public ToolBox(ToolboxLayoutDefinition toolboxLayoutDefinition, IGraphicsDisplay graphicsDisplay, int scale)
        {
            this.BackgroundColor = this.TranslateToolboxLayoutColor(toolboxLayoutDefinition.BackgroundColor);
            this.BorderColor = this.TranslateToolboxLayoutColor(toolboxLayoutDefinition.Border.Color);
            this.GraphicsDisplay = graphicsDisplay;
            this.Scale = scale;
            this.toolboxWidth = toolboxLayoutDefinition.Width * scale;
            this.ToolboxMinimizedHeight = toolboxLayoutDefinition.MinimizedHeight * scale;
            this.toolboxMaximisedHeight = toolboxLayoutDefinition.MaximizedHeight * scale;

            int toolboxBorderWidth = toolboxLayoutDefinition.Border.Width * scale;

            // we start maximised and docked at the bottom
            this.ToolboxHeight = toolboxLayoutDefinition.MaximizedHeight * scale;
            this.DockPosition = DockPosition.Bottom;

            this.toolboxBounds = new Rectangle(0, 0, this.toolboxWidth, this.ToolboxHeight);

            this.toolbarInnerBounds = new Rectangle(
                toolboxBorderWidth,
                toolboxBorderWidth,
                this.toolboxWidth - (2 * toolboxBorderWidth),
                this.ToolboxMinimizedHeight - (2 * toolboxBorderWidth));

            this.interactiveTools = new List<IToolBoxToolTouch>();
            this.nonInteractiveTools = new List<IToolBoxTool>();

            // Add all the buttons
            this.AddStandardTools(toolboxLayoutDefinition.StandardTools);
        }