private int GetLayerIndexFromLayerDesc(LayerDesc layerDesc) { int index = _layerTypes.FindIndex(l => l.LayerDescriptor.ToString() == layerDesc.ToString()); if (-1 == index) { throw new Exception("No valid layer with desc {layerDesc}"); } return(index); }
public override string ToString() { if (null != LayerDesc) { return(LayerDesc.ToString()); } else if (null != Layer2D) { return(Layer2D.ToString()); } else { throw new Exception("Unexpected LayerEncap type!"); } }