示例#1
0
 public override ISN Reset()
 {
     if (SNContexts != null)
     {
         SNContexts.Clear();
     }
     else
     {
         SNContexts = new Dictionary <string, ISNContext> ();
     }
     return(this);
 }
示例#2
0
 public ISNContext GetContext(string context = SNContextLevel.DEFAULT)
 {
     if (SNContexts.ContainsKey(context))
     {
         if (SNContexts [context] == null)
         {
             SNContexts [context] = new SNContext();
             return(SNContexts [context]);
         }
         else
         {
             return(SNContexts [context]);
         }
     }
     else
     {
         SNContexts.Add(context, new SNContext());
         return(SNContexts [context]);
     }
 }
示例#3
0
 public SNKit ResetContext(string context = SNContextLevel.DEFAULT)
 {
     if (SNContexts.ContainsKey(context))
     {
         if (SNContexts [context] == null)
         {
             Log(string.Format("SNContexts[{0}] IS NULL", context));
             return(this);
         }
         else
         {
             SNContexts [context].Reset();
             return(this);
         }
     }
     else
     {
         Log(string.Format("SNContexts[{0}] CAN'T FOUND", context));
         return(this);
     }
 }