Beispiel #1
0
        protected override NodeEqualityCollection Compare(IBaseNode compareWith, eCompareMode mode)
        {
            NodeEqualityCollection result = base.Compare(compareWith, mode);

            if (!result.HasEqualityType(eNodeEquality.basetype))
            {
                if (this._Model != (compareWith as IDomainObjectImpl).FullModelName)
                {
                    result.Add(eDomainObjectEquality.submodel, false, false, "Different sub models");
                }

                if (compareWith is EnumVariableImpl)
                {
                    List <string> equal = new List <string>();
                    foreach (string elem in (compareWith as IDomainObject).Methods)
                    {
                        if (_Methods.Contains(elem))
                        {
                            equal.Add(elem);
                        }
                    }

                    if (_Methods.Count != equal.Count || (compareWith as IDomainObject).Methods.Count != equal.Count)
                    {
                        result.Add(eDomainObjectEquality.methods, false, false, "Different number of methods");
                    }
                }
            }

            return(result);
        }
Beispiel #2
0
        protected virtual NodeEqualityCollection Compare(IBaseNode compareWith, eCompareMode mode = eCompareMode.Default)
        {
            NodeEqualityCollection result = new NodeEqualityCollection();

            if (NodeType != compareWith.NodeType)
            {
                result.Add(eNodeEquality.basetype, false, true, "Different types");
            }

            if (mode == eCompareMode.Full && Reference != compareWith.Reference)
            {
                result.Add(eNodeEquality.reference, false, false, "Different references");
            }

            return(result);
        }
Beispiel #3
0
        NodeEqualityCollection IBaseNode.Compare(IBaseNode compareWith, eCompareMode mode)
        {
            if (compareWith != null)
            {
                return(Compare(compareWith, mode));
            }

            NodeEqualityCollection result = new NodeEqualityCollection();

            result.Add(eNodeEquality.basetype, true, true, "Compare with null value");
            return(result);
        }
        protected override NodeEqualityCollection Compare(IBaseNode compareWith, eCompareMode mode)
        {
            NodeEqualityCollection result = new NodeEqualityCollection();

            if (NodeType != compareWith.NodeType)
            {
                result.Add(eNodeEquality.basetype, false, true, "Different types");
            }

            if (_VariableType != (compareWith as IVariableDef).VariableType)
            {
                result.Add(eVariableEquality.type, false, true, "Different variable type");
            }

            if (GetValue() != (compareWith as IVariableDef).Value)
            {
                result.Add(eVariableEquality.value, false, false, "Different variable values");
            }

            return(result);
        }
Beispiel #5
0
        protected override NodeEqualityCollection Compare(IBaseNode compareWith, eCompareMode mode)
        {
            NodeEqualityCollection result = base.Compare(compareWith, mode);

            if (compareWith is NumericVariableImpl)
            {
                if (Minimum != (compareWith as UI_NumericVariable).Minimum)
                {
                    result.Add(eVariableEquality.min, false, false, "");
                }

                if (Maximum != (compareWith as UI_NumericVariable).Maximum)
                {
                    result.Add(eVariableEquality.max, false, false, "");
                }

                if (Sequence != (compareWith as UI_NumericVariable).Sequence)
                {
                    result.Add(eVariableEquality.domain, false, false, "");
                }
            }

            return(result);
        }
        protected override NodeEqualityCollection Compare(IBaseNode compareWith, eCompareMode mode)
        {
            NodeEqualityCollection result = base.Compare(compareWith, mode);

            if (compareWith is EnumVariableImpl)
            {
                List <string> equal = new List <string>();
                foreach (string elem in (compareWith as EnumVariableImpl).GetElements())
                {
                    if (_Elements.Contains(elem))
                    {
                        equal.Add(elem);
                    }
                }

                if (_Elements.Count != equal.Count || (compareWith as EnumVariableImpl).GetElements().Count != equal.Count)
                {
                    result.Add(eVariableEquality.domain, false, false, "Different number of domain elements");
                }
            }

            return(result);
        }