#region Imported Regions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Scripting.Hosting;
using System.IO;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
#endregion
#region Namespace Declaration
namespace Org.TechA.Wpf.UserControls
{
///
/// The Model for the IronPython console.
///
internal sealed class DlrConsoleModel
{
#region Private Members
private readonly ObservableCollection _scopes;
private readonly TextWriter _writer;
private readonly ScriptEngine _engine;
private readonly List _commandCache;
private int _commandCacheCurrentIndex;
#endregion
#region Constructors
public DlrConsoleModel(TextWriter writer, ScriptEngine engine)
{
_commandCache = new List();
_writer = writer;
_engine = engine;
_scopes = new ObservableCollection();
_scopes.CollectionChanged +=
new NotifyCollectionChangedEventHandler(_scopes_CollectionChanged);
}
#endregion
#region Event Delegates
void _scopes_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
}
}
#endregion
#region Accessor Mutators
///
/// User Defined List of commands that need to be stored in
/// for simplified navigation using the up and down arrows to allow
/// for repeating commands
///
public List CommandCache
{
get { return _commandCache; }
}
///
/// User Defined list of scopes
/// avaialable to the IronPython Runtime.
///
public IList Scopes
{
get { return _scopes; }
}
///
/// The TextWriter used by a stream
/// that captures the STDIO from the
/// IronPython Runtime.
///
public TextWriter Writer
{
get { return _writer; }
}
///
/// The IronPython ScriptEngine for
/// the shell (console).
///
public ScriptEngine Engine
{
get { return _engine; }
}
///
///
///
public int CommandCacheCurrentIndex
{
get { return _commandCacheCurrentIndex; }
set { _commandCacheCurrentIndex = value; }
}
#endregion
}
}
#endregion