コード例 #1
0
ファイル: ColorTable.cs プロジェクト: naingyelin/msgreader
 /// <summary>
 /// Write
 /// </summary>
 /// <param name="writer"></param>
 public void Write(Writer writer)
 {
     writer.WriteStartGroup();
     writer.WriteKeyword(Consts.Colortbl);
     writer.WriteRaw(";");
     foreach (var item in _arrayList)
     {
         var c = (Color) item;
         writer.WriteKeyword("red" + c.R);
         writer.WriteKeyword("green" + c.G);
         writer.WriteKeyword("blue" + c.B);
         writer.WriteRaw(";");
     }
     writer.WriteEndGroup();
 }
コード例 #2
0
ファイル: FontTable.cs プロジェクト: naingyelin/msgreader
 /// <summary>
 /// Write font table rtf
 /// </summary>
 /// <param name="writer">rtf text writer</param>
 public void Write(Writer writer)
 {
     writer.WriteStartGroup();
     writer.WriteKeyword(Consts.Fonttbl);
     foreach (Font font in this)
     {
         writer.WriteStartGroup();
         writer.WriteKeyword("f" + font.Index);
         if (font.Charset != 0)
         {
             writer.WriteKeyword("fcharset" + font.Charset);
         }
         writer.WriteText(font.Name);
         writer.WriteEndGroup();
     }
     writer.WriteEndGroup();
 }
コード例 #3
0
 // ReSharper disable MemberCanBeProtected.Global
 /// <summary>
 /// Open Rtf file from a textwriter
 /// </summary>
 /// <param name="writer"></param>
 public void Open(TextWriter writer)
 {
     Writer = new Writer(writer) {Indent = false};
 }
コード例 #4
0
 /// <summary>
 /// Open Rtf file from a file
 /// </summary>
 /// <param name="fileName"></param>
 public void Open(string fileName)
 {
     Writer = new Writer(fileName) {Indent = false};
 }
コード例 #5
0
ファイル: DocumentInfo.cs プロジェクト: naingyelin/msgreader
        public void Write(Writer writer)
        {
            writer.WriteStartGroup();
            writer.WriteKeyword("info");
            foreach (string strKey in _infoStringDictionary.Keys)
            {
                writer.WriteStartGroup();
                if (strKey == "edmins"
                    || strKey == "vern"
                    || strKey == "nofpages"
                    || strKey == "nofwords"
                    || strKey == "nofchars"
                    || strKey == "nofcharsws"
                    || strKey == "id")
                {
                    writer.WriteKeyword(strKey + _infoStringDictionary[strKey]);
                }
                else
                {
                    writer.WriteKeyword(strKey);
                    writer.WriteText(_infoStringDictionary[strKey]);
                }
                writer.WriteEndGroup();
            }
            writer.WriteStartGroup();

            WriteTime(writer, "creatim", _creationTime);
            WriteTime(writer, "revtim", _revisionTime);
            WriteTime(writer, "printim", _printTime);
            WriteTime(writer, "buptim", _backupTime);

            writer.WriteEndGroup();
        }
コード例 #6
0
ファイル: DocumentInfo.cs プロジェクト: naingyelin/msgreader
 private void WriteTime(Writer writer, string name, DateTime value)
 {
     writer.WriteStartGroup();
     writer.WriteKeyword(name);
     writer.WriteKeyword("yr" + value.Year);
     writer.WriteKeyword("mo" + value.Month);
     writer.WriteKeyword("dy" + value.Day);
     writer.WriteKeyword("hr" + value.Hour);
     writer.WriteKeyword("min" + value.Minute);
     writer.WriteKeyword("sec" + value.Second);
     writer.WriteEndGroup();
 }
コード例 #7
0
 /// <summary>
 /// Write rtf
 /// </summary>
 /// <param name="writer">RTF writer</param>
 public override void Write(Writer writer)
 {
     writer.Encoding = Encoding;
     base.Write(writer);
 }
コード例 #8
0
ファイル: RawDocument.cs プロジェクト: naingyelin/msgreader
 /// <summary>
 /// Write rtf
 /// </summary>
 /// <param name="writer">RTF writer</param>
 public override void Write(Writer writer)
 {
     writer.Encoding = Encoding;
     base.Write(writer);
 }
コード例 #9
0
ファイル: RawDocument.cs プロジェクト: naingyelin/msgreader
 /// <summary>
 /// Save rtf to a stream
 /// </summary>
 /// <param name="stream">stream</param>
 public void Save(Stream stream)
 {
     using (var writer = new Writer(new StreamWriter(stream, Encoding)))
         Write(writer);
 }
コード例 #10
0
ファイル: RawDocument.cs プロジェクト: naingyelin/msgreader
 /// <summary>
 /// Save rtf to a file
 /// </summary>
 /// <param name="fileName">file name</param>
 public void Save(string fileName)
 {
     using (var writer = new Writer(fileName))
         Write(writer);
 }
コード例 #11
0
ファイル: NodeGroup.cs プロジェクト: naingyelin/msgreader
        /// <summary>
        /// Write content to rtf document
        /// </summary>
        /// <param name="writer">RTF text writer</param>
        public override void Write(Writer writer)
        {
            writer.WriteStartGroup();

            foreach (Node node in InternalNodes)
                node.Write(writer);

            writer.WriteEndGroup();
        }