コード例 #1
0
 public override void ReadXml(System.Xml.Linq.XElement element)
 {
     X = new DrawingExpression(this, "Center X =", element.ReadString("X"));
     Y = new DrawingExpression(this, "Center Y =", element.ReadString("Y"));
     R = new DrawingExpression(this, "Radius =", element.ReadString("R"));
     base.ReadXml(element);
 }
コード例 #2
0
        protected override ValidationResult Validate(object value)
        {
            ValidationResult result = new ValidationResult();
            string           source = value.ToString();

            DrawingExpression expression = Value as DrawingExpression;

            if (!string.IsNullOrEmpty(source))
            {
                var compileResult = Compiler.Instance.CompileExpression(
                    expression.ParentFigure.Drawing,
                    source,
                    f => !f.DependsOn(expression.ParentFigure));

                if (compileResult.IsSuccess)
                {
                    result.IsValid = true;
                    result.Value   = source;
                    expression.ParentFigure.Drawing.ClearStatus();
                }
                else
                {
                    result.Error = compileResult.ToString();
                    expression.ParentFigure.Drawing.RaiseStatusNotification(result.Error);
                }
            }
            ;
            return(result);
        }
コード例 #3
0
ファイル: CircleByEquation.cs プロジェクト: ondrej11/o106
 public override void ReadXml(System.Xml.Linq.XElement element)
 {
     X = new DrawingExpression(this, "Center X =", element.ReadString("X"));
     Y = new DrawingExpression(this, "Center Y =", element.ReadString("Y"));
     R = new DrawingExpression(this, "Radius =", element.ReadString("R"));
     base.ReadXml(element);
 }
コード例 #4
0
ファイル: ILineEquation.cs プロジェクト: ondrej11/o106
 public GeneralFormLineEquation(IFigure parent, string a, string b, string c)
 {
     A = new DrawingExpression(parent) { Name = "A = " };
     A.Text = a;
     B = new DrawingExpression(parent) { Name = "B = " };
     B.Text = b;
     C = new DrawingExpression(parent) { Name = "C = " };
     C.Text = c;
 }
コード例 #5
0
ファイル: PointByCoordinates.cs プロジェクト: ondrej11/o106
 public PointByCoordinates()
 {
     XExpression = new DrawingExpression(this)
     {
         Name = "X = "
     };
     YExpression = new DrawingExpression(this)
     {
         Name = "Y = "
     };
 }
コード例 #6
0
 public SlopeInterseptLineEquation(IFigure parent, string slope, string intersept)
 {
     Slope = new DrawingExpression(parent)
     {
         Name = "m = "
     };
     Slope.Text = slope;
     Intersept  = new DrawingExpression(parent)
     {
         Name = "b = "
     };
     Intersept.Text = intersept;
 }
コード例 #7
0
 public GeneralFormLineEquation(IFigure parent, string a, string b, string c)
 {
     A = new DrawingExpression(parent)
     {
         Name = "A = "
     };
     A.Text = a;
     B      = new DrawingExpression(parent)
     {
         Name = "B = "
     };
     B.Text = b;
     C      = new DrawingExpression(parent)
     {
         Name = "C = "
     };
     C.Text = c;
 }
コード例 #8
0
ファイル: ILineEquation.cs プロジェクト: ondrej11/o106
 public SlopeInterseptLineEquation(IFigure parent, string slope, string intersept)
 {
     Slope = new DrawingExpression(parent) { Name = "m = " };
     Slope.Text = slope;
     Intersept = new DrawingExpression(parent) { Name = "b = " };
     Intersept.Text = intersept;
 }
コード例 #9
0
ファイル: PointByCoordinates.cs プロジェクト: ondrej11/o106
 public PointByCoordinates()
 {
     XExpression = new DrawingExpression(this) { Name = "X = " };
     YExpression = new DrawingExpression(this) { Name = "Y = " };
 }