CSLA - Extension
This commit is contained in:
@@ -1,19 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public partial class ItemInfo
|
||||
{
|
||||
public ItemInfo SearchNext
|
||||
{
|
||||
get
|
||||
{
|
||||
return SearchNextSkip(SkipPartType.This);
|
||||
}
|
||||
}
|
||||
private ItemInfo SearchNextSkip(SkipPartType skip)
|
||||
public ItemInfo SearchNext => SearchNextSkip(SkipPartType.This);
|
||||
private ItemInfo SearchNextSkip(SkipPartType skip)
|
||||
{
|
||||
if (skip < SkipPartType.Caution && Cautions != null && Cautions.Count > 0) return Cautions[0].SearchTop;
|
||||
if (skip < SkipPartType.Note && Notes != null && Notes.Count > 0) return Notes[0].SearchTop;
|
||||
@@ -28,9 +18,8 @@ namespace VEPROMS.CSLA.Library
|
||||
bool iseditable = true;
|
||||
if (IsSection)
|
||||
{
|
||||
SectionConfig sc = MyConfig as SectionConfig;
|
||||
if (sc != null && sc.SubSection_Edit != "Y") iseditable = false;
|
||||
}
|
||||
if (MyConfig is SectionConfig sc && sc.SubSection_Edit != "Y") iseditable = false;
|
||||
}
|
||||
if (iseditable && skip < SkipPartType.Steps && Steps != null && Steps.Count > 0) return Steps[0].SearchTop;
|
||||
|
||||
if (NextItem != null) return NextItem.SearchTop;
|
||||
@@ -49,9 +38,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
ItemInfo parentItem = ActiveParent as ItemInfo;
|
||||
if (parentItem == null) return null;
|
||||
if (IsCautionPart) return parentItem.SearchNextSkip(SkipPartType.Caution);
|
||||
if (!(ActiveParent is ItemInfo parentItem)) return null;
|
||||
if (IsCautionPart) return parentItem.SearchNextSkip(SkipPartType.Caution);
|
||||
if (IsNotePart) return parentItem.SearchNextSkip(SkipPartType.Note);
|
||||
if (IsRNOPart) return parentItem.SearchNextSkip(SkipPartType.RNO);
|
||||
if (IsSupInfoPart) return parentItem.SearchNextSkip(SkipPartType.SupInfo);
|
||||
@@ -63,14 +51,8 @@ namespace VEPROMS.CSLA.Library
|
||||
return parentItem.UpOneNext;
|
||||
}
|
||||
}
|
||||
public ItemInfo SearchPrev
|
||||
{
|
||||
get
|
||||
{
|
||||
return SearchPrevSkip(SkipPartType.This);
|
||||
}
|
||||
}
|
||||
private ItemInfo SearchPrevSkip(SkipPartType skip)
|
||||
public ItemInfo SearchPrev => 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;
|
||||
@@ -101,9 +83,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
ItemInfo parentItem = ActiveParent as ItemInfo;
|
||||
if (parentItem == null) return null;
|
||||
if (IsCautionPart) return parentItem.SearchPrevSkip(SkipPartType.Caution);
|
||||
if (!(ActiveParent is ItemInfo parentItem)) return null;
|
||||
if (IsCautionPart) return parentItem.SearchPrevSkip(SkipPartType.Caution);
|
||||
if (IsNotePart) return parentItem.SearchPrevSkip(SkipPartType.Note);
|
||||
if (IsRNOPart) return parentItem.SearchPrevSkip(SkipPartType.RNO);
|
||||
if (IsSupInfoPart) return parentItem.SearchPrevSkip(SkipPartType.SupInfo);
|
||||
|
||||
Reference in New Issue
Block a user