Created
September 18, 2011 07:00
-
-
Save azyobuzin/1224825 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Xml.Linq; | |
namespace Azyobuzi.Azyotter.Models.TwitterDataModel | |
{ | |
public class Source | |
{ | |
public string Name { get; set; } | |
public string Href { get; set; } | |
public static Source Create(string source) | |
{ | |
try | |
{ | |
var xml = XElement.Parse(source); | |
return new Source() | |
{ | |
Name = xml.Value, | |
Href = xml.Attribute("href").Value, | |
}; | |
} | |
catch | |
{ | |
return new Source() | |
{ | |
Name = source, | |
Href = "http://twitter.com/" | |
}; | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Xml.Linq; | |
namespace Uxeen.Twitter | |
{ | |
public class Source | |
{ | |
public string Name { get; set; } | |
public string Href { get; set; } | |
public static Source Create(string text) | |
{ | |
try | |
{ | |
var xml = XElement.Parse(text); | |
return new Source() | |
{ | |
Name = xml.Value, | |
Href = xml.Attribute("href").Value, | |
}; | |
} | |
catch | |
{ | |
return new Source() | |
{ | |
Name = text, | |
Href = "http://twitter.com/" | |
}; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment