|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.CodeDom.Compiler;
using System.IO;
namespace SPTestApp
{
/// <summary>
/// Summary description for CodeDOMView.
/// </summary>
public class CodeDOMView : System.Windows.Forms.Form
{
private System.Windows.Forms.RichTextBox richTextBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public CodeDOMView(System.CodeDom.CodeNamespace codenamespace, CodeDomProvider cp)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
StringWriter writer = new StringWriter();
cp.CreateGenerator().GenerateCodeFromNamespace(
codenamespace, writer, new CodeGeneratorOptions());
richTextBox1.Text = writer.GetStringBuilder().ToString();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(792, 453);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
//
// CodeDOMView
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(792, 453);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.richTextBox1});
this.Name = "CodeDOMView";
this.Text = "CodeDOMView";
this.ResumeLayout(false);
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.