Example #1
0
        /// <summary>
        /// 写入文件
        /// </summary>
        /// <param name="fileItem"></param>
        /// <param name="proxy"></param>
        /// <returns></returns>
        public static WriteFileResultItemData WriteFile(WriteFileItemData fileItem, IRemoteFileStorage proxy)
        {
            WriteFileResultItemData result = null;

            ManagerHelper.CheckNullReference(fileItem, "fileItem");
            WriteFileParameter param = new WriteFileParameter();

            param.InputData.Add(fileItem);
            WriteFileResult itemResult = WriteFile(param, proxy);

            if (itemResult.RecordCount > 0)
            {
                result = itemResult.ExecuteResult[0];
            }
            return(result);
        }
Example #2
0
        protected virtual void WriteCore(long pos, byte[] buffer)
        {
            WriteFileItemData item = new WriteFileItemData();

            if (LogicFileInfo != null)
            {
                item.ClientFileName = LogicFileInfo.LogicFileName;
            }
            if (ContextWrapper.OpenFileResult != null)
            {
                item.LockID = ContextWrapper.OpenFileResult.LockedID;
            }

            if (ContextWrapper.PhysicalFileInfo != null)
            {
                item.PhysicalFileID = ContextWrapper.PhysicalFileInfo.ID;
            }

            item.Position  = pos;
            item.WriteData = buffer;

            FileManager.WriteFile(item, this.ContextWrapper.ServiceProxy);
        }
Example #3
0
 /// <summary>
 /// 写入文件
 /// </summary>
 /// <param name="fileItem"></param>
 /// <returns></returns>
 public static WriteFileResultItemData WriteFile(WriteFileItemData fileItem)
 {
     return(WriteFile(fileItem, null));
 }