Ejemplo n.º 1
0
 public DataSourcePromptControl(ReportDataSourceInfo dsInfo, ToolTip toolTip)
 {
     m_dsInfo = dsInfo;
     if (!string.IsNullOrEmpty(m_dsInfo.Prompt))
     {
         m_promptPanel       = new ParameterPanel();
         m_promptPanel.Name  = "_prompt";
         m_promptPanel.Width = 0;
         m_promptPanel.Controls.Add(new ParameterLabel(m_dsInfo.Prompt));
     }
     m_userName              = CreateTextBox();
     m_userNamePanel         = CreatePanelForTextBox(m_userName);
     m_password              = CreateTextBox();
     m_password.PasswordChar = '*';
     m_passwordPanel         = CreatePanelForTextBox(m_password);
     ApplyCustomResources();
 }
Ejemplo n.º 2
0
        private void PromptPanel_LayoutTwoColumns(object sender, LayoutEventArgs e)
        {
            int maxColumnWidth  = 0;
            int maxColumnWidth2 = 0;
            int maxLabelWidth   = 0;
            int maxLabelWidth2  = 0;

            m_leftColumnControls.GetMaxWidths(out maxLabelWidth, out maxColumnWidth);
            m_rightColumnControls.GetMaxWidths(out maxLabelWidth2, out maxColumnWidth2);
            int num  = 0;
            int num2 = 0;
            int num3 = promptPanel.Width - (maxColumnWidth + maxColumnWidth2 + 30 + 160 + 6);

            if (num3 < 0)
            {
                num  = 80;
                num2 = 80;
            }
            else
            {
                num  = Math.Min(80 + num3 / 2 - 5, maxLabelWidth);
                num2 = Math.Min(80 + num3 / 2 - 5, maxLabelWidth2);
            }
            int num4 = maxColumnWidth + maxColumnWidth2 + 30 + num + num2;

            foreach (ParameterPanel control in promptPanel.Controls)
            {
                int internalLayout = (!m_leftColumnControls.Contains(control)) ? ((!m_rightColumnControls.Contains(control)) ? num4 : num2) : num;
                control.SetInternalLayout(internalLayout);
            }
            int            num5            = 6 + maxColumnWidth + 25 + num;
            int            num6            = promptPanel.AutoScrollPosition.Y + 6;
            ParameterPanel parameterPanel2 = null;

            foreach (ParameterPanel control2 in promptPanel.Controls)
            {
                control2.Top = num6;
                bool flag = m_rightColumnControls.Contains(control2);
                if (flag)
                {
                    control2.Left = promptPanel.AutoScrollPosition.X + num5;
                }
                else
                {
                    control2.Left   = promptPanel.AutoScrollPosition.X + 6;
                    parameterPanel2 = control2;
                }
                if (control2.Name == "_prompt" || flag)
                {
                    num6 = Math.Max(control2.Bottom, parameterPanel2.Bottom) + 4;
                }
            }
            int num7 = 0;

            if (m_linkCredentialsVisible)
            {
                num7 = linkChangeCredentials.Height;
            }
            int val = 0;

            if (parameterPanel2 != null)
            {
                val = Math.Max(parameterPanel2.Bottom + 2, num6) + num7 + SystemInformation.HorizontalScrollBarHeight;
            }
            val = Math.Min(val, 200);
            val = (m_preferredHeight = Math.Max(val, viewReport.Bottom + 2));
            if (this.PreferredHeightChanged != null)
            {
                this.PreferredHeightChanged(this, EventArgs.Empty);
            }
        }