Changed SubSection.Edit Section Config property to correctly be defaulted to "No"
Base MyConfig on the type of item (Procedure, Section or Step) Keep the code from crashing iff the user selects a result in the search window that points to non-editable text
This commit is contained in:
1 parent
469a8da0ba
commit
3e413b0f17
3 files changed
+43
-11
No files matched your search
@@ -101,11 +101,11 @@ namespace VEPROMS.CSLA.Library
|
||||
_Xp = new XMLProperties(xml);
|
||||
if (_SectionInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
|
||||
}
|
||||
public SectionConfig(string xml)
|
||||
{
|
||||
if (xml == string.Empty) xml = "<Config/>";
|
||||
_Xp = new XMLProperties(xml);
|
||||
}
|
||||
//public SectionConfig(string xml)
|
||||
//{
|
||||
// if (xml == string.Empty) xml = "<Config/>";
|
||||
// _Xp = new XMLProperties(xml);
|
||||
//}
|
||||
public SectionConfig()
|
||||
{
|
||||
_Xp = new XMLProperties();
|
||||
@@ -761,7 +761,7 @@ namespace VEPROMS.CSLA.Library
|
||||
#region SubSectionCategory // from sequence number in 16-bit database.
|
||||
[Category("SubSection")]
|
||||
//PROPGRID: Hide SubSection Edit
|
||||
[Browsable(false)]
|
||||
[Browsable(true)]
|
||||
[DisplayName("SubSection Edit")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("SubSection Edit")]
|
||||
@@ -779,20 +779,48 @@ namespace VEPROMS.CSLA.Library
|
||||
OnPropertyChanged("SubSection_Edit");
|
||||
}
|
||||
}
|
||||
[Category("SubSection")]
|
||||
//PROPGRID: Hide SubSection Edit
|
||||
[Browsable(true)]
|
||||
[DisplayName("DefaultSubSection Edit")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("DefaultSubSection Edit")]
|
||||
public string DefaultSubSectionEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SectionInfo != null && _SectionInfo.Sections.Count > 0 && _SectionInfo.Steps.Count > 0)
|
||||
//if (_SectionInfo != null && _SectionInfo.Sections != null && _SectionInfo.Sections.Count > 0 && _SectionInfo.Steps != null && _SectionInfo.Steps.Count > 0)
|
||||
if (_SectionInfo != null && _SectionInfo.Sections != null && _SectionInfo.Sections.Count > 0)
|
||||
return "N";
|
||||
if (_Section != null && HasSubsections)
|
||||
return "N";
|
||||
//if (_Section != null && _Section.MyContent.cont .Sections.Count > 0 && _Section.Steps.Count > 0)
|
||||
// return "N";
|
||||
return "Y";
|
||||
}
|
||||
}
|
||||
private bool HasSubsections
|
||||
{
|
||||
get
|
||||
{
|
||||
//int result = 0;
|
||||
foreach (ContentPart cp in _Section.MyContent.ContentParts)
|
||||
{
|
||||
if (cp.FromType == 2)
|
||||
return true;
|
||||
//if (cp.FromType == 2) result += 1;
|
||||
//if (cp.FromType == 6) result += 2;
|
||||
//if (result == 3)
|
||||
//{
|
||||
// return true;
|
||||
//}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[Category("SubSection")]
|
||||
//PROPGRID: Hide Subsection AutoIndent
|
||||
[Browsable(false)]
|
||||
[Browsable(true)]
|
||||
[DisplayName("SubSection AutoIndent")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("SubSection AutoIndent")]
|
||||
|
||||
Reference in new issue
Block a user