Ejemplo n.º 1
0
        /// <summary>
        /// 获取当前插件所有扩展点的元数据集合
        /// </summary>
        /// <returns></returns>
        private IExtensionPoint[] GetExtensionPoints()
        {
            // 检查集合是否已存在
            if (extensionPoints != null)
            {
                return(extensionPoints.ToArray());
            }
            // 获取所有扩展元数据
            XExtensionPoint[] xExtensionPoints = manifest.ExtensionPoints;
            if (xExtensionPoints == null || xExtensionPoints.Length == 0)
            {
                return(null);
            }
            foreach (XExtensionPoint xExtensionPoint in xExtensionPoints)
            {
                if (extensionPoints == null)
                {
                    extensionPoints = new List <IExtensionPoint>();
                }
                ExtensionPointImpl entry = new ExtensionPointImpl(this.bundle, xExtensionPoint);
                extensionPoints.Add(entry);
            }

            return(extensionPoints.ToArray());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 检查是否相等
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            ExtensionPointImpl target = obj as ExtensionPointImpl;

            if (target == null)
            {
                return(false);
            }
            if (this == target)
            {
                return(true);
            }

            return(this.point.EqualsIgnoreCase(target.point));
        }