Exemplo n.º 1
0
 /// <summary>
 /// Determine whether profile does not require any additional time to be satisfied.
 /// </summary>
 internal bool IsSatisfied(TraceContext context)
 {
     requireEmptyContext();
     try
     {
         _actualContext = context;
         var protocol = requiresTicks();
         return(protocol == null || protocol.ExpansionTicks == 0);
     }
     finally
     {
         _actualContext = null;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Determine whether profile can be further expanded.
        /// </summary>
        internal bool CanBeExpanded(TraceContext context)
        {
            requireEmptyContext();
            try
            {
                _actualContext = context;
                var protocol = nextStepTicks();

                return(protocol != null && protocol.ExpansionTicks > 0);
            }
            finally
            {
                _actualContext = null;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Expands on the smallest satisfiing length or expands for a single step if already satisfied.
        /// </summary>
        internal void Expand(TraceContext context)
        {
            requireEmptyContext();
            try
            {
                _actualContext = context;

                var protocol = requiresTicks();
                if (protocol == null || protocol.ExpansionTicks == 0)
                {
                    protocol = nextStepTicks();
                }

                applyExpansionTicks(protocol);
            }
            finally
            {
                _actualContext = null;
            }
        }