Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Documentation

Suraj G. edited this page Aug 18, 2015 · 3 revisions

#How to use Urban10 Welcome to the Urban10 wiki!

Using Urban10 is incredibly simple! First of course, go ahead and import the library into your project, you can do so by downloading the .dll from the Releases section here on GitHub! Already done that? Cool, skip ahead to the next section!

##First Steps First things, first go ahead and reference the Urban10 namespace:

using PixelatedTile.Urban10;

##Searching for a Word or Phrase Searching for a word or phrase using Urban10 is incredibly easy!

  UrbanDictionary ub = new UrbanDictionary(); //Make a new instance of the Urban Dictionary Class

  var results = await ub.FindWord("lol"); //Call the FindWord function`

  mainResultsView.ItemsSource = results; //Feed the results to a listview

To break this down,

we first create a new instance of the UrbanDictionary class, in this case the constructor doesn't take any arguments. Next we call the UrbanDictionary.FindWord function, this takes a string as an argument. The string is the word or phrase you want to search, we store it in a variable and then set the variable to the ListView.ItemSource property. We can do this directly since the UrbanDictionary.FindWord function returns a list and we can just bind properties to it.

###UrbanDictionary.FindWord in detail This returns a List. Whats exactly in the list?

 public int defid { get; set; }     *The ID of the definition 
 public string word { get; set; }   *The Word 
 public string author { get; set; } *The Author
 public string permalink { get; set; } *The Premalink to the definition
 public string definition { get; set; } *The definition itself
 public string example { get; set; }  *The example
 public int thumbs_up { get; set; } *Thumbs up count
 public int thumbs_down { get; set; } *Thumbs down count
 public string current_vote { get; set; } *The current vote
Clone this wiki locally