Object and Property name changes for consistency
This commit is contained in:
@@ -10,101 +10,138 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
public partial class DisplayTabItem : DevComponents.DotNetBar.DockContainerItem
|
||||
{
|
||||
private DisplayTabControl _MyTabControl;
|
||||
private ItemInfo _MyItem;
|
||||
|
||||
public ItemInfo MyItem
|
||||
{
|
||||
get { return _MyItem; }
|
||||
set { _MyItem = value; }
|
||||
}
|
||||
private StepTabPanel _MyTabPanel;
|
||||
#region Private Fields
|
||||
private DisplayTabControl _MyDisplayTabControl;
|
||||
private ItemInfo _MyItemInfo;
|
||||
private StepTabPanel _MyStepTabPanel;
|
||||
private string _MyKey;
|
||||
private DSOTabPanel _MyDSOTabPanel;
|
||||
#endregion
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// ItemInfo associated with this DisplayTabItem
|
||||
/// </summary>
|
||||
public ItemInfo MyItemInfo
|
||||
{
|
||||
get { return _MyItemInfo; }
|
||||
//set { _MyItemInfo = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// get Key Either:
|
||||
/// "Item - " + Procedure ItemID for step pages
|
||||
/// "Doc - " + DocumentID for Word Documents
|
||||
/// </summary>
|
||||
public string MyKey
|
||||
{
|
||||
get { return _MyKey; }
|
||||
}
|
||||
public StepTabPanel MyTabPanel
|
||||
/// <summary>
|
||||
/// Related StepTabPanel for a Step page
|
||||
/// </summary>
|
||||
public StepTabPanel MyStepTabPanel
|
||||
{
|
||||
get { return _MyTabPanel; }
|
||||
set { _MyTabPanel = value; }
|
||||
get { return _MyStepTabPanel; }
|
||||
set { _MyStepTabPanel = value; }
|
||||
}
|
||||
private DSOTabPanel _MyDSOTabPanel;
|
||||
/// <summary>
|
||||
/// Related DSOTabPanle for a Word page
|
||||
/// </summary>
|
||||
public DSOTabPanel MyDSOTabPanel
|
||||
{
|
||||
get { return _MyDSOTabPanel; }
|
||||
set { _MyDSOTabPanel = value; }
|
||||
}
|
||||
public ItemInfo ItemSelected
|
||||
/// <summary>
|
||||
/// Current SelectedItemInfo for this page
|
||||
/// </summary>
|
||||
public ItemInfo SelectedItemInfo
|
||||
{
|
||||
get { return _MyTabPanel.ItemSelected; }
|
||||
set { _MyTabPanel.ItemSelected = value; }
|
||||
get { return _MyStepTabPanel.SelectedItemInfo; }
|
||||
set { _MyStepTabPanel.SelectedItemInfo = value; }
|
||||
}
|
||||
public DisplayTabItem(IContainer container, DisplayTabControl myTabControl, ItemInfo myItem, string myKey)
|
||||
#endregion
|
||||
#region Constructors
|
||||
public DisplayTabItem(IContainer container, DisplayTabControl myDisplayTabControl, ItemInfo myItemInfo, string myKey)
|
||||
{
|
||||
_MyKey = myKey;
|
||||
_MyTabControl = myTabControl;
|
||||
_MyItem = myItem;
|
||||
_MyDisplayTabControl = myDisplayTabControl;
|
||||
_MyItemInfo = myItemInfo;
|
||||
container.Add(this);
|
||||
InitializeComponent();
|
||||
this.Click += new EventHandler(DisplayTabItem_Click);
|
||||
if (myItem.MyContent.MyEntry == null)
|
||||
SetupDisplayTabPanel();
|
||||
if (myItemInfo.MyContent.MyEntry == null)
|
||||
SetupStepTabPanel();
|
||||
else
|
||||
SetupDSOPanel();
|
||||
Name = string.Format("DisplayTabItem {0}", myItem.ItemID);
|
||||
SetupDSOTabPanel();
|
||||
Name = string.Format("DisplayTabItem {0}", myItemInfo.ItemID);
|
||||
}
|
||||
void DisplayTabItem_Click(object sender, EventArgs e)
|
||||
#endregion
|
||||
#region Event Handlers
|
||||
/// <summary>
|
||||
/// Updates SelectedStepItem when the user selects a DisplayTabItem
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void DisplayTabItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// See if I can tell the TabControl that the ItemSelected has changed
|
||||
// Tell the TabControl that the ItemSelected has changed
|
||||
DisplayTabItem myTabItem = sender as DisplayTabItem;
|
||||
if(myTabItem == null)return;
|
||||
StepTabPanel myTabPanel = myTabItem.MyTabPanel as StepTabPanel;
|
||||
StepTabPanel myTabPanel = myTabItem.MyStepTabPanel as StepTabPanel;
|
||||
if(myTabPanel == null) return;
|
||||
_MyTabControl.OnItemSelectedChanged(this,new DisplayPanelEventArgs(MyTabPanel.SelectedItem,null));
|
||||
_MyDisplayTabControl.OnItemSelectedChanged(this,new StepPanelEventArgs(MyStepTabPanel.SelectedStepItem,null));
|
||||
}
|
||||
private void SetupDisplayTabPanel()
|
||||
#endregion
|
||||
#region private Methods
|
||||
/// <summary>
|
||||
/// Creates and sets-up a StepTabPanel
|
||||
/// </summary>
|
||||
private void SetupStepTabPanel()
|
||||
{
|
||||
((System.ComponentModel.ISupportInitialize)(_MyTabControl.MyBar)).BeginInit();
|
||||
_MyTabControl.MyBar.SuspendLayout();
|
||||
_MyTabPanel = new StepTabPanel(_MyTabControl);
|
||||
((System.ComponentModel.ISupportInitialize)(_MyDisplayTabControl.MyBar)).BeginInit();
|
||||
_MyDisplayTabControl.MyBar.SuspendLayout();
|
||||
_MyStepTabPanel = new StepTabPanel(_MyDisplayTabControl);
|
||||
//
|
||||
// tabItem
|
||||
//
|
||||
Control = _MyTabPanel;
|
||||
Name = "tabItem Item " + _MyItem.ItemID;
|
||||
Text = _MyItem.TabTitle;
|
||||
Tooltip = _MyItem.TabToolTip;
|
||||
Control = _MyStepTabPanel;
|
||||
Name = "tabItem Item " + _MyItemInfo.ItemID;
|
||||
Text = _MyItemInfo.TabTitle;
|
||||
Tooltip = _MyItemInfo.TabToolTip;
|
||||
//
|
||||
_MyTabControl.Controls.Add(_MyTabPanel);
|
||||
_MyTabControl.MyBar.Items.Add(this);
|
||||
_MyDisplayTabControl.Controls.Add(_MyStepTabPanel);
|
||||
_MyDisplayTabControl.MyBar.Items.Add(this);
|
||||
//
|
||||
// tabPanel
|
||||
//
|
||||
_MyTabPanel.TabItem = this;
|
||||
((System.ComponentModel.ISupportInitialize)(_MyTabControl.MyBar)).EndInit();
|
||||
_MyTabControl.MyBar.ResumeLayout(false);
|
||||
_MyStepTabPanel.MyDisplayTabItem = this;
|
||||
((System.ComponentModel.ISupportInitialize)(_MyDisplayTabControl.MyBar)).EndInit();
|
||||
_MyDisplayTabControl.MyBar.ResumeLayout(false);
|
||||
}
|
||||
private void SetupDSOPanel()
|
||||
/// <summary>
|
||||
/// Creates and sets-up a DSOTabPanel
|
||||
/// </summary>
|
||||
private void SetupDSOTabPanel()
|
||||
{
|
||||
EntryInfo myEntry = _MyItem.MyContent.MyEntry;
|
||||
_MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument, _MyTabControl);
|
||||
EntryInfo myEntry = _MyItemInfo.MyContent.MyEntry;
|
||||
_MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument, _MyDisplayTabControl);
|
||||
//
|
||||
// tabItem
|
||||
//
|
||||
Control = _MyDSOTabPanel;
|
||||
Name = "tabItem Item " + _MyItem.ItemID;
|
||||
Text = _MyItem.TabTitle;
|
||||
Tooltip = _MyItem.TabToolTip;
|
||||
Name = "tabItem Item " + _MyItemInfo.ItemID;
|
||||
Text = _MyItemInfo.TabTitle;
|
||||
Tooltip = _MyItemInfo.TabToolTip;
|
||||
//
|
||||
_MyTabControl.Controls.Add(_MyDSOTabPanel);
|
||||
_MyTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
|
||||
_MyDisplayTabControl.Controls.Add(_MyDSOTabPanel);
|
||||
_MyDisplayTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
|
||||
this});
|
||||
//
|
||||
// tabPanel
|
||||
//
|
||||
_MyTabControl.SelectedTab = this;
|
||||
_MyDSOTabPanel.TabItem = this;
|
||||
_MyDisplayTabControl.SelectedDisplayTabItem = this;
|
||||
_MyDSOTabPanel.MyDisplayTabItem = this;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user