Ejemplo n.º 1
0
        private void OnPrintKeyValueChanged(PropertyChangedFromTextBoxEventArgs property)
        {
            BarCodeControl   c       = (BarCodeControl)property.PrintControl;
            PropertyModel    p       = property.Property;
            TextBox          textBox = property.TextBox;
            DependencyObject d       = DependencyHelper.FindVisualChildByName(c, "pText");

            if (d != null)
            {
                Type t = d.GetType();
                if (t == typeof(TextBlock))
                {
                    TextBlock r     = d as TextBlock;
                    string    value = (string)Convert.ChangeType(p.Value, typeof(string));
                    if (CommonRule.HasChinese(p.Value.ToString()))
                    {
                        p.Value      = c.PrintKeyValue;
                        textBox.Text = c.PrintKeyValue;
                        return;
                    }
                    r.Text          = value;
                    c.PrintKeyValue = r.Text;
                }
            }
        }
Ejemplo n.º 2
0
        private void OnThicknessChanged(PropertyChangedFromTextBoxEventArgs property)
        {
            PropertyModel    p         = property.Property;
            RectangleControl c         = (RectangleControl)property.PrintControl;
            PropertyModel    thickness = GetPropertyItemByName(c.Propertys, p.Name);

            if (thickness != null)
            {
                DependencyObject d = DependencyHelper.FindVisualChildByName(c, thickness.Name);
                if (d != null)
                {
                    Type t = d.GetType();
                    if (t == typeof(Rectangle))
                    {
                        Rectangle r = d as Rectangle;
                        r.StrokeThickness = (double)Convert.ChangeType(thickness.Value, typeof(double));
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void OnTextChanged(PropertyChangedFromTextBoxEventArgs property)
        {
            PropertyModel    p = property.Property;
            BarCodeControl   c = (BarCodeControl)property.PrintControl;
            DependencyObject d = DependencyHelper.FindVisualChildByName(c, p.Name);

            if (d != null)
            {
                Type t = d.GetType();
                if (t == typeof(TextBlock))
                {
                    TextBlock r = d as TextBlock;
                    int       i = (int)Convert.ChangeType(p.Value, typeof(int));
                    if (i == 66)
                    {
                        r.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        r.Visibility = Visibility.Collapsed;
                    }
                }
            }
        }