Ejemplo n.º 1
0
 public static bool IsValid(OrderTokenConflictResolution value)
 {
     if (value != OrderTokenConflictResolution.Win)
     {
         return(value == OrderTokenConflictResolution.Lose);
     }
     return(true);
 }
Ejemplo n.º 2
0
 protected OrderToken(OrderTokenPrecedence precedence, OrderToken reference, OrderTokenConflictResolution conflictResolution)
 {
     if (!EnumValidator.IsValid(precedence))
     {
         throw new ArgumentOutOfRangeException("precedence");
     }
     if (!EnumValidator.IsValid(conflictResolution))
     {
         throw new ArgumentOutOfRangeException("conflictResolution");
     }
     this._reference          = reference;
     this._precedence         = precedence;
     this._conflictResolution = conflictResolution;
     this._depth = reference == (OrderToken)null ? 0 : reference._depth + 1;
     this._index = reference == (OrderToken)null ? -1 : reference._nextChildIndex++;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new OrderToken instance based on the specified
        /// referenced OrderToken, precedence, and conflict resolution
        /// semantics.
        /// </summary>
        /// <param name="precedence">Precedence of this token based on the
        /// referenced token.</param>
        /// <param name="reference">Referenced token.  May be null for the
        /// root token case (token that's not dependent on anything else).</param>
        /// <param name="conflictResolution">Conflict resolution semantics.
        /// Winning ConflictResultion semantic should only be used
        /// on predefined, default OrderToken instances to ensure
        /// their correct placement in more complex chain of order
        /// dependencies.</param>
        protected OrderToken(
            OrderTokenPrecedence precedence,
            OrderToken reference,
            OrderTokenConflictResolution conflictResolution)
        {
            if (!EnumValidator.IsValid(precedence))
            {
                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("precedence"));
            }
            if (!EnumValidator.IsValid(conflictResolution))
            {
                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("conflictResolution"));
            }

            _reference          = reference;
            _precedence         = precedence;
            _conflictResolution = conflictResolution;
            _depth = reference == null ? 0 : reference._depth + 1;
            _index = reference == null ? -1 : reference._nextChildIndex++;
        }
Ejemplo n.º 4
0
 public static bool IsValid(OrderTokenConflictResolution value)
 {
     return value == OrderTokenConflictResolution.Win || value == OrderTokenConflictResolution.Lose;
 }
Ejemplo n.º 5
0
 private AdornerOrder(OrderTokenPrecedence precedence, OrderToken reference, OrderTokenConflictResolution conflictResolution)
     : base(precedence, reference, conflictResolution)
 {
 }
Ejemplo n.º 6
0
 private PropertyOrder(OrderTokenPrecedence precedence, OrderToken reference, OrderTokenConflictResolution conflictResolution)
     : base(precedence, reference, conflictResolution)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a PropertyOrder.  
 /// </summary>
 /// <param name="precedence">Precedence of this token based on the
 /// referenced token.</param>
 /// <param name="reference">Referenced token.</param>
 /// <param name="conflictResolution">Conflict resolution semantics.
 /// Winning ConflictResultion semantic should only be used
 /// on predefined, default OrderToken instances to ensure
 /// their correct placement in more complex chain of order
 /// dependencies.</param>
 private PropertyOrder(OrderTokenPrecedence precedence, OrderToken reference, OrderTokenConflictResolution conflictResolution)
     : base(precedence, reference, conflictResolution) {
 }