70 lines
1.9 KiB
C#
70 lines
1.9 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms.Integration;
|
|
using JD.Timeline.Document;
|
|
using TeaBox.ObjectModel;
|
|
|
|
namespace JD.Timeline.View.Pads
|
|
{
|
|
public class MovesPad : AbstractPadContent, IDataSourceProvider
|
|
{
|
|
#region Variables
|
|
|
|
private readonly MoveModelControl _moveModelControl = new MoveModelControl();
|
|
private readonly ElementHost _host = new ElementHost();
|
|
private DataSourceContainer _dataSourceContainer;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
public MovesPad()
|
|
{
|
|
_host.Child = _moveModelControl;
|
|
TeaBox.ObjectModel.Application.Main.Views.SelectedItemChanged += Views_SelectedItemChanged;
|
|
Views_SelectedItemChanged(null, null);
|
|
_dataSourceContainer = new DataSourceContainer("MoveModelsSource");
|
|
_moveModelControl.DataSourceContainer = _dataSourceContainer;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
public override Control Control
|
|
{
|
|
get { return _host; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Object to allow selection of item in PropertyBrowser
|
|
/// </summary>
|
|
public DataSourceContainer DataSourceContainer
|
|
{
|
|
get { return _dataSourceContainer; }
|
|
private set { _dataSourceContainer = value; }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
private void Views_SelectedItemChanged(object sender, EventArgs e)
|
|
{
|
|
var view = TeaBox.ObjectModel.Application.Main.Views.SelectedItem as TapeDocumentView;
|
|
if (view != null)
|
|
{
|
|
_moveModelControl.ClipViewControl = view.ClipView;
|
|
}
|
|
else
|
|
{
|
|
_moveModelControl.ClipViewControl = null;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|