示例#1
0
 bool IsSimilarConstraintExists(TwCommandConstraints constraints)
 {
     foreach (TwCommandConstraint constraint in constraints)
     {
         if (constraint.Attribute == TwCommandConstraintAttribute.Similar && constraint.Relation == TwCommandConstraintRelation.None)
         {
             return(true);
         }
     }
     return(false);
 }
示例#2
0
 bool ContainsAttribute(TwCommandConstraints constraints, TwCommandConstraintAttribute attribute)
 {
     foreach (var constraint in constraints)
     {
         if (constraint.Attribute == attribute)
         {
             return(true);
         }
     }
     return(false);
 }
示例#3
0
        TwCommandConstraints GetConstraints(string[] tokens, ref int index, ref string error)
        {
            var constraints = new TwCommandConstraints();

            TwCommandConstraint constraint;

            while ((index < tokens.Length) && (constraint = GetConstraint(tokens, ref index, ref error)) != null)
            {
                constraints.Add(constraint);
            }

            return(constraints);
        }
示例#4
0
        void PackageConstraints(TwCommandConstraints constraints, Event @event)
        {
            foreach (var constraint in constraints)
            {
                var constraintBoolEvent = constraint as TwCommandConstraintBoolEvent;
                if (constraintBoolEvent != null)
                {
                    constraintBoolEvent.EventSource = @event;
                }

                var constraintListItem = constraint as TwCommandConstraintListItem;
                if (constraintListItem != null)
                {
                    constraintListItem.FixtureProfiles = analysisPanel.Analysis.FixtureProfiles;
                }
            }
        }
示例#5
0
 public TwCommand()
 {
     Fixtures    = new TwCommandFixtures();
     Constraints = new TwCommandConstraints();
 }