This commit is contained in:
parent
5e59fc2c34
commit
4c49f001ac
@ -47,24 +47,24 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
#region Events
|
#region Events
|
||||||
public event VETreeNodeEvent LoadingChildrenSQL;
|
public event VETreeNodeEvent LoadingChildrenSQL;
|
||||||
public event VETreeNodeEvent LoadingChildernMax;
|
public event VETreeNodeEvent LoadingChildrenMax;
|
||||||
public event VETreeNodeEvent LoadingChildernValue;
|
public event VETreeNodeEvent LoadingChildrenValue;
|
||||||
public event VETreeNodeEvent LoadingChildernDone;
|
public event VETreeNodeEvent LoadingChildrenDone;
|
||||||
private void OnLoadingChildrenSQL(object sender, VETreeNodeEventArgs args)
|
private void OnLoadingChildrenSQL(object sender, VETreeNodeEventArgs args)
|
||||||
{
|
{
|
||||||
if (LoadingChildrenSQL != null) LoadingChildrenSQL(sender, args);
|
if (LoadingChildrenSQL != null) LoadingChildrenSQL(sender, args);
|
||||||
}
|
}
|
||||||
private void OnLoadingChildrenMax(object sender, VETreeNodeEventArgs args)
|
private void OnLoadingChildrenMax(object sender, VETreeNodeEventArgs args)
|
||||||
{
|
{
|
||||||
if (LoadingChildernMax != null) LoadingChildernMax(sender, args);
|
if (LoadingChildrenMax != null) LoadingChildrenMax(sender, args);
|
||||||
}
|
}
|
||||||
private void OnLoadingChildrenValue(object sender, VETreeNodeEventArgs args)
|
private void OnLoadingChildrenValue(object sender, VETreeNodeEventArgs args)
|
||||||
{
|
{
|
||||||
if (LoadingChildernValue != null) LoadingChildernValue(sender, args);
|
if (LoadingChildrenValue != null) LoadingChildrenValue(sender, args);
|
||||||
}
|
}
|
||||||
private void OnLoadingChildrenDone(object sender, VETreeNodeEventArgs args)
|
private void OnLoadingChildrenDone(object sender, VETreeNodeEventArgs args)
|
||||||
{
|
{
|
||||||
if (LoadingChildernDone != null) LoadingChildernDone(sender, args);
|
if (LoadingChildrenDone != null) LoadingChildrenDone(sender, args);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Business Methods
|
#region Business Methods
|
||||||
@ -223,29 +223,51 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private void ExpandChildren(IList ol)
|
private void ExpandChildren(IList ol)
|
||||||
{
|
{
|
||||||
int icnt = 0;
|
int icnt = 0;
|
||||||
|
bool lastWasSection = false;
|
||||||
foreach (IVEDrillDownReadOnly o in ol)
|
foreach (IVEDrillDownReadOnly o in ol)
|
||||||
{
|
{
|
||||||
OnLoadingChildrenValue(this, new VETreeNodeEventArgs(++icnt));
|
OnLoadingChildrenValue(this, new VETreeNodeEventArgs(++icnt));
|
||||||
//tNext("Cycle");
|
//tNext("Cycle");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
VETreeNode tmp = new VETreeNode(o,_allParts);
|
bool skipIt = false;
|
||||||
if (o.HasChildren)
|
bool isStepPart = (o is PartInfo && (o as PartInfo).PartType == E_FromType.Step);
|
||||||
|
if (isStepPart)
|
||||||
{
|
{
|
||||||
if (o is PartInfo)
|
// get parent section and see if it has the Editable flag set. Only skip
|
||||||
|
// if this flag is set to "N".
|
||||||
|
ItemInfo sectInfo = (ItemInfo)(o as PartInfo).ActiveParent;
|
||||||
|
if (sectInfo != null)
|
||||||
{
|
{
|
||||||
tmp.Nodes.Clear();
|
SectionConfig sc = sectInfo.MyConfig as SectionConfig;
|
||||||
tmp.ExpandChildren(o.GetChildren());
|
if (sc != null && sc.SubSection_Edit == "N") skipIt = true;
|
||||||
tmp._ChildrenLoaded = true;
|
|
||||||
}
|
}
|
||||||
// OLD: RHM 20100115 : I don't think that the following lines are necessary since the "new VETreeNode(o)"
|
|
||||||
// above includes a similar function.
|
|
||||||
//else
|
|
||||||
// tmp.Nodes.Add(string.Format("dummy: {0}", o.GetType().Name));// Add a Dummy Node so that the item will appear to be expanable.
|
|
||||||
}
|
}
|
||||||
else
|
if (!skipIt)
|
||||||
tmp._ChildrenLoaded = true;// Reset the children loaded flag
|
{
|
||||||
this.Nodes.Add(tmp);
|
VETreeNode tmp = new VETreeNode(o, _allParts);
|
||||||
|
if (o.HasChildren)
|
||||||
|
{
|
||||||
|
if (o is PartInfo)
|
||||||
|
{
|
||||||
|
tmp.Nodes.Clear();
|
||||||
|
tmp.ExpandChildren(o.GetChildren());
|
||||||
|
tmp._ChildrenLoaded = true;
|
||||||
|
}
|
||||||
|
// OLD: RHM 20100115 : I don't think that the following lines are necessary since the "new VETreeNode(o)"
|
||||||
|
// above includes a similar function.
|
||||||
|
//else
|
||||||
|
// tmp.Nodes.Add(string.Format("dummy: {0}", o.GetType().Name));// Add a Dummy Node so that the item will appear to be expanable.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
tmp._ChildrenLoaded = true;// Reset the children loaded flag
|
||||||
|
if (lastWasSection)
|
||||||
|
this.Nodes.Insert(0, tmp);
|
||||||
|
else
|
||||||
|
this.Nodes.Add(tmp);
|
||||||
|
// if last thing was section & this is step, do insert - i.e. so that steps go before sections.
|
||||||
|
lastWasSection = (o is PartInfo && (o as PartInfo).PartType == E_FromType.Section);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user