Exemplo n.º 1
0
        /// <summary>
        /// 添加服务
        /// </summary>
        /// <param name="handle"></param>
        public void AddServices(AbsServicesHandle handle)
        {
            string            key       = handle.ServicesID;
            AbsServicesHandle outHandle = null;

            if (_dicServices.TryGetValue(key, out outHandle))
            {
                if (outHandle.SerVersion < handle.SerVersion)
                {
                    _dicServices[key] = handle;
                }
            }
            else
            {
                _dicServices[key] = handle;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 加载程序集
        /// </summary>
        /// <param name="ass"></param>
        public void LoadAssembly(Assembly ass)
        {
            Type inteType = typeof(AbsServicesHandle);

            Type[] classes = ass.GetTypes();
            foreach (Type objType in classes)
            {
                if (!objType.IsClass)
                {
                    continue;
                }
                if (!DefaultType.IsInherit(objType, inteType))
                {
                    continue;
                }
                AbsServicesHandle handle = Activator.CreateInstance(objType) as AbsServicesHandle;
                if (handle == null)
                {
                    continue;
                }
                AddServices(handle);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 信息类
 /// </summary>
 /// <param name="handle"></param>
 /// <param name="message"></param>
 /// <param name="tag"></param>
 public ServicesMessage(AbsServicesHandle handle)
 {
     _handle = handle;
     //_message = message;
     //_tag = tag;
 }