WriteContent() публичный Метод

public WriteContent ( Stream result ) : void
result Stream
Результат void
Пример #1
0
        /**
         * Writes the RTF information group and its elements.
         */
        public override void WriteContent(Stream result)
        {
            result.Write(OPEN_GROUP, 0, OPEN_GROUP.Length);
            result.Write(INFO_GROUP, 0, INFO_GROUP.Length);
            for (int i = 0; i < infoElements.Count; i++)
            {
                RtfInfoElement infoElement = (RtfInfoElement)infoElements[i];
                infoElement.WriteContent(result);
            }

            // handle document protection
            if (document.GetDocumentSettings().IsDocumentProtected())
            {
                byte[] t;
                result.Write(OPEN_GROUP, 0, OPEN_GROUP.Length);
                result.Write(INFO_PASSWORD, 0, INFO_PASSWORD.Length);
                result.Write(DELIMITER, 0, DELIMITER.Length);
                result.Write(t = document.GetDocumentSettings().GetProtectionHashBytes(), 0, t.Length);
                result.Write(CLOSE_GROUP, 0, CLOSE_GROUP.Length);
            }
            result.Write(CLOSE_GROUP, 0, CLOSE_GROUP.Length);
            this.document.OutputDebugLinebreak(result);
        }
        /// <summary>
        /// Writes the RTF information group and its elements.
        /// </summary>
        public override void WriteContent(Stream result)
        {
            result.Write(OpenGroup, 0, OpenGroup.Length);
            result.Write(_infoGroup, 0, _infoGroup.Length);
            for (int i = 0; i < _infoElements.Count; i++)
            {
                RtfInfoElement infoElement = (RtfInfoElement)_infoElements[i];
                infoElement.WriteContent(result);
            }

            // handle document protection
            if (Document.GetDocumentSettings().IsDocumentProtected())
            {
                byte[] t;
                result.Write(OpenGroup, 0, OpenGroup.Length);
                result.Write(_infoPassword, 0, _infoPassword.Length);
                result.Write(Delimiter, 0, Delimiter.Length);
                result.Write(t = Document.GetDocumentSettings().GetProtectionHashBytes(), 0, t.Length);
                result.Write(CloseGroup, 0, CloseGroup.Length);
            }
            result.Write(CloseGroup, 0, CloseGroup.Length);
            Document.OutputDebugLinebreak(result);
        }