public void RopWriteAndCommitStreamMethod(out CPRPTErrorCode error)
{
error = CPRPTErrorCode.None;
bool isWriteCorrectDataToStream = false;
RopSeekStreamResponse seekStreamResponse1 = this.RopSeekStream(this.cprptCurrentHandle, (byte)Origin.Current, 0, true);
RopWriteStreamResponse writeStreamResponse = this.RopWriteAndCommitStream(this.cprptCurrentHandle, WriteData, false);
RopSeekStreamResponse seekStreamResponse2 = this.RopSeekStream(this.cprptCurrentHandle, (byte)Origin.Current, 0, true);
if (seekStreamResponse2.NewPosition - seekStreamResponse1.NewPosition == (ulong)WriteData.Length)
{
isWriteCorrectDataToStream = true;
}
// Message and attachment object can only be changed after saving.
this.RopSaveChangesAttachment(cprptAttachmentHandle[0], true);
this.RopSaveChangesMessage(cprptMessageHandle[0], true);
this.VerifyRopWriteAndCommitStream(writeStreamResponse, isWriteCorrectDataToStream);
if (this.cprptCurrentType == ServerObjectType.Folder && writeStreamResponse.ReturnValue != (uint)CPRPTErrorCode.None)
{
error = CPRPTErrorCode.NotFound;
}
}