File: TaskFormBase.cs

package info (click to toggle)
mono 4.6.2.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 778,148 kB
  • ctags: 914,052
  • sloc: cs: 5,779,509; xml: 2,773,713; ansic: 432,645; sh: 14,749; makefile: 12,361; perl: 2,488; python: 1,434; cpp: 849; asm: 531; sql: 95; sed: 16; php: 1
file content (170 lines) | stat: -rw-r--r-- 6,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//------------------------------------------------------------------------------
// <copyright file="TaskFormBase.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//
// @owner       [....]
// @backupOwner [....]
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Design;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace System.Web.UI.Design.WebControls.Util
{
    /// <devdoc>
    /// Represents a wizard used to guide users through configuration processes.
    /// </devdoc>
    internal abstract class TaskFormBase : DesignerForm
    {

        private System.Windows.Forms.Panel _taskPanel;
        private System.Windows.Forms.Label _bottomDividerLabel;
        private System.Windows.Forms.Panel _headerPanel;
        private System.Windows.Forms.Label _captionLabel;
        private System.Windows.Forms.PictureBox _glyphPictureBox;

        /// <devdoc>
        /// Creates a new TaskForm with a given service provider.
        /// </devdoc>
        public TaskFormBase(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            InitializeComponent();
            InitializeUI();
        }

        protected System.Windows.Forms.Label CaptionLabel
        {
            get
            {
                return _captionLabel;
            }
        }

        /// <devdoc>
        /// A glyph for the wizard.
        /// </devdoc>
        protected void SetGlyph(System.Drawing.Image value)
        {
            _glyphPictureBox.Image = value;
        }

        protected System.Windows.Forms.Panel TaskPanel
        {
            get
            {
                return _taskPanel;
            }
        }

        #region Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {

            this._taskPanel = new System.Windows.Forms.Panel();
            this._bottomDividerLabel = new System.Windows.Forms.Label();
            this._captionLabel = new System.Windows.Forms.Label();
            this._headerPanel = new System.Windows.Forms.Panel();
            this._glyphPictureBox = new System.Windows.Forms.PictureBox();
            this._headerPanel.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._glyphPictureBox)).BeginInit();
            this.SuspendLayout();

            // 
            // _taskPanel
            // 
            this._taskPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this._taskPanel.Location = new System.Drawing.Point(0, 63);
            this._taskPanel.Name = "_taskPanel";
            this._taskPanel.Size = new System.Drawing.Size(528, 319);            
            this._taskPanel.TabIndex = 30;
            // 
            // _bottomDividerLabel
            // 
            this._bottomDividerLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this._bottomDividerLabel.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this._bottomDividerLabel.Location = new System.Drawing.Point(0, 382);
            this._bottomDividerLabel.Name = "_bottomDividerLabel";
            this._bottomDividerLabel.Size = new System.Drawing.Size(572, 1);
            this._bottomDividerLabel.TabIndex = 40;
            // 
            // _headerPanel
            // 
            this._headerPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this._headerPanel.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this._headerPanel.Controls.Add(this._glyphPictureBox);
            this._headerPanel.Controls.Add(this._captionLabel);
            this._headerPanel.Location = new System.Drawing.Point(0, 0);
            this._headerPanel.Name = "_headerPanel";
            this._headerPanel.Size = new System.Drawing.Size(572, 63);
            this._headerPanel.TabIndex = 10;
            // 
            // _glyphPictureBox
            // 
            this._glyphPictureBox.Location = new System.Drawing.Point(0, 0);
            this._glyphPictureBox.Name = "_glyphPictureBox";
            this._glyphPictureBox.Size = new System.Drawing.Size(65, 63);
            this._glyphPictureBox.TabIndex = 20;
            this._glyphPictureBox.TabStop = false;
            // 
            // _captionLabel
            // 
            this._captionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this._captionLabel.Location = new System.Drawing.Point(71, 17);
            this._captionLabel.Name = "_captionLabel";
            this._captionLabel.Size = new System.Drawing.Size(487, 47);
            this._captionLabel.TabIndex = 10;
            // 
            // TaskForm
            // 
            this.ClientSize = new System.Drawing.Size(530, 423);
            this.Controls.Add(this._headerPanel);
            this.Controls.Add(this._bottomDividerLabel);
            this.Controls.Add(this._taskPanel);
            this.Name = "TaskForm";
            this._headerPanel.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this._glyphPictureBox)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
        #endregion

        /// <devdoc>
        /// Called after InitializeComponent to perform additional actions that
        /// are not supported by the designer.
        /// </devdoc>
        private void InitializeUI()
        {
            UpdateFonts();
        }

        protected override void OnFontChanged(EventArgs e)
        {
            base.OnFontChanged(e);
            UpdateFonts();
        }

        private void UpdateFonts()
        {
            _captionLabel.Font = new Font(Font.FontFamily, Font.Size + 2.0f, FontStyle.Bold, Font.Unit);
        }
    }
}