protected IGetDisplayRate this[string key]
 {
     get
     {
         if (InterfaceInstanceList.ContainsKey(key))
         {
             return(InterfaceInstanceList[key]);
         }
         else
         {
             List <InterfaceInstance> interfaces  = InterfaceInstanceOperator.Instance.LoadListByName("IGetDisplayRate");
             InterfaceInstance        newInstance = interfaces.Find(I => I.InterfaceInstanceName == key);
             if (newInstance != null)
             {
                 IGetDisplayRate _interface = DisplayRateBuilder.Instance.DoBuild(newInstance.Reference);
                 if (_interface != null)
                 {
                     AddHandle(newInstance.InterfaceInstanceName, _interface);
                     return(_interface);
                 }
             }
         }
         return(DefaultHandle);
     }
 }
 protected void AddHandle(string InstanceName, IGetDisplayRate interfaceInstance)
 {
     if (!InterfaceInstanceList.ContainsKey(InstanceName))
     {
         InterfaceInstanceList.Add(InstanceName, interfaceInstance);
     }
     else
     {
         InterfaceInstanceList[InstanceName] = interfaceInstance;
     }
 }
        public DisplayRateEngine()
        {
            //注册
            AddHandle("*", new DefaultDisplayRate());
            List <InterfaceInstance> interfaces = InterfaceInstanceOperator.Instance.LoadListByName("IGetDisplayRate");

            //注册扩展服务
            foreach (InterfaceInstance info in interfaces)
            {
                //根据InterfaceInstanceName,实现不同的处理方法
                IGetDisplayRate _interface = DisplayRateBuilder.Instance.DoBuild(info.Reference);
                if (_interface != null)
                {
                    AddHandle(info.InterfaceInstanceName, _interface);
                }
            }
        }