示例#1
0
        public static Responder getInstance()
        {
            if (instance != null)
            {
                return(instance);
            }

            instance = new BoringResponder();
            return(instance);
        }
示例#2
0
 public static Responder GetResponder(string name)
 {
     if (name == null)
     {
         return(BoringResponder.getInstance());
     }
     if (name.ToLower().StartsWith("arn"))
     {
         return(ArnieResponder.getInstance());
     }
     else if (name.ToLower().StartsWith("marx") || name.ToLower().StartsWith("karl"))
     {
         return(MarxResponder.getInstance());
     }
     else
     {
         return(BoringResponder.getInstance());
     }
 }