示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }