2007-12-07 23:54:14 +00:00

87 lines
2.3 KiB
C#

using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Drawing;
using VEPROMS.CSLA.Library;
namespace Volian.Controls.Library
{
public partial class DisplayTabItem : DevComponents.DotNetBar.DockContainerItem
{
private DisplayTabControl _MyTabControl;
private ItemInfo _MyItem;
private DisplayTabPanel _MyTabPanel;
public DisplayTabPanel MyTabPanel
{
get { return _MyTabPanel; }
set { _MyTabPanel = value; }
}
private DSOTabPanel _MyDSOTabPanel;
public ItemInfo ItemSelected
{
get { return _MyTabPanel.ItemSelected; }
set { _MyTabPanel.ItemSelected = value; }
}
public DisplayTabItem(IContainer container, DisplayTabControl myTabControl, ItemInfo myItem)
{
_MyTabControl = myTabControl;
_MyItem = myItem;
container.Add(this);
InitializeComponent();
if (myItem.MyContent.MyEntry == null)
SetupDisplayPanel();
else
SetupDSOPanel();
}
private void SetupDisplayPanel()
{
((System.ComponentModel.ISupportInitialize)(_MyTabControl.MyBar)).BeginInit();
_MyTabControl.MyBar.SuspendLayout();
_MyTabPanel = new DisplayTabPanel(_MyTabControl);
//
// tabItem
//
Control = _MyTabPanel;
Name = "tabItem Item " + _MyItem.ItemID;
Text = _MyItem.TabTitle;
Tooltip = _MyItem.TabToolTip;
//
_MyTabControl.Controls.Add(_MyTabPanel);
_MyTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this});
// TODO: Cleanup _MyTabControl.Tabs.Add(this);
//
// tabPanel
//
_MyTabPanel.TabItem = this;
((System.ComponentModel.ISupportInitialize)(_MyTabControl.MyBar)).EndInit();
_MyTabControl.MyBar.ResumeLayout(false);
//_MyTabPanel.MyItem = _MyItem;
}
private void SetupDSOPanel()
{
EntryInfo myEntry = _MyItem.MyContent.MyEntry;
_MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument);
//
// tabItem
//
Control = _MyDSOTabPanel;
Name = "tabItem Item " + _MyItem.ItemID;
Text = _MyItem.TabTitle;
Tooltip = _MyItem.TabToolTip;
//
_MyTabControl.Controls.Add(_MyDSOTabPanel);
_MyTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this});
//
// tabPanel
//
_MyTabControl.SelectedTab = this;
_MyDSOTabPanel.TabItem = this;
//_MyTabControl.SetToolTip(this, "Header", "Footer", "Body");
}
}
}