ComponentOne RichTextBox for WPF
C1.WPF.SpellChecker Namespace / SpellDictionaryBase Class / LoadAsync Method / LoadAsync(Uri) Method
Uri that points to the compressed dictionary data.

In This Topic
    LoadAsync(Uri) Method
    In This Topic
    Loads the dictionary from a Uri pointing to the compressed dictionary data.
    Syntax
    'Declaration
     
    
    Public Overloads Sub LoadAsync( _
       ByVal uri As Uri _
    ) 
    public void LoadAsync( 
       Uri uri
    )

    Parameters

    uri
    Uri that points to the compressed dictionary data.
    Remarks

    When this method completes, it fires the LoadCompleted event.

    LoadAsync downloads the dictionary by creating a System.Net.WebClient object and calling its System.Net.WebClient.OpenReadAsync(System.Uri) method. This call will fail if the server is not configured to serve the file extension used by the dictionary file. If this happens, you have a few easy ways to solve the problem:

    • Rename the dictionary file to use an extension that is allowed by IIS. A good choice would be to use the 'zip' extension (dictionary files really are zip files). This is the easiest option because it does not require any changes to the server and no server-side code.
    • If you do not want to rename the file, configure IIS to allow serving "dct" files. This is done by adding the "dct" extension to the list of supported MIME types on the server. The drawback with this option is that it requires changes to the server configuration.
    • Write a web service that reads the dictionary file and returns its contents as a byte array. Then open a System.IO.MemoryStream using the array as the initial data and use the main dictionary's Load(Stream) method to load the dictionary from the System.IO.MemoryStream. The drawback with this option is that it requires additional code on the client as well as on the server side of the application.
    See Also