private static bool CheckSameType(NDlabObject obj, SearchCicuitType type, bool IsConnect) { if (obj == null) { return(false); } if (IsConnect == true) { if (obj.CheckConnect() == false) { return(false); } } //类型需匹配 if (type == SearchCicuitType.All) { return(true); } else if (type == SearchCicuitType.ELELINE) { if (obj is EleLine) { return(true); } } else if (type == SearchCicuitType.NormalCircuit) { bool b = (obj is EleLine); if (b == false) { return(true); } } else if (type == SearchCicuitType.Power) { if (obj is CurrentSourceElement) { return(true); } } return(false); }