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); }
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; }