[Gtk-sharp-list] gtksourceview Problems

Calum Shaw-Mackay Calum.Shaw-Mackay@countrywideassured.co.uk
Thu, 11 Dec 2003 11:58:17 -0000


Sorry forgot to say

Running with
mono 0.29
gtk# 0.14

Cheers

Calum

> -----Original Message-----
> From: Calum Shaw-Mackay
> [mailto:Calum.Shaw-Mackay@countrywideassured.co.uk]
> Sent: 11 December 2003 11:52
> To: Gtk# list (E-mail)
> Subject: [Gtk-sharp-list] gtksourceview Problems
> 
> 
> Hi 
> 
> I'm looking at gtksourceview and gtksourceview-sharp and I 
> need a little
> help
> 
> If I try with a mime/file type that will not be recognised by 
> sourceview,
> no cast exception is thrown.
> 
> Whenever I try to select a recognised language from 
> SourceLanguages Manager,
> 
> I get an InvalidCastException in GetLanguageFromMimeType()
> It also happens if I try to cast to SourceLanguage for elements in
> SourceLanguagesManager.AvailableLanguages
> The following code:
> 
> try{
> 	SList list = langMgr.AvailableLanguages;
> 	Console.WriteLine("There are {0} available languages", 
> list.Count);
> 	for(int i=0;i<List.Count;i++){
> 		// What object types are returned?
> 		Console.WriteLine("Language: " + list[i].ToString());
> 	}
> 	SourceLanguage lang =
> langMgr.GetLanguageFromMimeType("text/x-csharp");
> 	Console.WriteLine("Lang: " + lang.Name);
> } catch (InvalidCastException e){
> 	Console.WriteLine(e.ToString());
> }
> 
> 
> The output was
> 
> There are 14 available languages
> Language: Glib.Object
> ...
> ...
> Language: Glib.Object
> 
> System.InvalidCastException: Cannot cast from source type to 
> destination
> type
> in <0x00068> 
> Gtk.SourceLanguagesManager:GetLanguageFromMimeType(string)
> in <0x0012a) Minotaur.Main:.ctor()
> 
> 
> System
> --------
> Mandrake 9.2
> gtksourceview 0.7.0
> gtksourceview-sharp 0.1.0
> 
> Any help would be much appreciated
> 
> **************************************************************
> **************
> ***************************************************************
> Calum Shaw-Mackay
> Java Developer
> 
> The information in this e-mail and any documents and files 
> transmitted with
> it are confidential and for the use of the intended recipient 
> only. If you
> are not the intended recipient, please delete the message and 
>  statements
> immediately and notify the sender. Any unauthorised 
> dissemination or copying
> of this e-mail, or any misuse or wrongful disclosure of the 
> information
> contained in it, is strictly prohibited and may be illegal. 
> 
> The opinions, statements and thoughts expressed in this e-mail and its
> attachments if any are those of the individual sender and not 
> necessarily
> Countrywide Assured Plc's or any associated personnel.
> 
> Although Countrywide Assured Plc believes this e-mail and any 
> attachments
> are free of any virus or other defect which may affect a 
> computer, it is the
> responsibility of the recipient to ensure that is it virus free and
> Countrywide Assured Plc does not accept any responsibility 
> for any loss or
> damage arising in this way from its use.
> 
> Countrywide Assured plc is authorised by the Financial 
> Services Authority.
> Countrywide Assured plc. Registered in England No. 2261746. Registered
> Office: Harbour House, Portway, Preston, Lancs. PR2 2PR. 
> 
> 
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 
>