/// <summary>
        /// Used by the internal framwork. Do not explicit call this method.
        /// </summary>
        public static ISession Pop(String id)
        {
            Pair pair = CurStack.Pop() as Pair;

            if (pair == null)
            {
                return(null);
            }
            Debug.Assert(pair.id.Equals(id));
            return(pair.Session);
        }
 /// <summary>
 /// Used by the internal framwork. Do not explicit call this method.
 /// </summary>
 public static void Push(ISession session, String id)
 {
     CurStack.Push(new Pair(session, id));
 }