当前位置: 首页>>代码示例>>C#>>正文


C# IReader.Skip方法代码示例

本文整理汇总了C#中IReader.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# IReader.Skip方法的具体用法?C# IReader.Skip怎么用?C# IReader.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IReader的用法示例。


在下文中一共展示了IReader.Skip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SkipExtraElements

		/// <summary>
		///     Skips over the extra per-vertex elements at the end of a vertex buffer.
		/// </summary>
		/// <param name="reader">The stream to seek.</param>
		/// <param name="section">The current model section.</param>
		public static void SkipExtraElements(IReader reader, IModelSection section)
		{
			int totalVertices = 0;
			foreach (IModelSubmesh submesh in section.Submeshes)
				totalVertices += submesh.VertexBufferCount;

			switch (section.ExtraElementsType)
			{
				case ExtraVertexElementType.Byte:
					reader.Skip((totalVertices*section.ExtraElementsPerVertex + 3) & ~3);
					break;
				case ExtraVertexElementType.Float3:
					reader.Skip(totalVertices*section.ExtraElementsPerVertex*3);
					break;
				case ExtraVertexElementType.None:
					break;
				default:
					throw new InvalidOperationException("Unsupported extra vertex element type: " + section.ExtraElementsType);
			}
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:25,代码来源:VertexBufferReader.cs

示例2: SkipIndexBuffer

 /// <summary>
 /// Skips over an index buffer in a stream.
 /// </summary>
 /// <param name="reader">The stream to seek.</param>
 /// <param name="count">The number of indices in the index buffer.</param>
 public static void SkipIndexBuffer(IReader reader, int count)
 {
     reader.Skip(count * 2); // 1 ushort per index
 }
开发者ID:iBotPeaches,项目名称:Assembly,代码行数:9,代码来源:IndexBufferReader.cs

示例3: ReadProperties

        private static IEnumerable<KeyValuePair<IPropertyDef, object>> ReadProperties(IScope scope, IReader reader, object obj, IElementDef def)
        {
            ReadStartElement(scope, reader, def);

            // read attributes
            if (def.Attributes.Any())
            {
                foreach (var attr in reader.ReadAttributes())
                {
                    var property = def.Attributes[attr.Key];
                    if (property != null)
                    {
                        var value = Parse(scope, property.Type, attr.Value);
                        yield return new KeyValuePair<IPropertyDef, object>(property, value);
                    }
                }
            }

            #if FULL
            bool json = reader.Format == Format.Json;
            #endif

            // read child elements
            foreach (var name in reader.ReadChildElements())
            {
                var property = def.Elements[name];
                object value;

            #if FULL
                if (json && property == null)
                {
                    property = def.Attributes[XNamespace.None + name.LocalName];
                    if (property != null)
                    {
                        value = Parse(scope, property.Type, reader.ReadString());
                        yield return new KeyValuePair<IPropertyDef, object>(property, value);
                        continue;
                    }
                }
            #endif

                if (property == null) // unknown type
                {
                    // todo: trace warning
                    reader.Skip();
                    continue;
                }

                if (ReadValue(scope, reader, obj, def, property, out value))
                {
                    yield return new KeyValuePair<IPropertyDef, object>(property, value);
                }
                else
                {
                    // todo: trace warning
                    reader.Skip();
                }
            }
        }
开发者ID:sergeyt,项目名称:xserializer,代码行数:59,代码来源:Deserializer.cs


注:本文中的IReader.Skip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。