Close() public method

close
public Close ( ) : void
return void
示例#1
0
        /// <summary>
        /// Test generate rtf file
        /// after execute this function you can open c:\a.rtf
        /// </summary>
        internal static void TestWriteFile( )
        {
            RTFWriter w = new RTFWriter("c:\\a.rtf");

            TestBuildRTF(w);
            w.Close();
            System.Windows.Forms.MessageBox.Show("OK , you can open file c:\\a.rtf 了.");
        }
示例#2
0
 /// <summary>
 /// Save rtf to a stream
 /// </summary>
 /// <param name="stream">stream</param>
 public void Save(System.IO.Stream stream)
 {
     using (var writer = new RTFWriter(new System.IO.StreamWriter(stream, Encoding)))
     {
         Write(writer);
         writer.Close();
     }
 }
示例#3
0
 /// <summary>
 /// save rtf file
 /// </summary>
 /// <param name="strFileName">file name</param>
 public void Save(string strFileName)
 {
     using (var writer = new RTFWriter(strFileName))
     {
         Write(writer);
         writer.Close();
     }
 }
示例#4
0
        /// <summary>
        /// Test generate rtf text and copy to windows clipboard
        /// after execute this function , you can paste rtf text in MS Word
        /// </summary>
        internal static void TestClipboard()
        {
            System.IO.StringWriter myStr = new System.IO.StringWriter();
            RTFWriter w = new RTFWriter(myStr);

            TestBuildRTF(w);
            w.Close();
            System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject();
            data.SetData(System.Windows.Forms.DataFormats.Rtf, myStr.ToString());
            System.Windows.Forms.Clipboard.SetDataObject(data, true);
            System.Windows.Forms.MessageBox.Show("OK, you can paste words in MS Word.");
        }
示例#5
0
        /// <summary>
        /// test
        /// </summary>
        internal static void Test()
        {
            var doc = new RTFRawDocument();

            doc.Load(@"d:\abc.rtf");
            //System.Console.WriteLine( doc.Text );
            var writer = new RTFWriter(@"d:\a.rtf");

            writer.Indent = true;
            doc.Write(writer);
            writer.Close();
        }
 /// <summary>
 /// test 
 /// </summary>
 internal static void Test()
 {
     RTFRawDocument doc = new RTFRawDocument();
     doc.Load(@"d:\abc.rtf");
     //System.Console.WriteLine( doc.Text );
     RTFWriter writer = new RTFWriter(@"d:\a.rtf");
     writer.Indent = true ;
     doc.Write( writer );
     writer.Close();
 }
 /// <summary>
 /// Save rtf to a stream
 /// </summary>
 /// <param name="stream">stream</param>
 public void Save( System.IO.Stream stream )
 {
     using( RTFWriter writer = new RTFWriter( new System.IO.StreamWriter( stream , this.Encoding )))
     {
         this.Write( writer );
         writer.Close();
     }
 }
 /// <summary>
 /// save rtf file
 /// </summary>
 /// <param name="strFileName">file name</param>
 public void Save( string strFileName )
 {
     using( RTFWriter writer = new RTFWriter( strFileName ))
     {
         this.Write( writer );
         writer.Close();
     }
 }
 /// <summary>
 /// Save rtf to a stream
 /// </summary>
 /// <param name="stream">stream</param>
 public void Save(Stream stream)
 {
     using (var writer = new RTFWriter(new StreamWriter(stream, Encoding)))
     {
         Write(writer);
         writer.Close();
     }
 }
示例#10
0
 /// <summary>
 /// Test generate rtf file
 /// after execute this function you can open c:\a.rtf
 /// </summary>
 internal static void TestWriteFile( )
 {
     RTFWriter w = new RTFWriter( "c:\\a.rtf" ) ;
     TestBuildRTF( w );
     w.Close();
     System.Windows.Forms.MessageBox.Show("OK , you can open file c:\\a.rtf ��.");
 }
示例#11
0
 /// <summary>
 /// Test generate rtf text and copy to windows clipboard
 /// after execute this function , you can paste rtf text in MS Word
 /// </summary>
 internal static void TestClipboard()
 {
     System.IO.StringWriter myStr = new System.IO.StringWriter();
     RTFWriter w = new RTFWriter( myStr );
     TestBuildRTF( w );
     w.Close();
     System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject();
     data.SetData( System.Windows.Forms.DataFormats.Rtf , myStr.ToString());
     System.Windows.Forms.Clipboard.SetDataObject( data , true );
     System.Windows.Forms.MessageBox.Show("OK, you can paste words in MS Word.");
 }