System.Xml.XmlReader.GetAttribute C# (CSharp) Method

GetAttribute() public abstract method

public abstract GetAttribute ( int i ) : string
i int
return string
        public abstract string GetAttribute(int i);

Same methods

XmlReader::GetAttribute ( string name ) : string
XmlReader::GetAttribute ( string name, string namespaceURI ) : string

Usage Example

        public static bool parseFromFile(Entity entity, XmlReader reader)
        {
            // Fill info into provided entity
            string tag;
            int id, x, y;

            try
            {
                id = int.Parse(reader.GetAttribute("id"));
                x = int.Parse(reader.GetAttribute("x"));
                y = int.Parse(reader.GetAttribute("y"));
                tag = reader.GetAttribute("tag");
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
                return false;
            }

            entity.id = id;
            entity.tag = tag;
            entity.x = x;
            entity.y = y;

            return true;
        }
All Usage Examples Of System.Xml.XmlReader::GetAttribute