예제 #1
0
 void SetPadding(string l, PropertyExpr pe, bool bMinus) //Josh: Eddited to allow negative padding on top and left
 {
     if (!_pri.IsExpression(pe.Expression))
     {
         DesignerUtility.ValidateSize(pe.Expression, true, /*false*/ bMinus);
     }
     SetStyleValue(l, pe.Expression);
 }
예제 #2
0
 void SetPadding(string l, PropertyExpr pe)
 {
     if (!_pri.IsExpression(pe.Expression))
     {
         DesignerUtility.ValidateSize(pe.Expression, true, false);
     }
     SetStyleValue(l, pe.Expression);
 }
        private void tbSize_Validating(object sender, System.ComponentModel.CancelEventArgs e)
        {
            TextBox tb = sender as TextBox;

            if (tb == null)
            {
                return;
            }

            try { DesignerUtility.ValidateSize(tb.Text, false, false); }
            catch (Exception ex)
            {
                e.Cancel = true;
                MessageBox.Show(string.Format(Strings.ReportCtl_Show_SizeInvalid, tb.Text, ex.Message), tb.Tag + " " + Strings.ReportCtl_Show_Field_Invalid);
            }
        }
예제 #4
0
        private void tbSize_Validating(object sender, System.ComponentModel.CancelEventArgs e)
        {
            TextBox tb = sender as TextBox;

            if (tb == null)
            {
                return;
            }

            try { DesignerUtility.ValidateSize(tb.Text, false, false); }
            catch (Exception ex)
            {
                e.Cancel = true;
                MessageBox.Show(string.Format("Size value of {0} is invalid.\r\n", tb.Text, ex.Message), tb.Tag + " Field Invalid");
            }
        }
예제 #5
0
        public bool IsValid()
        {
            XmlNode ri = this._ReportItems[0] as XmlNode;

            if (tbName.Enabled && fName)
            {
                string nerr = _Draw.NameError(ri, this.tbName.Text);
                if (nerr != null)
                {
                    MessageBox.Show(nerr, "Name");
                    return(false);
                }
            }
            string name = "";

            try
            {                   // allow minus if Line and only one item selected
                bool bMinus = ri.Name == "Line" && tbName.Enabled? true: false;
                if (fLeft)
                {
                    name = "Left";
                    DesignerUtility.ValidateSize(this.tbLeft.Text, true, false);
                }
                if (fTop)
                {
                    name = "Top";
                    DesignerUtility.ValidateSize(this.tbTop.Text, true, false);
                }
                if (fWidth)
                {
                    name = "Width";
                    DesignerUtility.ValidateSize(this.tbWidth.Text, true, bMinus);
                }
                if (fHeight)
                {
                    name = "Height";
                    DesignerUtility.ValidateSize(this.tbHeight.Text, true, bMinus);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, name + " Size is Invalid");
                return(false);
            }

            return(true);
        }
예제 #6
0
 public bool IsValid()
 {
     if (fFontSize)
     {
         try
         {
             if (!this.cbFontSize.Text.Trim().StartsWith("="))
             {
                 DesignerUtility.ValidateSize(this.cbFontSize.Text, false, false);
             }
         }
         catch (Exception e)
         {
             MessageBox.Show(e.Message, Strings.FontCtl_Show_InvalidFontSize);
             return(false);
         }
     }
     return(true);
 }
