using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.Modeling.Validation;

namespace MDC.ProductionSystem
{
    [ValidationState(ValidationState.Enabled)]
    public partial class ConveyorBelt
    {
        [ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
        private void ValidateConveyorBeltLoop(ValidationContext context)
        {
            foreach (ConveyorBelt source in this.CB_CB_SourceConveyorBelts)
            {
                ConveyorBelt target = this.CB_CB_TargetConveyorBelts;
                if (source == target)
                    context.LogError(CustomCode.Validation.ValidationResources.ConveyorLoopError, "ProductionSystem 01", this);
            }
        }
    }
}