Update of /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15866
Modified Files:
PropertyPage.cs PropertyPageBase.cs PropertyPageSettings.cs
PropertySheet.cs
Log Message:
Changed some functions so that they start with a Capital letter (On* functions)
Method parameter names should use a camel case for their names
Changed a lot of protected variables that where storage for properties to private
Added i18n support
changed throw Exceptions to throw SnapinExceptions
moved 'ShowModalPropertyPages' to PropertyPageSettings.cs
Index: PropertyPageBase.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertyPageBase.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PropertyPageBase.cs 5 Dec 2004 03:22:13 -0000 1.7
--- PropertyPageBase.cs 19 Jan 2005 23:51:38 -0000 1.8
***************
*** 29,35 ****
//
#region
! protected PropertyPage m_propertypage;
! protected PropertyPageAction m_action;
#endregion
--- 29,35 ----
//
#region
! private PropertyPage _propertypage;
! private PropertyPageAction _action;
#endregion
***************
*** 40,57 ****
#region
/// <summary>
! /// Get the property-page class
/// </summary>
public virtual PropertyPage PropertyPage
{
! get { return this.m_propertypage; }
set
{
! System.Diagnostics.Debug.Assert(this.m_propertypage == null);
System.Diagnostics.Debug.WriteLine(value);
! this.m_propertypage = value;
// Register the eventhandlers too!
! this.m_propertypage.apply += new EventHandler(onApplyEvent);
! this.m_propertypage.validate += new EventHandler(onValidateEvent);
! this.m_propertypage.cancel += new EventHandler(onCancelEvent);
this.Init();
}
--- 40,57 ----
#region
/// <summary>
! /// Get or set the property-page class
/// </summary>
public virtual PropertyPage PropertyPage
{
! get { return this._propertypage; }
set
{
! System.Diagnostics.Debug.Assert(this._propertypage == null);
System.Diagnostics.Debug.WriteLine(value);
! this._propertypage = value;
// Register the eventhandlers too!
! this._propertypage.apply += new EventHandler(onApplyEvent);
! this._propertypage.validate += new EventHandler(onValidateEvent);
! this._propertypage.cancel += new EventHandler(onCancelEvent);
this.Init();
}
***************
*** 66,70 ****
{
// doesn't this fail ?
! return this.m_propertypage.Node;
}
}
--- 66,70 ----
{
// doesn't this fail ?
! return this.PropertyPage.Node;
}
}
***************
*** 104,109 ****
public PropertyPageAction Action
{
! get{ return m_action;}
! set {m_action = value;}
}
#endregion
--- 104,109 ----
public PropertyPageAction Action
{
! get{ return _action;}
! set {_action = value;}
}
#endregion
***************
*** 145,154 ****
protected void ActivateApplyBtn(object sender, System.EventArgs e)
{
! this.m_propertypage.PropertySheet.ActivateApplyButton();
}
protected void DeactivateApplyBtn(object sender, System.EventArgs e)
{
! this.m_propertypage.PropertySheet.DeactivateApplyButton();
}
--- 145,154 ----
protected void ActivateApplyBtn(object sender, System.EventArgs e)
{
! this._propertypage.PropertySheet.ActivateApplyButton();
}
protected void DeactivateApplyBtn(object sender, System.EventArgs e)
{
! this._propertypage.PropertySheet.DeactivateApplyButton();
}
***************
*** 158,162 ****
// The apply button is only active if there is something to apply,
// if it isn't active the OK action should only cancel, not apply+cancel
! if((this.m_propertypage.PropertySheet).IsApplyEnabled())
{
this.onApply();
--- 158,162 ----
// The apply button is only active if there is something to apply,
// if it isn't active the OK action should only cancel, not apply+cancel
! if((this._propertypage.PropertySheet).IsApplyEnabled())
{
this.onApply();
Index: PropertyPageSettings.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertyPageSettings.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PropertyPageSettings.cs 5 Dec 2004 03:22:13 -0000 1.1
--- PropertyPageSettings.cs 19 Jan 2005 23:51:38 -0000 1.2
***************
*** 26,29 ****
--- 26,30 ----
#region private helpers
bool _useCancelDialogs = true;
+ bool _showModelPropertySheets = false;
#endregion
***************
*** 37,40 ****
--- 38,47 ----
}
+ public bool ShowModalPropertySheets
+ {
+ get{return _showModelPropertySheets;}
+ set{_showModelPropertySheets = value;}
+ }
+
#endregion
}
Index: PropertySheet.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertySheet.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PropertySheet.cs 5 Dec 2004 03:22:13 -0000 1.12
--- PropertySheet.cs 19 Jan 2005 23:51:38 -0000 1.13
***************
*** 23,77 ****
public class PropertySheet : Form
{
//Added by Alexander Ovchinnikov for close PS after remove node
! public OnUserDelegate m_CloseHandle = null;
///////////////////////////////////////////////////////////////////////
//
! // Member variables
//
#region
- // Lesley v. Zijl: made protected for subclasses.
- /// <summary>
- /// The OK button
- /// </summary>
- protected Button m_btnOk;
-
- // Lesley v. Zijl: made protected for subclasses.
- /// <summary>
- /// The Cancel button
- /// </summary>
- protected Button m_btnCancel;
-
- // Lesley v. Zijl: made protected for subclasses.
- /// <summary>
- /// Apply button
- /// </summary>
- protected Button m_btnApply;
-
- /// <summary>
- /// The tab control
- /// </summary>
- PropertySheetTabControl m_tc;
-
- /// <summary>
- /// Typed collection of PropertyPages to display
- /// </summary>
- PropertyPageList m_allPages = new PropertyPageList();
! /// <summary>
! /// closed flag used to hide and not dispose of the form
! /// </summary>
! bool m_fClosed;
- /// <summary>
- /// The node that we represent properties for
- /// </summary>
- BaseNode m_ParentNode;
- /// <summary>
- ///
- /// </summary>
- protected ResultViewItem m_resultviewitem;
- #endregion
///////////////////////////////////////////////////////////////////////
--- 23,50 ----
public class PropertySheet : Form
{
+ private OnUserDelegate _closeHandle = null;
//Added by Alexander Ovchinnikov for close PS after remove node
!
! /// <summary>
! ///
! /// </summary>
! protected ResultViewItem m_resultviewitem;
///////////////////////////////////////////////////////////////////////
//
! // Private vars
//
#region
! private Button _btnOk;
! private Button _btnCancel;
! private Button _btnApply;
! private PropertySheetTabControl _tc;
! private PropertyPageList _allPages = new PropertyPageList();
! private bool _fClosed;
! private BaseNode _parentNode;
! #endregion
///////////////////////////////////////////////////////////////////////
***************
*** 89,125 ****
/// <summary>
! /// The Typed pages collection we display
/// </summary>
public PropertyPageList Pages
{
! get{ return m_allPages; }
}
/// <summary>
! /// The Tab control
/// </summary>
public PropertySheetTabControl Tabs
{
! get{ return m_tc; }
}
/// <summary>
! /// the node this propertysheet represents
/// </summary>
public BaseNode Node
{
! get { return m_ParentNode; }
}
/// <summary>
! /// Is the fake closed flag enabled on? i.e. is the form hidden?
/// </summary>
public bool isClosed
{
! get { return m_fClosed; }
}
/// <summary>
- /// Added by Lesley van Zijl
/// Ask for the state of the ApplyButton
/// </summary>
--- 62,98 ----
/// <summary>
! /// Get the Typed pages collection we display
/// </summary>
public PropertyPageList Pages
{
! get{ return _allPages; }
}
/// <summary>
! /// get the Tab control
/// </summary>
public PropertySheetTabControl Tabs
{
! get{ return _tc; }
}
/// <summary>
! /// get the node this propertysheet represents
/// </summary>
public BaseNode Node
{
! get { return _parentNode; }
}
/// <summary>
! /// returns if the fake closed flag is enabled i.e. is the form hidden?
/// </summary>
public bool isClosed
{
! get { return _fClosed; }
}
+ // Added by Lesley van Zijl
/// <summary>
/// Ask for the state of the ApplyButton
/// </summary>
***************
*** 127,131 ****
public bool IsApplyEnabled()
{
! return m_btnApply.Enabled;
}
#endregion
--- 100,112 ----
public bool IsApplyEnabled()
{
! return _btnApply.Enabled;
! }
!
! /// <summary>
! /// Returns the closehandle
! /// </summary>
! public OnUserDelegate CloseHandle
! {
! get { return _closeHandle; }
}
#endregion
***************
*** 137,141 ****
public PropertySheet(BaseNode node)
{
! m_ParentNode = node;
// Make sure nobody can resize this form
--- 118,122 ----
public PropertySheet(BaseNode node)
{
! _parentNode = node;
// Make sure nobody can resize this form
***************
*** 147,151 ****
MinimizeBox = false;
! m_fClosed = false;
//Added by Alexander Kachalkov
--- 128,132 ----
MinimizeBox = false;
! _fClosed = false;
//Added by Alexander Kachalkov
***************
*** 155,161 ****
//Added by Alexander Ovchinnikov for close PS after remove node
//initialise closeDelegate
! if( m_CloseHandle == null )
{
! m_CloseHandle += new OnUserDelegate( ClosePropertySheet );
}
}
--- 136,142 ----
//Added by Alexander Ovchinnikov for close PS after remove node
//initialise closeDelegate
! if( _closeHandle == null )
{
! _closeHandle += new OnUserDelegate( ClosePropertySheet );
}
}
***************
*** 166,169 ****
--- 147,151 ----
public new DialogResult ShowDialog()
{
+
Controls.Clear();
***************
*** 175,179 ****
// We'll be as wide as the widest and tall as the tallest page
! foreach (PropertyPage page in m_allPages)
{
// Initialize the Property Pages
--- 157,161 ----
// We'll be as wide as the widest and tall as the tallest page
! foreach (PropertyPage page in _allPages)
{
// Initialize the Property Pages
***************
*** 186,204 ****
// Tab Control should be on the top...
! m_tc = new PropertySheetTabControl();
// Add the pages to the sheet
! foreach (PropertyPage page in m_allPages)
{
// Create a Tab page that we can use
! m_tc.TabPages.Add(page.CreateTabPage());
}
// Add the height of the tab thingy and the indentation
! m_tc.Location = new Point(4, 5);
! m_tc.SelectedIndexChanging += new CheckValidation(onTabPageChanged);
! m_tc.TabIndex = 0;
! Controls.Add(m_tc);
// Adjust the height of of the tab control to account for the
--- 168,186 ----
// Tab Control should be on the top...
! _tc = new PropertySheetTabControl();
// Add the pages to the sheet
! foreach (PropertyPage page in _allPages)
{
// Create a Tab page that we can use
! _tc.TabPages.Add(page.CreateTabPage());
}
// Add the height of the tab thingy and the indentation
! _tc.Location = new Point(4, 5);
! _tc.SelectedIndexChanging += new CheckValidation(OnTabPageChanged);
! _tc.TabIndex = 0;
! Controls.Add(_tc);
// Adjust the height of of the tab control to account for the
***************
*** 207,218 ****
// We need to do this so the Tab Control gets created on the Win32 side of
// things, which makes m_tc.ItemSize.Height valid.
! IntPtr handle = m_tc.Handle;
! nHeight += m_tc.Location.Y + m_tc.ItemSize.Height;
// calculate the tabcontrol height
! m_tc.Size = new System.Drawing.Size(nWidth, nHeight);
nHeight = CalcTabHeight(nHeight);
! m_tc.Size = new System.Drawing.Size(nWidth, nHeight);
// We'll have a 15 pixel buffer between the tab control and the buttons
--- 189,200 ----
// We need to do this so the Tab Control gets created on the Win32 side of
// things, which makes m_tc.ItemSize.Height valid.
! IntPtr handle = _tc.Handle;
! nHeight += _tc.Location.Y + _tc.ItemSize.Height;
// calculate the tabcontrol height
! _tc.Size = new System.Drawing.Size(nWidth, nHeight);
nHeight = CalcTabHeight(nHeight);
! _tc.Size = new System.Drawing.Size(nWidth, nHeight);
// We'll have a 15 pixel buffer between the tab control and the buttons
***************
*** 220,265 ****
// Now put the Ok, Cancel, and Apply buttons on the page.
! m_btnApply = new Button();
! m_btnApply.Size = new System.Drawing.Size(75, 23);
! m_btnApply.Location = new Point(nWidth-m_btnApply.Width+4, nHeight);
! m_btnApply.Text = "Apply";
! m_btnApply.Enabled = false;
! m_btnApply.TabIndex = 3;
! m_btnApply.Click += new EventHandler(onApplyClick);
//Added by Alexander Kachalkov
! m_btnApply.FlatStyle = FlatStyle.System;
! Controls.Add(m_btnApply);
! m_btnCancel = new Button();
! m_btnCancel.Size = new System.Drawing.Size(75, 23);
! m_btnCancel.Location = new Point(m_btnApply.Location.X - m_btnCancel.Width-5, nHeight);
! m_btnCancel.Text = "Cancel";
! m_btnCancel.Click += new EventHandler(onCancelClick);
! m_btnCancel.TabIndex = 2;
//Added by Alexander Kachalkov
! m_btnCancel.FlatStyle = FlatStyle.System;
! Controls.Add(m_btnCancel);
! m_btnOk = new Button();
! m_btnOk.Size = new System.Drawing.Size(75, 23);
! m_btnOk.Location = new Point(m_btnCancel.Location.X - m_btnOk.Width - 5, nHeight);
! m_btnOk.Text = "OK";
! m_btnOk.TabIndex = 1;
! m_btnOk.Click += new EventHandler(onOkClick);
//Added by Alexander Kachalkov
! m_btnOk.FlatStyle = FlatStyle.System;
! Controls.Add(m_btnOk);
// Make sure we account for the height of the button
! nHeight +=m_btnOk.Height;
// We have a 4 pixel margin on each side of the tab control, and a 5 pixel margin
// between the buttons and the bottom of the page
ClientSize = new System.Drawing.Size(nWidth + 8, nHeight + 5);
! this.AcceptButton = m_btnOk;
! this.CancelButton = m_btnCancel;
//Added by Alexander Kachalkov
! base.Closing += new CancelEventHandler(onCloseClick);
// And finally, make us actually show
--- 202,247 ----
// Now put the Ok, Cancel, and Apply buttons on the page.
! _btnApply = new Button();
! _btnApply.Size = new System.Drawing.Size(75, 23);
! _btnApply.Location = new Point(nWidth-_btnApply.Width+4, nHeight);
! _btnApply.Text = SnapinBase.Translate("Apply");
! _btnApply.Enabled = false;
! _btnApply.TabIndex = 3;
! _btnApply.Click += new EventHandler(OnApplyClick);
//Added by Alexander Kachalkov
! _btnApply.FlatStyle = FlatStyle.System;
! Controls.Add(_btnApply);
! _btnCancel = new Button();
! _btnCancel.Size = new System.Drawing.Size(75, 23);
! _btnCancel.Location = new Point(_btnApply.Location.X - _btnCancel.Width-5, nHeight);
! _btnCancel.Text = SnapinBase.Translate("Cancel");
! _btnCancel.Click += new EventHandler(OnCancelClick);
! _btnCancel.TabIndex = 2;
//Added by Alexander Kachalkov
! _btnCancel.FlatStyle = FlatStyle.System;
! Controls.Add(_btnCancel);
! _btnOk = new Button();
! _btnOk.Size = new System.Drawing.Size(75, 23);
! _btnOk.Location = new Point(_btnCancel.Location.X - _btnOk.Width - 5, nHeight);
! _btnOk.Text = SnapinBase.Translate("Ok");
! _btnOk.TabIndex = 1;
! _btnOk.Click += new EventHandler(OnOkClick);
//Added by Alexander Kachalkov
! _btnOk.FlatStyle = FlatStyle.System;
! Controls.Add(_btnOk);
// Make sure we account for the height of the button
! nHeight += _btnOk.Height;
// We have a 4 pixel margin on each side of the tab control, and a 5 pixel margin
// between the buttons and the bottom of the page
ClientSize = new System.Drawing.Size(nWidth + 8, nHeight + 5);
! this.AcceptButton = _btnOk;
! this.CancelButton = _btnCancel;
//Added by Alexander Kachalkov
! base.Closing += new CancelEventHandler(OnCloseClick);
// And finally, make us actually show
***************
*** 275,284 ****
private int CalcTabHeight(int origHeight)
{
! int before = m_tc.TabPages[0].Size.Height;
! m_tc.Multiline = true;
! m_tc.SizeMode = TabSizeMode.FillToRight;
! return origHeight += (before - m_tc.TabPages[0].Size.Height);
}
///////////////////////////////////////////////////////////////////////
--- 257,266 ----
private int CalcTabHeight(int origHeight)
{
! int before = _tc.TabPages[0].Size.Height;
! _tc.Multiline = true;
! _tc.SizeMode = TabSizeMode.FillToRight;
! return origHeight += (before - _tc.TabPages[0].Size.Height);
}
///////////////////////////////////////////////////////////////////////
***************
*** 294,305 ****
/// </summary>
/// <returns></returns>
! bool onTabPageChanged()
{
bool isValidData;
! PropertyPage page = m_allPages[m_tc.SelectedIndex];
isValidData = page.ValidateData();
if (isValidData)
{
! foreach(PropertyPage pages in m_allPages)
pages.TabChange();
}
--- 276,287 ----
/// </summary>
/// <returns></returns>
! bool OnTabPageChanged()
{
bool isValidData;
! PropertyPage page = _allPages[_tc.SelectedIndex];
isValidData = page.ValidateData();
if (isValidData)
{
! foreach(PropertyPage pages in _allPages)
pages.TabChange();
}
***************
*** 310,314 ****
//Added by Alexander Kachalkov
//to be able to show form again after closing it
! void onCloseClick(Object o, CancelEventArgs e)
{
Node.EditMode = false;
--- 292,296 ----
//Added by Alexander Kachalkov
//to be able to show form again after closing it
! void OnCloseClick(Object o, CancelEventArgs e)
{
Node.EditMode = false;
***************
*** 324,330 ****
/// <param name="o"></param>
/// <param name="e"></param>
! void onOkClick(Object o, EventArgs e)
{
! PropertyPage page = m_allPages[m_tc.SelectedIndex];
if (page.ValidateData())
--- 306,312 ----
/// <param name="o"></param>
/// <param name="e"></param>
! void OnOkClick(Object o, EventArgs e)
{
! PropertyPage page = _allPages[_tc.SelectedIndex];
if (page.ValidateData())
***************
*** 333,337 ****
base.DialogResult = DialogResult.OK;
! onApplyClick(o, e);
FakeClose();
}
--- 315,319 ----
base.DialogResult = DialogResult.OK;
! OnApplyClick(o, e);
FakeClose();
}
***************
*** 343,356 ****
/// <param name="o"></param>
/// <param name="e"></param>
! void onCancelClick(Object o, EventArgs e)
{
if(IsApplyEnabled() == true && PropertyPageSettings.Instance.UseCancelDialogs == true)
{
! switch(MessageBox.Show("Some property data may have changed. Do you want to save your changes?",
! "Save Changes?",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning))
{
case DialogResult.Yes:
! onApplyClick(o, e);
break;
--- 325,338 ----
/// <param name="o"></param>
/// <param name="e"></param>
! void OnCancelClick(Object o, EventArgs e)
{
if(IsApplyEnabled() == true && PropertyPageSettings.Instance.UseCancelDialogs == true)
{
! switch(MessageBox.Show(SnapinBase.Translate("OnCancelWarningText"),
! SnapinBase.Translate("OnCancelWarningTitle"),
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning))
{
case DialogResult.Yes:
! OnApplyClick(o, e);
break;
***************
*** 363,367 ****
base.DialogResult = DialogResult.Cancel;
! foreach(PropertyPage page in m_allPages)
page.onCancel();
FakeClose();
--- 345,349 ----
base.DialogResult = DialogResult.Cancel;
! foreach(PropertyPage page in _allPages)
page.onCancel();
FakeClose();
***************
*** 373,377 ****
base.DialogResult = DialogResult.Cancel;
! foreach(PropertyPage page in m_allPages)
page.onCancel();
FakeClose();
--- 355,359 ----
base.DialogResult = DialogResult.Cancel;
! foreach(PropertyPage page in _allPages)
page.onCancel();
FakeClose();
***************
*** 386,397 ****
/// <param name="o"></param>
/// <param name="e"></param>
! void onApplyClick(Object o, EventArgs e)
{
! PropertyPage psp = m_allPages[m_tc.SelectedIndex];
if (psp.ValidateData())
{
SendApplyToAll();
! m_btnApply.Enabled = false;
}
}
--- 368,379 ----
/// <param name="o"></param>
/// <param name="e"></param>
! void OnApplyClick(Object o, EventArgs e)
{
! PropertyPage psp = _allPages[_tc.SelectedIndex];
if (psp.ValidateData())
{
SendApplyToAll();
! _btnApply.Enabled = false;
}
}
***************
*** 403,408 ****
public void ActivateApplyButton()
{
! if (m_btnApply != null)
! m_btnApply.Enabled = true;
}
--- 385,390 ----
public void ActivateApplyButton()
{
! if (_btnApply != null)
! _btnApply.Enabled = true;
}
***************
*** 412,417 ****
public void DeactivateApplyButton()
{
! if(m_btnApply != null)
! m_btnApply.Enabled = false;
}
--- 394,399 ----
public void DeactivateApplyButton()
{
! if(_btnApply != null)
! _btnApply.Enabled = false;
}
***************
*** 421,425 ****
private void SendApplyToAll()
{
! foreach(PropertyPage page in m_allPages)
{
page.Applied = true;
--- 403,407 ----
private void SendApplyToAll()
{
! foreach(PropertyPage page in _allPages)
{
page.Applied = true;
***************
*** 436,440 ****
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
! this.Name = "PropertySheet";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
//this.TopMost = true;
--- 418,422 ----
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
! this.Name = SnapinBase.Translate("Properties");
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
//this.TopMost = true;
***************
*** 450,454 ****
private void FakeClose()
{
! m_fClosed = true;
Close();
}
--- 432,436 ----
private void FakeClose()
{
! _fClosed = true;
Close();
}
***************
*** 459,463 ****
base.DialogResult = DialogResult.Cancel;
! foreach(PropertyPage page in m_allPages)
page.onCancel();
FakeClose();
--- 441,445 ----
base.DialogResult = DialogResult.Cancel;
! foreach(PropertyPage page in _allPages)
page.onCancel();
FakeClose();
***************
*** 558,563 ****
// Added by Alex Ovchinnikov for Dispose method in Propertysheet
! public override void Clear( ){
! for( int iIndex = 0; iIndex < base.Count; iIndex++ ){
base[ iIndex ] = null;
}
--- 540,547 ----
// Added by Alex Ovchinnikov for Dispose method in Propertysheet
! public override void Clear( )
! {
! for( int iIndex = 0; iIndex < base.Count; iIndex++ )
! {
base[ iIndex ] = null;
}
Index: PropertyPage.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertyPage.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** PropertyPage.cs 5 Dec 2004 03:22:13 -0000 1.6
--- PropertyPage.cs 19 Jan 2005 23:51:38 -0000 1.7
***************
*** 18,55 ****
//
#region
- /// <summary>
- /// The property sheet we belong to
- /// </summary>
- protected PropertySheet m_PropSheet;
! /// <summary>
! /// The title of our page - string on the tab
! /// </summary>
! protected String m_sTitle;
!
! /// <summary>
! /// the type of control to activate int he page client area
! /// </summary>
! protected Type m_ControlType;
!
! /// <summary>
! /// the instance of the control once activated
! /// </summary>
! protected UserControl m_Control = null;
!
! /// <summary>
! /// A reference too the note before the sheet is initialised
! /// </summary>
! protected BaseNode m_node;
!
! /// <summary>
! /// Multiselection
! /// </summary>
! protected ArrayList m_items = new ArrayList();
- /// <summary>
- /// Indicates if the Apply button is pressed
- /// </summary>
- protected bool m_applied = false;
#endregion
--- 18,30 ----
//
#region
! private PropertySheet _propSheet;
! private String _sTitle;
! private Type _controlType;
! private UserControl _control = null;
! private BaseNode _node;
! private ArrayList _items = new ArrayList();
! private bool _applied = false;
#endregion
***************
*** 87,132 ****
#region
/// <summary>
! /// Set the type of User Control to serve as the property page guts
/// </summary>
public Type ControlType
{
! get { return m_ControlType; }
! set { m_ControlType = value; }
}
/// <summary>
! /// Sets the PropertySheet we're the property page of
/// </summary>
public PropertySheet PropertySheet
{
! set { m_PropSheet = value; }
! get { return m_PropSheet; }
}
/// <summary>
! /// A reference to the node before init of the sheet
/// </summary>
public BaseNode Node
{
! get{ return m_node;}
}
/// <summary>
! /// Setter for items. The set property makes a copy of the items passed in. If
/// null is passed as a value, a zero-length array is allocated instead.
/// </summary>
public ArrayList Items
{
! get { return this.m_items; }
set
{
if(value == null)
! this.m_items = new ArrayList();
else
! this.m_items = value;
}
}
public UserControl MainControl
{
--- 62,110 ----
#region
/// <summary>
! /// Set or get the type of User Control to serve as the property page guts
/// </summary>
public Type ControlType
{
! get { return _controlType; }
! set { _controlType = value; }
}
/// <summary>
! /// Set or get the PropertySheet we're the property page of
/// </summary>
public PropertySheet PropertySheet
{
! set { _propSheet = value; }
! get { return _propSheet; }
}
/// <summary>
! /// returns a reference to the node before init of the sheet
/// </summary>
public BaseNode Node
{
! get{ return _node;}
}
/// <summary>
! /// Setter or getter for items. The set property makes a copy of the items passed in. If
/// null is passed as a value, a zero-length array is allocated instead.
/// </summary>
public ArrayList Items
{
! get { return this._items; }
set
{
if(value == null)
! this._items = new ArrayList();
else
! this._items = value;
}
}
+ /// <summary>
+ /// Returns the usercontrol that is hosted on this propertypage
+ /// </summary>
public UserControl MainControl
{
***************
*** 135,145 ****
try
{
! if (m_Control == null)
{
! m_Control = (UserControl)Activator.CreateInstance(ControlType);
// check if the usercontrol implements IPropertyPageContext
// if so provide a back reference to ourselves.
! IPropertyPageContext ctx = m_Control as IPropertyPageContext;
if(ctx != null)
ctx.PropertyPage = this;
--- 113,123 ----
try
{
! if (_control == null)
{
! _control = (UserControl)Activator.CreateInstance(ControlType);
// check if the usercontrol implements IPropertyPageContext
// if so provide a back reference to ourselves.
! IPropertyPageContext ctx = _control as IPropertyPageContext;
if(ctx != null)
ctx.PropertyPage = this;
***************
*** 151,170 ****
throw new SnapinException ("Failed to create user control", e);
}
! return m_Control;
}
}
/// <summary>
! /// The string displayed in the tab
/// </summary>
public String Title
{
! get { return m_sTitle; }
! set { m_sTitle = value; }
}
/// <summary>
! /// size of the property sheet page
/// </summary>
public Size Size
--- 129,148 ----
throw new SnapinException ("Failed to create user control", e);
}
! return _control;
}
}
/// <summary>
! /// get or set the string displayed in the tab
/// </summary>
public String Title
{
! get { return _sTitle; }
! set { _sTitle = value; }
}
/// <summary>
! /// get or set the size of the property sheet page
/// </summary>
public Size Size
***************
*** 174,181 ****
}
public bool Applied
{
! get { return m_applied;}
! set { m_applied = value;}
}
--- 152,162 ----
}
+ /// <summary>
+ /// get or set if this propertypage's apply button is clicked
+ /// </summary>
public bool Applied
{
! get { return _applied;}
! set { _applied = value;}
}
***************
*** 198,207 ****
public PropertyPage(string title)
{
! m_sTitle = title;
}
public PropertyPage(string title, BaseNode node) : this(title)
{
! m_node = node;
}
--- 179,188 ----
public PropertyPage(string title)
{
! _sTitle = title;
}
public PropertyPage(string title, BaseNode node) : this(title)
{
! _node = node;
}
***************
*** 227,231 ****
/// <summary>
! /// Generate the actual TabPage that will used in the PropertySheet.
/// We don't keep re-using the same TabPage each time
/// the property page is created because it makes the
--- 208,212 ----
/// <summary>
! /// Generate the actual TabPage that will used in the PropertySheet.
/// We don't keep re-using the same TabPage each time
/// the property page is created because it makes the
***************
*** 310,314 ****
protected void ActivateApply()
{
! m_PropSheet.ActivateApplyButton();
}
--- 291,295 ----
protected void ActivateApply()
{
! _propSheet.ActivateApplyButton();
}
***************
*** 318,322 ****
protected void DeactivateApply()
{
! m_PropSheet.DeactivateApplyButton();
}
--- 299,303 ----
protected void DeactivateApply()
{
! _propSheet.DeactivateApplyButton();
}
|