예제 #7
0
        public bool IsValid()
        {
            try
            {
                if (fWidth)
                {
                    DesignerUtility.ValidateSize(this.tbColumnWidth.Text, true, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Width is Invalid");
                return(false);
            }

            if (fHidden)
            {
                string vh = this.tbHidden.Text.Trim();
                if (vh.Length > 0)
                {
                    if (vh.StartsWith("="))
                    {
                    }
                    else
                    {
                        vh = vh.ToLower();
                        switch (vh)
                        {
                        case "true":
                        case "false":
                            break;

                        default:
                            MessageBox.Show(String.Format("{0} must be an expression or 'true' or 'false'", tbHidden.Text), "Hidden is Invalid");
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
        public bool IsValid()
        {
            try
            {
                if (fHeight)
                {
                    DesignerUtility.ValidateSize(this.tbRowHeight.Text, true, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Strings.TableRowCtl_Show_HeightInvalid);
                return(false);
            }

            if (fHidden)
            {
                string vh = this.tbHidden.Text.Trim();
                if (vh.Length > 0)
                {
                    if (vh.StartsWith("="))
                    {
                    }
                    else
                    {
                        vh = vh.ToLower();
                        switch (vh)
                        {
                        case "true":
                        case "false":
                            break;

                        default:
                            MessageBox.Show(String.Format(Strings.TableRowCtl_Show_ExpressionTrueFalse, tbHidden.Text), Strings.TableRowCtl_Show_HiddenInvalid);
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
        public bool IsValid()
        {
            string name = "";

            try
            {
                if (fWidthDefault && !tbWidthDefault.Text.StartsWith("="))
                {
                    name = Strings.StyleBorderCtl_Show_DefaultWidth;
                    DesignerUtility.ValidateSize(tbWidthDefault.Text, true, false);
                }
                if (fWidthLeft && !tbWidthLeft.Text.StartsWith("="))
                {
                    name = Strings.StyleBorderCtl_Show_LeftWidth;
                    DesignerUtility.ValidateSize(tbWidthLeft.Text, true, false);
                }
                if (fWidthTop && !tbWidthTop.Text.StartsWith("="))
                {
                    name = Strings.StyleBorderCtl_Show_TopWidth;
                    DesignerUtility.ValidateSize(tbWidthTop.Text, true, false);
                }
                if (fWidthBottom && !tbWidthBottom.Text.StartsWith("="))
                {
                    name = Strings.StyleBorderCtl_Show_BottomWidth;
                    DesignerUtility.ValidateSize(tbWidthBottom.Text, true, false);
                }
                if (fWidthRight && !tbWidthRight.Text.StartsWith("="))
                {
                    name = Strings.StyleBorderCtl_Show_RightWidth;
                    DesignerUtility.ValidateSize(tbWidthRight.Text, true, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, name + " " + Strings.StyleBorderCtl_Show_SizeInvalid);
                return(false);
            }

            return(true);
        }
예제 #10
0
        public bool IsValid()
        {
            string name = "";

            try
            {
                if (fPadLeft && !this.tbPadLeft.Text.StartsWith("="))
                {
                    name = "Left";
                    DesignerUtility.ValidateSize(this.tbPadLeft.Text, true, false);
                }

                if (fPadRight && !this.tbPadRight.Text.StartsWith("="))
                {
                    name = "Right";
                    DesignerUtility.ValidateSize(this.tbPadRight.Text, true, false);
                }

                if (fPadTop && !this.tbPadTop.Text.StartsWith("="))
                {
                    name = "Top";
                    DesignerUtility.ValidateSize(this.tbPadTop.Text, true, false);
                }

                if (fPadBottom && !this.tbPadBottom.Text.StartsWith("="))
                {
                    name = "Bottom";
                    DesignerUtility.ValidateSize(this.tbPadBottom.Text, true, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, name + " Padding Invalid");
                return(false);
            }
            return(true);
        }
        public bool IsValid()
        {
            string name = "";

            try
            {
                if (fPadLeft && !tbPadLeft.Text.StartsWith("="))
                {
                    name = Strings.StyleCtl_Show_Left;
                    DesignerUtility.ValidateSize(tbPadLeft.Text, true, false);
                }

                if (fPadRight && !tbPadRight.Text.StartsWith("="))
                {
                    name = Strings.StyleCtl_Show_Right;
                    DesignerUtility.ValidateSize(tbPadRight.Text, true, false);
                }

                if (fPadTop && !tbPadTop.Text.StartsWith("="))
                {
                    name = Strings.StyleCtl_Show_Top;
                    DesignerUtility.ValidateSize(tbPadTop.Text, true, false);
                }

                if (fPadBottom && !tbPadBottom.Text.StartsWith("="))
                {
                    name = Strings.StyleCtl_Show_Bottom;
                    DesignerUtility.ValidateSize(tbPadBottom.Text, true, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, string.Format(Strings.StyleCtl_Show_PaddingInvalid, name));
                return(false);
            }
            return(true);
        }
예제 #12
0
 void SetMargin(string l, string v)
 {
     DesignerUtility.ValidateSize(v, true, false);
     _pr.SetReportValue(l, v);
 }