コード例 #1
0
        public static YkdResourceViewport ReadFromStream(YkdResourceViewportType type, Stream stream)
        {
            YkdResourceViewport result;

            switch (type)
            {
            case YkdResourceViewportType.Empty:
                result = new EmptyYkdResourceViewport();
                break;

            case YkdResourceViewportType.Full:
                result = new FullYkdResourceViewport();
                break;

            case YkdResourceViewportType.Fragment:
                result = new FragmentYkdResourceViewport();
                break;

            case YkdResourceViewportType.Extra:
                result = new ExtraYkdResourceViewport();
                break;

            default:
                throw new NotImplementedException(type.ToString());
            }

            result.ReadFromStream(stream);
            return(result);
        }
コード例 #2
0
        public static YkdResourceViewport ReadFromStream(YkdResourceViewportType type, Stream stream)
        {
            YkdResourceViewport result;

            switch (type)
            {
                case YkdResourceViewportType.Empty:
                    result = new EmptyYkdResourceViewport();
                    break;
                case YkdResourceViewportType.Full:
                    result = new FullYkdResourceViewport();
                    break;
                case YkdResourceViewportType.Fragment:
                    result = new FragmentYkdResourceViewport();
                    break;
                case YkdResourceViewportType.Extra:
                    result = new ExtraYkdResourceViewport();
                    break;
                default:
                    throw new NotImplementedException(type.ToString());
            }

            result.ReadFromStream(stream);
            return result;
        }