Ejemplo n.º 1
0
        public static NFileInfo FromPBMsg(MsgFileInfo input)
        {
            NFileInfo nFileInfo = new NFileInfo();

            nFileInfo.Author     = input.Author1;
            nFileInfo.Version    = input.Version2;
            nFileInfo.CreateDate = input.CreateDate3;
            nFileInfo.CreateTime = input.CreateTime4;
            nFileInfo.Remark     = input.Remark5;
            nFileInfo.FileName   = input.FileName6;
            nFileInfo.FileURL    = input.FileURL7;
            nFileInfo.FileNO     = input.FileNO8;
            nFileInfo.FileMD5    = input.FileMD59;
            nFileInfo.FileSize   = input.FileSize10;
            bool flag = input.Data11 != null && input.Data11 != ByteString.Empty;

            if (flag)
            {
                nFileInfo.Data = input.Data11.ToByteArray();
            }
            nFileInfo.Operation = input.Operation12;
            nFileInfo.BatchNO   = input.BatchNO13;
            nFileInfo.Category  = input.Category14;
            nFileInfo.NotesList.Clear();
            bool flag2 = input.Notes15List != null;

            if (flag2)
            {
                foreach (MsgNoteInfo current in input.Notes15List)
                {
                    nFileInfo.NotesList.Add(NNoteInfo.FromPBMsg(current));
                }
            }
            nFileInfo.ExFaPiaoCode   = input.ExFaPiaoCode16;
            nFileInfo.Editable       = input.Editable18;
            nFileInfo.ExShenheResult = input.ExShenheResult19;
            nFileInfo.ExShenheRemark = input.ExShenheRemark20;
            nFileInfo.LocalPath      = input.LocalPath21;
            return(nFileInfo);
        }
Ejemplo n.º 2
0
        public void ToPBFile(string fname, bool includefiledata = true)
        {
            MsgFileInfo msgFileInfo = this.ToPBMsg(includefiledata);

            File.WriteAllBytes(fname, msgFileInfo.ToByteArray());
        }