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);
 }
Exemplo n.º 2
0
 void SetPadding(string l, PropertyExpr pe)
 {
     if (!_pri.IsExpression(pe.Expression))
     {
         DesignerUtility.ValidateSize(pe.Expression, true, false);
     }
     SetStyleValue(l, pe.Expression);
 }
Exemplo n.º 3
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");
            }
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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, "Invalid Font Size");
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
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);
        }
 void SetMargin(string l, string v)
 {
     DesignerUtility.ValidateSize(v, true, false);
     _pr.SetReportValue(l, v);
 }