Click here to Skip to main content
15,886,724 members
Articles / Programming Languages / C#

Embedding a Console in a C# Application

Rate me:
Please Sign up or sign in to vote.
4.91/5 (151 votes)
21 Mar 2015MIT4 min read 622.4K   27.7K   403  
Embed a functional console window in a C# application
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleControl
{
  /// <summary>
  /// The ConsoleEventArgs are arguments for a console event.
  /// </summary>
  public class ConsoleEventArgs : EventArgs
  {
    /// <summary>
    /// Initializes a new instance of the <see cref="ConsoleEventArgs"/> class.
    /// </summary>
    public ConsoleEventArgs()
    {
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="ConsoleEventArgs"/> class.
    /// </summary>
    /// <param name="content">The content.</param>
    public ConsoleEventArgs(string content)
    {
      //  Set the content.
      Content = content;
    }

    /// <summary>
    /// Gets the content.
    /// </summary>
    public string Content
    {
      get;
      private set;
    }
  }
}

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.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
United Kingdom United Kingdom
Follow my blog at www.dwmkerr.com and find out about my charity at www.childrenshomesnepal.org.

Comments and Discussions