Update of /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26151
Modified Files:
PropertyPage.cs PropertyPageBase.cs PropertySheet.cs
Added Files:
PropertyPageSettings.cs
Log Message:
PropertyPage.cs
- added DeactivateApply() to deactivate the apply button manualy
- fixed a typo
PropertyPageBase.cs
- added DeactivateApplyBtn event handler
PropertySheet.cs
- added DeactivateApplyButton function to deactivate the apply button manualy
- Added UseCancelDialogs on/off behaviour
PropertyPageSettings.cs
- Added this Threadsafe Singleton class to hold global propertypage settings
Index: PropertyPageBase.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertyPageBase.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** PropertyPageBase.cs 15 Nov 2004 19:43:49 -0000 1.6
--- PropertyPageBase.cs 5 Dec 2004 03:22:13 -0000 1.7
***************
*** 148,151 ****
--- 148,156 ----
}
+ protected void DeactivateApplyBtn(object sender, System.EventArgs e)
+ {
+ this.m_propertypage.PropertySheet.DeactivateApplyButton();
+ }
+
#region Event handling
private void onApplyEvent(object sender, System.EventArgs e) {
--- NEW FILE: PropertyPageSettings.cs ---
using System;
namespace Ironring.MMC.PropertyPages
{
/// <summary>
/// Singleton class for propertypage settings
/// can only think of 1 setting right now, but this is easier for the future
/// </summary>
public sealed class PropertyPageSettings
{
#region threadsafe singleton design pattern implementation
readonly static PropertyPageSettings _instance = new PropertyPageSettings();
// hack not to mark type as beforefieldinit
static PropertyPageSettings() {}
// default ctor
PropertyPageSettings() {}
public static PropertyPageSettings Instance
{
get { return _instance; }
}
#endregion
#region private helpers
bool _useCancelDialogs = true;
#endregion
#region Properties
public bool UseCancelDialogs
{
get{return _useCancelDialogs;}
set{_useCancelDialogs = value;}
}
#endregion
}
}
Index: PropertySheet.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertySheet.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PropertySheet.cs 15 Nov 2004 19:43:49 -0000 1.11
--- PropertySheet.cs 5 Dec 2004 03:22:13 -0000 1.12
***************
*** 345,349 ****
void onCancelClick(Object o, EventArgs e)
{
! if(IsApplyEnabled() == true)
{
switch(MessageBox.Show("Some property data may have changed. Do you want to save your changes?",
--- 345,349 ----
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?",
***************
*** 407,410 ****
--- 407,418 ----
}
+ /// <summary>
+ /// Turn off the apply button
+ /// </summary>
+ public void DeactivateApplyButton()
+ {
+ if(m_btnApply != null)
+ m_btnApply.Enabled = false;
+ }
/// <summary>
Index: PropertyPage.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertyPage.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PropertyPage.cs 15 Nov 2004 19:43:49 -0000 1.5
--- PropertyPage.cs 5 Dec 2004 03:22:13 -0000 1.6
***************
*** 156,160 ****
/// <summary>
! /// The string displayed int he tab
/// </summary>
public String Title
--- 156,160 ----
/// <summary>
! /// The string displayed in the tab
/// </summary>
public String Title
***************
*** 313,316 ****
--- 313,324 ----
}
+ /// <summary>
+ /// Method to call that turns off the apply button
+ /// </summary>
+ protected void DeactivateApply()
+ {
+ m_PropSheet.DeactivateApplyButton();
+ }
+
}
}
|