Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
roncli edited this page Nov 12, 2014 · 2 revisions

The following document will describe basic usage of the library. It is recommended that you look at the demo project in the source file for a more detailed look at how LibWowAPI operates. There is also help documentation available which fully documents that API.

Referencing the library

Be sure to include a reference to LibWowAPI in your class with the following declaration:

C#

using roncliProductions.LibWowAPI;

VB.Net

Imports roncliProductions.LibWowAPI

Shared properties

There are several shared properties that you can set prior to using the library:

C#

// For Mashery API authentication
WowAPIData.ApiKey = "ABCDEFGHIJKL";
// Supporting all regions and languages currently supported by the API
WowAPIData.Region = Internationalization.Region.NorthAmerica;
WowAPIData.Language = Internationalization.Language.EnglishUS;
// Identify your application to Blizzard
WowAPIData.Application = "My LibWowAPI Application";
WowAPIData.ApplicationURL = "http://www.mywowsite.com";

VB.Net

' For Mashery API authentication
WowAPIData.ApiKey = "ABCDEFGHIJKL"
' Supporting all regions and languages currently supported by the API
WowAPIData.Region = Internationalization.Region.NorthAmerica
WowAPIData.Language = Internationalization.Language.EnglishUS
' Identify your application to Blizzard
WowAPIData.Application = "My LibWowAPI Application"
WowAPIData.ApplicationURL = "http://www.mywowsite.com"

Instantiation

To use the library, first you instantiate an instance of the class you want to use.

C#

Character cCharacter = new Character.CharacterProfile();

VB.Net

Dim cCharacter As New Character.CharacterProfile()

Options

Next, you set options you want to use.

C#

cCharacter.Options.Realm = "Lightbringer";
cCharacter.Options.Name = "Roncli";
cCharacter.Options.Items = true;
cCharacter.Options.Talents = true;
cCharacter.Options.Progression = true;

VB.Net

cCharacter.Options.Realm = "Lightbringer"
cCharacter.Options.Name = "Roncli"
cCharacter.Options.Items = True
cCharacter.Options.Talents = True
cCharacter.Options.Progression = True

Loading the data

Then, you load the data from the API.

C#

cCharacter.Load();

VB.Net

cCharacter.Load()

Retrieving information

Finally, you retrieve the information from the object.

C#

int intAchievementPoints = cCharacter.Character.AchievementPoints;
Character.Item iHeadItem = cCharacter.Character.Items.Head;

VB.Net

Dim intAchievementPoints As Integer = cCharacter.Character.AchievementPoints
Dim iHeadItem as Character.Item = cCharacter.Character.Items.Head

Using LINQ

Some properties are made of collections, which allows for using LINQ.

C#

var varSelectedTalents = (from t in cCharacter.Talents where t.Selected select t);
var varClearedHeroicRaids = (from r in cCharacter.Progression.Raids where r.Heroic == Progress.Cleared select r);

VB.Net

Dim varSelectedTalents = (From t in cCharacter.Talents Where t.Selected)
Dim varClearedHeroicRaids = (From r in cCharacter.Progression.Raids Where r.Heroic = Progress.Cleared)