// private void Submit_Button_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(width.Text)) { MessageBox.Show("请填写宽度;"); return; } else if (!DataUtil.isInt(width.Text.ToString())) { MessageBox.Show("宽度必须是整数;"); return; } if (string.IsNullOrWhiteSpace(height.Text.ToString())) { MessageBox.Show("请填写高度;"); return; } else if (!DataUtil.isInt(height.Text.ToString())) { MessageBox.Show("高度必须是整数;"); return; } if (string.IsNullOrWhiteSpace(left.Text.ToString())) { MessageBox.Show("请填写左边距;"); return; } else if (!DataUtil.isInt(left.Text.ToString())) { MessageBox.Show("左边距请填写整数;"); return; } if (string.IsNullOrWhiteSpace(top.Text.ToString())) { MessageBox.Show("请填写上边距;"); return; } else if (!DataUtil.isInt(top.Text.ToString())) { MessageBox.Show("上边距请填写整数;"); return; } if (string.IsNullOrWhiteSpace(opacity.Text.ToString())) { MessageBox.Show("请填写透明度;"); return; } else if (!DataUtil.isInt(opacity.Text.ToString())) { MessageBox.Show("透明度请填写整数;"); return; } else { Int32 opacityVal = Convert.ToInt32(opacity.Text.ToString()); if (opacityVal < 0 || opacityVal > 100) { MessageBox.Show("透明度为0-100内的整数;"); return; } } if (string.IsNullOrWhiteSpace(rotateAngle.Text)) { MessageBox.Show("请填写旋转角度;"); return; } else if (!DataUtil.isInt(rotateAngle.Text.ToString())) { MessageBox.Show("旋转角度必须是整数;"); return; } else { Int32 rotateAngleVal = Convert.ToInt32(rotateAngle.Text.ToString()); if (rotateAngleVal < 0 || rotateAngleVal > 360) { MessageBox.Show("旋转角度为0-360内的整数;"); return; } } //更新到数据库 DControl dControl = dControlBll.get(currDControl.id); dControl.width = int.Parse(width.Text); dControl.height = int.Parse(height.Text); dControl.left = int.Parse(left.Text); dControl.top = int.Parse(top.Text); dControl.isClickShow = (Boolean)isClickShow.IsChecked; dControl.opacity = int.Parse(opacity.Text); dControl.isTab = (Boolean)isTab.IsChecked; dControl.rotateAngle = int.Parse(rotateAngle.Text); dControlBll.update(dControl); //更新页面控件信息,更新isClickShow currDControl = dControl; currElement.Tag = currDControl; Gif button = (Gif)currElement; button.updateElementAttr(currDControl, true); //button.Width = currDControl.width; //button.Height = currDControl.height; //button.Margin = new Thickness(currDControl.left,currDControl.top,0,0); //button.Opacity = currDControl.opacity / 100.0; //TransformGroup group = (TransformGroup) button.RenderTransform; //RotateTransform rotateTransform = TransformGroupUtil.GetRotateTransform(group); //rotateTransform.Angle = currDControl.rotateAngle; //2.修改8个点的位置 及宽高 editing.updateEditingBorder(currDControl); Close(); }