Exemplo n.º 1
0
        /// <summary>开始初始化。初始化之后,不属于当前宿主的插件将会被过滤掉</summary>
        public void Init()
        {
            var ps = Plugins;

            if (ps == null || ps.Count < 1)
            {
                return;
            }

            for (int i = ps.Count - 1; i >= 0; i--)
            {
                try
                {
                    if (!ps[i].Init(Identity, Provider))
                    {
                        ps.RemoveAt(i);
                    }
                }
                catch (Exception ex)
                {
                    XTrace.WriteExceptionWhenDebug(ex);

                    ps.RemoveAt(i);
                }
            }
        }