Welcome to the DevPower Web Site
  home   |  support   |  shop   |  downloads   |  about devpower 

DevPower Web Version Check .NET Version 1.0.0 (23-Jan-02)

Copyright (c) 2001 - 2017 Steve Robbins All Rights Reserved.

Documentation

Constructors

  • WebVersionCheck()
    This constructor performs check and does not wire up events.
  • WebVersionCheck( string url, string installedVersion, UpdateAvailable updateAvailableEvent )
    This constructor wires up the update available event and performs the version check.
  • WebVersionCheck( string url, string installedVersion, UpdateAvailable updateAvailableEvent, ExceptionOccurred exceptionOccurredEvent )
    This constructor wires up the update available and exception events, then performs the version check.
  • WebVersionCheck( string url, string installedVersion, UpdateAvailableXmlDoc updateAvailableXmlDocEvent )
    This constructor wires up the update available XmlDocument event and performs the version check.
  • WebVersionCheck( string url, string installedVersion, UpdateAvailableXmlDoc updateAvailableEventXmlDocEvent, ExceptionOccurred exceptionOccurredEvent )
    This constructor wires up the update available XmlDocument and exception events, then performs the version check.
  • WebVersionCheck( string url, string installedVersion, UpdateAvailable updateAvailableEvent, ExceptionOccurred exceptionOccurredEvent, UpdateUnavailable updateUnavailableEvent )
    This constructor wires up all text based update events and the exception event.

Properties

  • XPathVersion String
    Sets the XPath query to use to extract the version from XML files - default is /webvercheck/@version
  • XPathDownloadURL String
    Sets the XPath query to use to extract the download url from XML files - default is /webvercheck/@downloadURL
  • XPathAbstractText String
    Sets the XPath query to use to extract the abstract from XML files - default is /webvercheck/@abstract
  • XPathCustomText String
    Sets the XPath query to use to extract the custom text from XML files - default is /webvercheck
  • Version String
    Returns the version of the component.

Methods

  • Check( string url, string installedVersion)
    Starts the asynchronous download of the specified version file. If the url is invalid, an exception will be raised through the ExceptionOccurred event. If the url is valid, the XML will be parsed using the queries set by the XPath properties and either a UpdateAvailable, UpdateAvailableXmlDoc or UpdateUnavailable event will be raised.

Events

  • UpdateAvailable ( String newVersion, String downloadURL, String abstractText, String customText )
    Triggered by the Check() method when a new version has been found in the specified XML file.
    The newVersion parameter is the version in the control file.
    The downloadURL parameter is the optional URL to direct the user from the control file.
    The abstractText parameter is the optional abstract from the control file.
    The customText parameter is the optional custom data from the control file.
  • UpdateAvailableXmlDoc ( XmlDocument xmlDoc )
    A more flexible form of the above event where only the version number is checked and then the XmlDocument is passed back to the developer.
  • UpdateUnavailable ()
    Triggered by the Check() method when the version found in the version control file is the same or older than the installedVersion.
  • ExceptionOccurred ( Exception e )
    Notifies the developer of exceptions that occur during download (e.g. bad URL, not connected to Internet, file not found) or parsing (e.g. invalid XML, non-numeric version numbers)

XML File Content

The XML file format can follow any schema you desire as the control uses the XPath queries set by the XPath properties to extract text from the file. The default schema can be seen here.

  • Version - default XPath query: /webvercheck/@version
    the string to compare with the CurrentVersion property
  • (Optional) DownloadURL - default XPath query: /webvercheck/@downloadURL
    A URL that will be returned in the UpdateAvailable Event and displayed to the user in their web browser if the AutoLaunchBrowser property is set to True and a new version is found.
  • (Optional) Abstract - default XPath query: /webvercheck/@abstract
    Typically a message to display to users about the new version (however, it can be used however you like) that is returned in the UpdateAvailable Event
  • (Optional) CustomData - default XPath query: /webvercheck
    Custom information for your use - this field is the only one that can spread across multiple lines in the version file that is returned in the UpdateAvailable Event