public static bool TryGetPrimaryContent(Halo5.ModuleItem item, out object content) { switch (item.ClassCode) { case bitmap: IBitmap bitmapContent; if (TryGetBitmapContent(item, out bitmapContent)) { content = bitmapContent; return(true); } break; case render_model: IRenderGeometry geometryContent; if (TryGetGeometryContent(item, out geometryContent)) { content = geometryContent; return(true); } break; } content = null; return(false); }
public static bool TryGetGeometryContent(Halo5.ModuleItem item, out IRenderGeometry content) { content = null; if (item.ClassCode != render_model) { return(false); } content = item.ReadMetadata <Halo5.render_model>(); return(content != null); }
public static bool TryGetBitmapContent(Halo5.ModuleItem item, out IBitmap content) { content = null; if (item.ClassCode != bitmap) { return(false); } content = item.ReadMetadata <Halo5.bitmap>(); return(content != null); }