XDocument doc = XDocument.Parse(callbackLine.ToString());
foreach (XElement el in doc.Root.Elements())
{
print(el.Attribute("username").Value + " " + el.Attribute("record").Value);
}
using (StringReader s = new StringReader(responseFromVk))
{
XDocument loadedData = XDocument.Load(s);
var data = from query in loadedData.Descendants("post")
select new vkClientMetro1.Wall
{
Id = (int)query.Element("id"),
From_id = (int)query.Element("from_id"),
To_id = (int)query.Element("to_id"),
Date = (int)query.Element("date"),
Text = (string)query.Element("text"),
};
listBox.ItemsSource = data;
}
public int monthInterval(int fMonth, int sMonth)
{
int f = fMonth + 1;
int s = sMonth - 1;
int buffer1 = 12 - (f - 1);
int buffer2 = 12 - s;
int buffer3 = buffer1 - buffer2;
int monthInterval = buffer3;
return monthInterval;
}