コード例 #1
0
 private static void Mark(ComparisonStatus comparisonStatus, object other)
 {
     var markable = other as Markable;
     if (markable == null) return;
     markable.ComparisonStatus.CopyFrom(comparisonStatus);
 }
コード例 #2
0
 private void RecordUnknowns(ComparisonStatus other)
 {
     if (other.state.Equals(Tristate.DontKnow))
         childStatuses.Add(other);
 }
コード例 #3
0
 public void CopyFrom(ComparisonStatus comparisonStatus)
 {
     state = comparisonStatus.state;
     if(childStatuses == null) throw new Exception("we are screwed");
     childStatuses.AddRange(comparisonStatus.childStatuses);
 }
コード例 #4
0
        internal void And(ComparisonStatus other)
        {
            if (Tristate.Eager.Equals(State)) return;

            if(Tristate.DontKnow.Equals(other.State)) return;

            if (state.Equals(Tristate.DontKnow))
                State = other.State;

            else if (state.Equals(Tristate.Lazy) && other.State.Equals(Tristate.Lazy))
                State = Tristate.Lazy;

            else if (!other.state.Equals(Tristate.DontKnow))
                State = Tristate.Eager;
        }
コード例 #5
0
 public ComparisonStatus Combine(ComparisonStatus other)
 {
     And(other);
     RecordUnknowns(other);
     return this;
 }