Пример #1
0
 /// <summary>
 /// 添加对象.
 /// </summary>
 /// <param name="iTarget">目标.</param>
 private void AddTarget(BundlesResultItem iTarget)
 {
     if (iTarget == null)
     {
         return;
     }
     Targets.Add(iTarget);
 }
Пример #2
0
        /// <summary>
        /// 创建UploadItem.
        /// </summary>
        /// <returns>UploadItem.</returns>
        /// <param name="iTargetId">目标ID.</param>
        /// <param name="iBundleType">Bundle类型.</param>
        /// <param name="iFileType">文件类型.</param>
        private BundlesResultItem CreateBundleItem(
            string iTargetId, BundleType iBundleType,
            BundleFileType iFileType)
        {
            var objRet = new BundlesResultItem
            {
                no         = GetBundleNo(),
                id         = iTargetId,
                bundleType = iBundleType,
                fileType   = iFileType,
                uploaded   = false
            };

            Targets.Add(objRet);
            return(objRet);
        }
Пример #3
0
        /// <summary>
        /// 判断目标是否存在.
        /// </summary>
        /// <returns><c>true</c>,存在, <c>false</c> 不存在.</returns>
        /// <param name="iTargetId">目标ID.</param>
        /// <param name="iFileType">文件类型.</param>
        /// <param name="iTarget">目标信息.</param>
        private bool IsTargetExist(string iTargetId, BundleFileType iFileType, out BundlesResultItem iTarget)
        {
            iTarget = null;

            var targets = Targets
                          .Where(iO => iTargetId.Equals(iO.id) &&
                                 iFileType == iO.fileType)
                          .OrderBy(iO => iO.no)
                          .ToArray();

            if (targets.Length <= 0)
            {
                return(false);
            }
            if (1 != targets.Length)
            {
                this.Warning("isTargetExist()::There is duplicate id exist in upload list!!!(Bundle ID:{0})", iTargetId);
            }
            iTarget = targets [0];
            return(true);
        }