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


C# IO.GetExceptionDescription方法代码示例

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


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

示例1: InvalidVersion

			public InvalidVersion(IO.ITagStream tag, int expected, int expected_size, int got, int got_size) : base()
			{
				Debug.LogFile.WriteLine("Invalid versioning: expected {0} (0x{1}) but got {2} (0x{3})" + Program.NewLine +
					"\tIn {4}",
					expected.ToString(), expected_size.ToString("X4"), got.ToString(), got_size.ToString("X4"),
					tag.GetExceptionDescription());
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:7,代码来源:Exceptions.cs

示例2: InvalidStringId

			/// <summary>
			/// Raise an exception for an invalid <c>string_id</c> field in a stream
			/// </summary>
			/// <param name="inner"></param>
			/// <param name="offset_field">Offset of the <c>string_id</c> field</param>
			/// <param name="offset_data">Offset of the <c>string_id</c> data</param>
			/// <param name="tag">Tag which this <c>string_id</c> ultimately belongs to</param>
			/// <param name="length">Expected length of the <c>string_id</c></param>
			/// <param name="value">String read from the stream as the <c>string_id</c>'s value. Can be null.</param>
			public InvalidStringId(
				Exception inner, 
				uint offset_field, uint offset_data, 
				IO.ITagStream tag,
				int length, string value) : base(inner, "Invalid String Id")
			{
				Debug.LogFile.WriteLine(
					"Invalid string_id: [email protected]{0:X8}\[email protected]{1:X8}\tlength:{2:X2}\tvalue:{3}" + Program.NewLine +
					"\tIn {4}",
					offset_field, offset_data, 
					length, value != null ? value : "UNKNOWN",
					tag.GetExceptionDescription());
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:22,代码来源:Exceptions.cs

示例3: VerifyHeaderVersionIds

			void VerifyHeaderVersionIds(IO.ITagStream ts, Type type_of)
			{
				if ((header.Index != state.Attribute.Version || header.Size != state.Attribute.SizeOf) &&
					 state.VersionIsValid(header.Index, header.Size))
				{
					needsUpgrading = true;
				}
				else
				{
					if (header.Index != state.Attribute.Version)
					{
						if (header.Index > state.Attribute.Version)
							failureReason = VersioningFailureReason.VersionIdIsNewer;
						else
							failureReason = VersioningFailureReason.VersionIdNotSupported;

						Debug.LogFile.WriteLine("{5} field set version mismatch\[email protected]{0:X8} [{1} !{2}] in {3}\t {4}",
							relativeOffset, state.Attribute.Version, header.Index,
							type_of, ts.GetExceptionDescription(),
							GetTypeString());
						throw new Exceptions.InvalidVersion(ts, state.Attribute.Version, header.Index);
					}

					int expected_size;
					if (!state.VersioningSizeIsValid(header, ts.Flags, out expected_size))
					{
						if (state.VersioningCanBeImplicitlyPerformed(header, ts.Flags))
						{
							needsUpgrading = true;
							useImplicitUpgrading = true;
						}
						else
						{
							failureReason = VersioningFailureReason.VersionIdMismatch;

							Debug.LogFile.WriteLine("{5} field set sizeof mismatch \[email protected]{0:X8} [{1} !{2}] in {3}\t {4}",
								relativeOffset, expected_size, header.Size,
								type_of, ts.GetExceptionDescription(),
								GetTypeString());
							throw new Exceptions.InvalidVersion(ts, state.Attribute.Version, expected_size, header.Index, header.Size);
						}
					}
				}
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:44,代码来源:Version.cs

示例4: VerifyHeaderCount

			void VerifyHeaderCount(IO.ITagStream ts, Type type_of)
			{
				if (header.Count != expectedCount)
				{
					failureReason = VersioningFailureReason.CountMismatch;

					throw new Debug.ExceptionLog("{5} field set count mismatch \[email protected]{0:X8} [{1} !{2}] in {3}\t {4}",
						relativeOffset, expectedCount, header.Count,
						type_of, ts.GetExceptionDescription(),
						GetTypeString());
				}
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:12,代码来源:Version.cs

示例5: VerifyHeaderGroupTag

			void VerifyHeaderGroupTag(IO.ITagStream ts, Type type_of)
			{
				if (header.GroupTag != headerGroupTag.ID)
				{
					if(type == FieldType.Struct)
					{
						var groups = ts.Engine.VersionToStructCollection();
						int index = groups.FindGroupIndex(header.GroupTag);

						if(index == -1)
						{
							failureReason = VersioningFailureReason.GroupTagNotFound;

							Debug.LogFile.WriteLine("{5} field set signature failed (signature not found) \[email protected]{0:X8} [{1} !{2}] in {3}\t {4}",
								relativeOffset, headerGroupTag.TagToString(), new string(TagGroup.FromUInt(header.GroupTag)),
								type_of, ts.GetExceptionDescription(),
								GetTypeString());
							throw new Exceptions.InvalidVersion(ts);
						}
					}

					failureReason = VersioningFailureReason.GroupTagMismatch;

					Debug.LogFile.WriteLine("{5} field set signature failed\[email protected]{0:X8} [{1} !{2}] in {3}\t {4}",
						relativeOffset,
						headerGroupTag.TagToString(), new string(TagGroup.FromUInt(header.GroupTag)),
						type_of, ts.GetExceptionDescription(),
						GetTypeString());
					throw new Exceptions.InvalidVersion(ts);
				}
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:31,代码来源:Version.cs

示例6: InvalidTagReference

			/// <summary>
			/// Raise an exception for an invalid <c>tag_reference</c> field in a stream
			/// </summary>
			/// <param name="inner"></param>
			/// <param name="offset_field">Offset of the <c>tag_reference</c> field</param>
			/// <param name="offset_data">Offset of the <c>tag_reference</c> data (ie, tag name)</param>
			/// <param name="owner">Owner of the <see cref="TagReference"/> field. Can be null.</param>
			/// <param name="tag">Tag which this <c>tag_reference</c> ultimately belongs to</param>
			/// <param name="group_tag"><c>tag_reference</c>'s group tag</param>
			/// <param name="value"><c>tag_reference</c>'s tag name data. Can be null.</param>
			public InvalidTagReference(
				Exception inner, 
				uint offset_field, uint offset_data, 
				IStructureOwner owner, IO.ITagStream tag, 
				uint group_tag, string value) : base(inner, "Invalid Tag Reference")
			{
				Debug.LogFile.WriteLine(
					"Invalid tag_reference: [email protected]{0:X8}\[email protected]{1:X8}\tgroup={2,4}\tpath={3}" + Program.NewLine +
					"\tIn {4} in {5}",
					offset_field, offset_data, 
					group_tag, value != null ? value : "UNKNOWN",
					tag.GetExceptionDescription(), 
					owner != null ? owner.GetType().FullName : "UNKNOWN");
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:24,代码来源:Exceptions.cs

示例7: InvalidStructReference

			/// <summary>
			/// Raise an exception for an invalid data reference field in a stream
			/// </summary>
			/// <param name="inner"></param>
			/// <param name="offset_field">Offset of the data reference field</param>
			/// <param name="offset_data">Offset of the data reference data</param>
			/// <param name="owner">Owner of the <see cref="StructReference{T}"/> field. Can be null.</param>
			/// <param name="tag">Tag which this data reference ultimately belongs to</param>
			public InvalidStructReference(
				Exception inner, 
				uint offset_field, uint offset_data, 
				IStructureOwner owner, IO.ITagStream tag
				) : base(inner, "Invalid Data Reference")
			{
				Debug.LogFile.WriteLine(
					"Invalid data reference: [email protected]{0:X8}\[email protected]{1:X8}" + Program.NewLine +
					"\tIn {2} in {3}",
					offset_field, offset_data,
					tag.GetExceptionDescription(),
					owner != null ? owner.GetType().FullName : "UNKNOWN");
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:21,代码来源:Exceptions.cs

示例8: InvalidTagStruct

			/// <summary>
			/// Raise an exception for an invalid inline struct field in a stream
			/// </summary>
			/// <param name="inner"></param>
			/// <param name="offset_data">Offset of the inline struct data</param>
			/// <param name="owner">Owner of the <see cref="Struct{T}"/> field. Can be null.</param>
			/// <param name="tag">Tag which this inline struct ultimately belongs to</param>
			public InvalidTagStruct(
				Exception inner, 
				uint offset_data,
				IStructureOwner owner, IO.ITagStream tag
				) : base(inner, "Invalid Tag Struct")
			{
				Debug.LogFile.WriteLine(
					"Invalid inline struct: [email protected]{0:X8}" + Program.NewLine +
					"\tIn {1} in {2}",
					offset_data,
					tag.GetExceptionDescription(),
					owner != null ? owner.GetType().FullName : "UNKNOWN");
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:20,代码来源:Exceptions.cs


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