public bool CheckHistoryState(long lGroup, ref int iHistoryRes) { trace.Write(TraceLevel.Debug, "CM1GroupTree::CheckHistoryState"); bool fnResult = true; int iState; bool bGrpStop = true; try { CM1Group group = GetGroupFromGrpId(lGroup); if (group == null) { throw new InvalidOperationException("Could not obtain group of current operation"); } iHistoryRes = (int)M1GroupState.GRP_ON; while (group != null) { iState = (int)group.GetState(); lGroup = group.GetGrpId(); bGrpStop = (bGrpStop && (iState == (int)M1GroupState.GRP_STOP)); if (iState == (int)M1GroupState.GRP_REE) { iHistoryRes = iState; break; } group = GetGroupParent(lGroup); } if (bGrpStop) { iHistoryRes = (int)M1GroupState.GRP_STOP; } } catch (Exception error) { trace.Write(TraceLevel.Error, error.ToLogString()); fnResult = false; } return(fnResult); }