コード例 #1
0
ファイル: ShowUnitTests.cs プロジェクト: robobat/Trakker
		public void Setup ()
		{

			myShow = new TVShow ();
			myShow.Name = "Breaking Bad";
			myShow.Network = "AMC";

		}
コード例 #2
0
ファイル: JSONParserForTMDB.cs プロジェクト: robobat/Trakker
		public JSONParserForTMDB (string data)
		{

			rawData = data;
			show = new TVShow ();

			populateShow ();
		}
コード例 #3
0
ファイル: TestsSample.cs プロジェクト: robobat/Trakker
		public void Setup ()
		{

			myShow = new TVShow ();
			myShow.Name = "Dexter";
			myShow.Network = "Showtime";


		}
コード例 #4
0
ファイル: XMLParser.cs プロジェクト: robobat/Trakker
		public void populateShowInitialDetails (string data)
		{
			if (data != null) {
				myShow = new TVShow ();
				myShow.fullXML = data;
				//String URLString = url;
				//String myXML = "";
				String currentElement = "";
				using (XmlReader reader = XmlReader.Create (new StringReader (data))) {
					Boolean isDone = false;

					while (reader.Read () && !isDone) {
						switch (reader.NodeType) {
						case XmlNodeType.Element:
							// The node is an element.
							//Console.Write ("<" + reader.Name);
							currentElement = reader.Name;
							while (reader.MoveToNextAttribute ()) {
								// Read the attributes.
								//Console.Write (" " + reader.Name + "='" + reader.Value + "'");
							}
							//Console.Write (">");
							//Console.WriteLine (">");
							break;
						case XmlNodeType.Text:
							//Display the text in each element.
							//Console.WriteLine (reader.Value);
							//Console.Write (" " + reader.Name + "='" + reader.Value + "'");
							switch (currentElement) {
							case "id":
								myShow.TVDBID = reader.Value;
								break;
							case "SeriesName":
								myShow.Name = reader.Value;
								break;
							case "Network":
								myShow.Network = reader.Value;
								break;
							case "poster":
								myShow.posterLink = reader.Value;
								//Console.WriteLine ("My poster link is " + myShow.posterLink);
								break;
							case "banner":
								myShow.bannerLink = reader.Value;
								break;
							case "IMDB_ID":
								myShow.IMDBID = reader.Value;
								break;
							case "Overview":
								myShow.Overview = reader.Value;
								break;
							default:
								break;
							}
							break;
						case XmlNodeType.EndElement:
							//Display the end of the element.
							if (string.Equals (reader.Name, "Series")) {
								isDone = true;
								Console.WriteLine ("I reached here");
							}
							//Console.Write ("</" + reader.Name);
							//Console.WriteLine (">");
							break;
						}
					}
				}

			}



		}
コード例 #5
0
ファイル: XMLParser.cs プロジェクト: robobat/Trakker
		public XMLParser ()
		{
			myShow = new TVShow ();

		}