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


C# IO.ReadAttribute方法代码示例

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


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

示例1: ScriptFunctionArg

			public ScriptFunctionArg(ScriptFunction func, ProjectState state, IO.XmlStream s)
			{
				string type_name = null;
				s.ReadAttribute("type", ref type_name);

				if (!state.scriptingInterface.Types.Contains(type_name))
					throw new Debug.ExceptionLog("CheApe: value type '{0}' does not exist", type_name);

				type = state.scriptingInterface.GetValueType(type_name);
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:10,代码来源:Import_Scripts.cs

示例2: Element

				public Element(VertexBuffers owner, Definition parent, IO.XmlStream s) : base(parent, s)
				{
					UsageIndex = 0;

					string TypeStr = null;
					s.ReadAttribute("type", ref TypeStr);
					s.ReadAttributeOpt("usageIndex", 10, ref UsageIndex);

					Type t = owner.TypeFind(TypeStr) as Type;

					if (t != null) this.Type = t;
					else throw new Debug.ExceptionLog("'{0}' isn't a defined type (Owner: {1}/{2})", TypeStr, parent.Opcode.ToString("X2"), parent.Name);
				}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:13,代码来源:VertexBufferInterface.cs

示例3: MemoryInformation

			public MemoryInformation(IO.XmlStream s)
			{
				uint value = uint.MaxValue;
				s.ReadAttribute("baseAddress", 16, ref value);		BaseAddress = value;
				s.ReadAttribute("allocationSize", 16, ref value);	AllocationSize = value;
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:6,代码来源:Definition.cs

示例4: ScriptFunction

			public ScriptFunction(ProjectState state, IO.XmlStream s) : base(state, s)
			{
				string return_type_name = null;
				s.ReadAttribute("returnType", ref return_type_name);
				s.ReadAttributeOpt("help", ref helpString);
				s.ReadAttributeOpt("helpArg", ref helpArgString);
				s.ReadAttributeOpt("internal", ref IsInternal);

				foreach (XmlNode n in s.Cursor.ChildNodes)
				{
					if (n.Name != "arg") continue;

					s.SaveCursor(n);
					args.Add(new ScriptFunctionArg(this, state, s));
					s.RestoreCursor();
				}

				if (!state.scriptingInterface.Types.Contains(return_type_name))
					throw new Debug.ExceptionLog("CheApe: value type '{0}' does not exist", return_type_name);

				returnType = state.scriptingInterface.GetValueType(return_type_name);
				help = state.Compiler.Strings.Add(helpString);
				helpArg = state.Compiler.Strings.Add(helpArgString);
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:24,代码来源:Import_Scripts.cs

示例5: ScriptGlobal

			public ScriptGlobal(ProjectState state, IO.XmlStream s) : base(state, s)
			{
				string type_name = null;
				s.ReadAttribute("type", ref type_name);
				s.ReadAttributeOpt("internal", ref IsInternal);

				if (!state.scriptingInterface.Types.Contains(type_name))
					throw new Debug.ExceptionLog("CheApe: value type '{0}' does not exist", type_name);

				type = state.scriptingInterface.GetValueType(type_name);
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:11,代码来源:Import_Scripts.cs

示例6: Struct

			public Struct(BlamLib.CheApe.ProjectState state, IO.XmlStream s) : base(state, s)
			{
				s.ReadAttribute("groupTag", ref groupTag);

				block = new TagBlock();
				block.DisplayName = name;
				string tempName = nameString + "_block";
				block.Name = state.Compiler.Strings.Add(tempName);
				block.Read(state, s);
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:10,代码来源:Import.cs

示例7: ElementBase

				protected ElementBase(DefinitionBase parent, IO.XmlStream s)
				{
					Name = string.Empty;

					s.ReadAttributeOpt("name", ref Name);
					s.ReadAttribute("declType", ref DeclarationType);
				}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:7,代码来源:VertexBufferInterface.cs

示例8: Type

				public Type(IO.XmlStream s) : base(s)
				{
					s.ReadAttributeOpt("declMethod", ref DeclarationMethod);
					s.ReadAttribute("declUsage", ref DeclarationUsage);
					s.ReadAttributeOpt("usageIndex", 10, ref UsageIndex);
				}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:6,代码来源:VertexBufferInterface.cs

示例9: TagStruct

			public TagStruct(BlamLib.CheApe.ProjectState state, IO.XmlStream s)
			{
				string name_string = null;
				s.ReadAttribute("name", ref name_string);
				Name = name_string;

				Fields = new FieldContainer();
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:8,代码来源:Import.cs

示例10: Object

			protected Object(ProjectState state, IO.XmlStream s)
			{
				s.ReadAttribute("name", ref nameString);
				InitializeForExport(state, s);

				name = state.Compiler.Strings.Add(nameString);
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:7,代码来源:Import.cs

示例11: ObjectWithDebugName

			protected ObjectWithDebugName(ProjectState state, IO.XmlStream s) : base()
			{
				s.ReadAttribute("name", ref nameString);
				InitializeForExport(state, s);

				name = state.Compiler.DebugStrings.Add(nameString);
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:7,代码来源:Import.cs

示例12: Fixup

			public Fixup(ProjectState state, IO.XmlStream s) : base(state, s)
			{
				string temp = string.Empty;

				s.ReadAttribute("guerilla", 16, ref addressGuerilla);
				s.ReadAttribute("tool", 16, ref addressTool);
				s.ReadAttribute("sapien", 16, ref addressSapien);

				s.ReadAttribute("type", ref type);

				#region Definition
				if (type != FixupType.Field && s.ReadAttributeOpt("definition", ref temp))
				{
					if (type == FixupType.String || type == FixupType.StringPtr)
														definition = state.Compiler.RamAddString(temp, out definitionLength).ToString("X8");
					else if (type == FixupType.Memory)	definition = state.Compiler.RamAddMemory(temp, out definitionLength).ToString("X8");
					else if (type == FixupType.Pointer)	definition = temp;

					definitionGuerilla =
					definitionTool =
					definitionSapien =
						ToPointer();
				}
				else definition = null;
				#endregion

				if(definition == null) foreach (XmlNode node in s.Cursor.ChildNodes)
				{
					if (node.Name == "definition")
					{
						s.SaveCursor(node);

						if (type != FixupType.Field)
						{
							bool is_string = type == FixupType.String;

							// this will be set to false when not all platforms have a definition
							bool add_def_memory = true;
							if (add_def_memory)	add_def_memory = ReadSingleDefinition(state, s, "guerilla", ref definitionGuerilla);
							else				definitionGuerilla = uint.MaxValue;
							if (add_def_memory)	add_def_memory = ReadSingleDefinition(state, s, "tool", ref definitionTool);
							else				definitionTool = uint.MaxValue;
							if (add_def_memory)	add_def_memory = ReadSingleDefinition(state, s, "sapien", ref definitionSapien);
							else				definitionSapien = uint.MaxValue;

							// Houston, we forgot a platform...
							if (!add_def_memory && definitionGuerilla != uint.MaxValue)
							{
								// TODO: error here
							}
						}
						else
						{
							foreach (XmlNode fnode in s.Cursor.ChildNodes)
								if (fnode.Name == "field")
								{
									s.SaveCursor(fnode);
									field = new Field(state, s);
									s.RestoreCursor();
									break;
								}
						}

						s.RestoreCursor();
						break;
					}
				}
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:68,代码来源:Import.cs

示例13: FieldType

			public FieldType(IO.XmlStream s)
			{
				s.ReadAttribute("opcode", 16, ref opcode);
				s.ReadAttribute("size", 16, ref sizeOf);
				s.ReadAttribute("name", ref name);
				s.ReadAttributeOpt("needsDefinition", ref requiresDefinition);

				#region Read byte swap codes
				foreach (XmlNode n in s.Cursor.ChildNodes)
					if (n.Name == "byteSwap")
					{
						s.SaveCursor(n);
						int code = 0;
						foreach (XmlNode n2 in s.Cursor.ChildNodes)
						{
							if (n2.Name != "code") continue;

							s.SaveCursor(n2);
							s.ReadAttribute("value", 10, ref code);
							byteSwapCodes.Add(code);
							s.RestoreCursor();
						}
						s.RestoreCursor();
					}
				#endregion
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:26,代码来源:Definition.cs

示例14: TagBlock

			public TagBlock(BlamLib.CheApe.ProjectState state, IO.XmlStream s) : base(state, s)
			{
				s.ReadAttribute("maxElements", 10, ref maxElements);
				s.ReadAttributeOpt("dontReadChildren", ref DontReadChildren);

				mFields.Read(state, s);
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:7,代码来源:Import.cs

示例15: Field

			/// <summary>
			/// Constructs a field from an xml definition node
			/// </summary>
			/// <param name="state"></param>
			/// <param name="s"></param>
			public Field(ProjectState state, IO.XmlStream s)
			{
				string temp = string.Empty;

				#region Type
				s.ReadAttribute("type", ref temp);

				typeIndex = state.Definition.GetTypeIndex(temp);
				Debug.Assert.If(typeIndex != -1, "Not a usable field type: {0}", temp);
				#endregion

				#region Name
				nameString = temp = XmlInterface.BuildEditorNameString(s);

				name = state.Compiler.Strings.Add(temp);
				#endregion

				#region Definition
				if (s.ReadAttributeOpt("definition", ref definition) || TypeIndexIsExplanation(state))
				{
					SyncDefinitionWithState(state);
				}
				else if(state.Definition.FieldTypes[typeIndex].RequiresDefinition)
					throw new Debug.ExceptionLog("\"{0}\" of type {1} has no definition", nameString, state.Definition.FieldTypes[typeIndex].Name);
				#endregion
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:31,代码来源:Import_Tags.cs


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