/// <summary> /// Construct a concrete instance of a sub grid implementing the IClientLeafSubGrid interface based /// on the role it should play according to the grid data type requested. All aspects of leaf ownership /// by a sub grid tree, parentage, level, cell size, index origin offset are delegated responsibilities /// of the caller or a derived factory class /// </summary> /// <returns>An appropriate instance derived from ClientLeafSubGrid</returns> public IClientLeafSubGrid GetSubGrid(GridDataType gridDataType) { IClientLeafSubGrid result = null; //* TODO: Don't use repatriated sub grids for now... // if (!ClientLeaves[(int) gridDataType].TryTake(out IClientLeafSubGrid result)) // { if (_typeMap[(int)gridDataType] != null) { result = _typeMap[(int)gridDataType](); } // } result?.Clear(); return(result); }