Added SearchPrev property
This commit is contained in:
parent
fbd6429670
commit
b0fc93d078
@ -13,14 +13,6 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return SearchNextSkip(SkipPartType.This);
|
return SearchNextSkip(SkipPartType.This);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string SearchNextPath
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
ItemInfo itemInfo = SearchNext;
|
|
||||||
return itemInfo == null ? "" : itemInfo.Path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private ItemInfo SearchNextSkip(SkipPartType skip)
|
private ItemInfo SearchNextSkip(SkipPartType skip)
|
||||||
{
|
{
|
||||||
if (skip < SkipPartType.Caution && Cautions != null) return Cautions[0].SearchTop;
|
if (skip < SkipPartType.Caution && Cautions != null) return Cautions[0].SearchTop;
|
||||||
@ -60,6 +52,55 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return parentItem.UpOneNext;
|
return parentItem.UpOneNext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public ItemInfo SearchPrev
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return SearchPrevSkip(SkipPartType.This);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private ItemInfo SearchPrevSkip(SkipPartType skip)
|
||||||
|
{
|
||||||
|
if (skip > SkipPartType.Steps && Steps != null) return Steps[0].LastSibling.SearchBottom;
|
||||||
|
if (skip > SkipPartType.Sections && Sections != null) return Sections[0].LastSibling.SearchBottom;
|
||||||
|
if (skip > SkipPartType.Procedures && Procedures != null) return Procedures[0].LastSibling.SearchBottom;
|
||||||
|
if (skip > SkipPartType.Table && Tables != null) return Tables[0].LastSibling.SearchBottom;
|
||||||
|
if (skip > SkipPartType.RNO && RNOs != null) return RNOs[0].LastSibling.SearchBottom;
|
||||||
|
if (skip > SkipPartType.This) return this;
|
||||||
|
if (skip > SkipPartType.Note && Notes != null) return Notes[0].LastSibling.SearchBottom;
|
||||||
|
if (skip > SkipPartType.Caution && Cautions != null) return Cautions[0].LastSibling.SearchBottom;
|
||||||
|
if (MyPrevious != null) return MyPrevious.SearchBottom;
|
||||||
|
return UpOnePrev;
|
||||||
|
}
|
||||||
|
public ItemInfo SearchBottom
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Steps != null) return Steps[0].LastSibling.SearchBottom;
|
||||||
|
if (Sections != null) return Sections[0].LastSibling.SearchBottom;
|
||||||
|
if (Procedures != null) return Procedures[0].LastSibling.SearchBottom;
|
||||||
|
if (Tables != null) return Tables[0].LastSibling.SearchBottom;
|
||||||
|
if (RNOs != null) return RNOs[0].LastSibling.SearchBottom;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public ItemInfo UpOnePrev
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
ItemInfo parentItem = ActiveParent as ItemInfo;
|
||||||
|
if (parentItem == null) return null;
|
||||||
|
if (IsCautionStructureFirstSib) return parentItem.SearchPrevSkip(SkipPartType.Caution);
|
||||||
|
if (IsNoteStructureFirstSib) return parentItem.SearchPrevSkip(SkipPartType.Note);
|
||||||
|
if (IsRNO) return parentItem.SearchPrevSkip(SkipPartType.RNO);
|
||||||
|
if (IsTable) return parentItem.SearchPrevSkip(SkipPartType.Table);
|
||||||
|
if (IsProcedure) return parentItem.SearchPrevSkip(SkipPartType.Procedures);
|
||||||
|
if (IsSection) return parentItem.SearchPrevSkip(SkipPartType.Sections);
|
||||||
|
if (IsStep) return parentItem.SearchPrevSkip(SkipPartType.Steps);
|
||||||
|
if (parentItem.MyPrevious != null) return parentItem.MyPrevious.SearchTop;
|
||||||
|
return parentItem.UpOnePrev;
|
||||||
|
}
|
||||||
|
}
|
||||||
enum SkipPartType
|
enum SkipPartType
|
||||||
{
|
{
|
||||||
Nothing=0,
|
Nothing=0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user