Name= (string)item.Element("Name")Doesn't declare any variables - it use the already declared
Name
and puts a value into it.
Exactly what the
item.Element("Name")
part does is open: without knowing what type
item
is it could be anything, but the most likely is that it's a generic method that returns an
object
from a store of some form, using "Name" as the index to locate exactly what item you want to fetch. The
(string)
part casts that object to a string (if it can, it will fail and throw and exception if it can't) so that the compiler will be happy stroign the value into a string variable called
Name
string Name = item.Element("Name");
Does declare the
Name
variable, and will probably give a compilation error if the Element method does not return a string type.
Your other two lines do very similar things, but this time casting the value to a integer instead of a string.
This is basic stuff: you really need to go back in your notes and review the language from the beginning if you don't understand this too well.