Exemple #1
0
 /// <summary>
 /// 判断当前文件是否为指定目标的忽略文件.
 /// </summary>
 /// <returns><c>true</c>, 忽略文件, <c>false</c> 非忽略文件.</returns>
 /// <param name="iTarget">目标.</param>
 /// <param name="iTargetFile">目标文件.</param>
 public bool isIgnoreFile(BundleResource iTarget, string iTargetFile)
 {
     if ((null == iTarget) ||
         (null == iTarget.IgnoreList) ||
         (true == string.IsNullOrEmpty(iTargetFile)))
     {
         return(false);
     }
     return(iTarget.isIgnoreTargetExist(iTargetFile));
 }
Exemple #2
0
 /// <summary>
 /// 添加资源信息.
 /// </summary>
 /// <param name="iResourceInfo">资源信息.</param>
 public BundleResource AddResource(BundleResource iResourceInfo)
 {
     if (null == this.Data)
     {
         return(null);
     }
     if (null == iResourceInfo)
     {
         return(null);
     }
     return(this.Data.AddResource(
                iResourceInfo.Mode, iResourceInfo.Path,
                iResourceInfo.IgnoreList));
 }
Exemple #3
0
        /// <summary>
        /// 清空目标忽略列表.
        /// </summary>
        /// <param name="iIgnoreTarget">忽略目标.</param>
        public void ClearIgnore(string iIgnoreTarget)
        {
            BundleResource target = this.GetMatchTarget(iIgnoreTarget);

            if (null != target)
            {
                target.IgnoreList.Clear();
            }
            else
            {
                this.Error("ClearIgnore():No match target for ignore!!(Ignore Target:{0})",
                           iIgnoreTarget);
            }
        }
Exemple #4
0
        /// <summary>
        /// 移除忽略目标.
        /// </summary>
        /// <param name="iIgnoreTarget">忽略目标.</param>
        public void RemoveIgnoreTarget(string iIgnoreTarget)
        {
            BundleResource target = this.GetMatchTarget(iIgnoreTarget);

            if (null != target)
            {
                target.RemoveIgnoreTarget(iIgnoreTarget);
            }
            else
            {
                this.Error("RemoveIgnoreTarget():No match target for ignore!!(Ignore Target:{0})",
                           iIgnoreTarget);
            }
        }
Exemple #5
0
        /// <summary>
        /// 追加资源.
        /// </summary>
        /// <param name="iMode">打包模式.</param>
        /// <param name="iResourePath">资源路径.</param>
        /// <param name="iIgnoreList">忽略列表.</param>
        public BundleResource AddResource(
            BundleMode iMode,
            string iResourcePath,
            List <string> iIgnoreList)
        {
            if (true == string.IsNullOrEmpty(iResourcePath))
            {
                return(null);
            }

            BundleResource target = null;

            foreach (BundleResource loop in Resources)
            {
                if (false == iResourcePath.Equals(loop))
                {
                    continue;
                }
                target = loop;
                break;
            }

            // 不存在
            if (null == target)
            {
                target = new BundleResource();
                this.Resources.Add(target);
                target.Mode       = iMode;
                target.Path       = iResourcePath;
                target.IgnoreList = iIgnoreList;
            }
            else
            {
                target.Mode = iMode;
                if ((null != iIgnoreList) && (1 <= iIgnoreList.Count))
                {
                    foreach (string ignore in iIgnoreList)
                    {
                        target.AddIgnoreTarget(ignore);
                    }
                }
            }
            if (null == target)
            {
                this.Error("AddResource():Invalid target!!(Mode:{0} Path:{1})",
                           iMode, iResourcePath);
            }
            return(target);
        }
Exemple #6
0
        /// <summary>
        /// 追加忽略目标.
        /// </summary>
        /// <param name="iIgnoreTarget">忽略目标.</param>
        public BundleResource AddIgnoreTarget(string iIgnoreTarget)
        {
            BundleResource target = this.GetMatchTarget(iIgnoreTarget);

            if (null != target)
            {
                target.AddIgnoreTarget(iIgnoreTarget);
            }
            else
            {
                this.Error("AddIgnorTarget():No match target for ignore!!(Ignore Target:{0})",
                           iIgnoreTarget);
            }
            return(target);
        }