Ejemplo n.º 1
0
        public override ExpressionObjectBase Clone()
        {
            var clone = new ConditionExpression
            {
                ExpressionName = ExpressionName,
                FunctionName = FunctionName,
                Width = Width,
                Height = Height,
                Top = Top,
                Left = Left
            };
            Connector1In.Clone(clone.Connector1In);
            Connector2In.Clone(clone.Connector2In);
            Connector3In.Clone(clone.Connector3In);
            ConnectorOut.Clone(clone.ConnectorOut);

            return clone;            
        }
Ejemplo n.º 2
0
        public void CloneTest()
        {
            var source = new ConditionExpression { ExpressionName = "source", Width = 1, Height = 2, Top = 3, Left = 4, ConnectorOut = { Name = "4" } };

            var cloneTo = (ConditionExpression)source.Clone();
            Assert.AreEqual(source.ExpressionName, cloneTo.ExpressionName);
            Assert.AreEqual(source.Width, cloneTo.Width);
            Assert.AreEqual(source.Height, cloneTo.Height);
            Assert.AreEqual(source.Top, cloneTo.Top);
            Assert.AreEqual(source.Left, cloneTo.Left);

            Assert.AreNotEqual(source.Id, cloneTo.Id);
            Assert.AreNotEqual(source.ConnectorOut.Id, cloneTo.ConnectorOut.Id);
            Assert.AreNotEqual(source.Connector1In.Id, cloneTo.Connector1In.Id);
            Assert.AreNotEqual(source.Connector2In.Id, cloneTo.Connector2In.Id);
            Assert.AreNotEqual(source.Connector3In.Id, cloneTo.Connector3In.Id);

            Assert.AreEqual(source.ConnectorOut.Name, cloneTo.ConnectorOut.Name);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds the field node.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="diagramViewModel">The diagram view model.</param>
 private static void AddFieldNode(ConditionExpression item, IDiagramViewModel diagramViewModel)
 {
     var node = new ConditionExpressionNode(diagramViewModel, item);
     diagramViewModel.Items.Add(new NodeViewModel<ConditionExpressionNode, ExpressionConnection>(node, diagramViewModel));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConditionExpressionNode"/> class.
 /// </summary>
 /// <param name="diagramViewModel">The diagram view model.</param>
 /// <param name="expressionObject">The expression object.</param>
 public ConditionExpressionNode(IDiagramViewModel diagramViewModel, ConditionExpression expressionObject)
     : base(diagramViewModel, expressionObject)
 {
     _diagramViewModel = diagramViewModel;
 }