Usage

Using the library is as simple as importing the namespace and creating an instance of the Character class.

Character char1 = new Character("nemu", "Twilight's Hammer", ArmoryRegion.EU);

this works well for windows mobile devices, but as the library uses the connection manager to establish a connection with the unit it will fail on any other devices. To get around this, create a class that implements the INetworking interface and supply the Character object with an instance of this new networking class.

Example:
public class NonMobileNetworkingClass : DarkAngels.WoW.Library.Interfaces.INetworking
{
    public string GetFile(string uri)
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
        request.Method = "GET";
        request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)";
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        String memory = "";
        StreamReader sr = new StreamReader(response.GetResponseStream());
        memory = sr.ReadToEnd();
        sr.Close();
        sr.Dispose();
        return memory;
    }
}

Using the new network provider:
  Character char1 = new Character("nemu", "Twilight's Hammer", DarkAngels.WoW.Library.Armory.ArmoryRegion.EU);
  char1.Provider = new NonMobileNetworkingClass();
or:

  Character char1 = new Character("nemu", "Twilight's Hammer", DarkAngels.WoW.Library.Armory.ArmoryRegion.EU, new NonMobileNetworkingClass());

Only the "-Tab" properties on the character object are populated or will be populated when accessed. The other properties will be populated after accessing any one of the tab properties.

Using a proxy

If your client is behind a proxy, it's possible to set the proxy information like in the following example:
WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true);
SimpleNetworking networking = new SimpleNetworking();
networking.Proxy = proxyObject;
Character char1 = new Character("nemu", "Twilight's Hammer", DarkAngels.WoW.Library.Armory.ArmoryRegion.EU, networking);

Last edited Jan 4, 2010 at 8:05 AM by nemuandkirino, version 4

Comments

No comments yet.