[Mono-list] Announcing Mono 2.2 Preview 1...

Rodrigo Kumpera kumpera at gmail.com
Thu Dec 4 14:30:52 EST 2008


Please open a bug report with the information you know. If the binary
contains proprietary code you can
mark it as novell only so it won't be publicly exposed.

On Thu, Dec 4, 2008 at 5:20 PM, Andrus <kobruleht2 at hot.ee> wrote:

> Exception occurs in line
>
> browseForm.DoInit("", ' ', ' ');
>
> I  tried to create testcase below which corresponds to application code but
> this testcase works OK.
> No idea what I'm missing in testcase.
> I can provide binary file.
>
> Andrus.
>
> using System;
> using System.ComponentModel;
> using System.Windows.Forms;
> static class Program
> {
> static void Main()
> {
> DocumentToolsStripMenuItemClick<DokG, RidG>(null, "", ' ', ' ');
> }
>
> internal static void DocumentToolsStripMenuItemClick<TDoc, TRow>(object
> sender, string formSource,
> char formType, char subtype)
> where TDoc : DokBase, IDok, INotifyPropertyChanged, new()
> where TRow : EntityBase, IRid, new()
> {
> Type docType = typeof(TDoc);
> Type rowType = typeof(TRow);
> Type list = typeof(Dok);
> Type gt = typeof(DocumentForm<,,>).MakeGenericType(list, docType, rowType);
> var ctor = gt.GetConstructor(Type.EmptyTypes);
> BrowseForm browseForm;
> browseForm = (BrowseForm)(ctor.Invoke(new object[] { }));
> browseForm.FormName = "";
> browseForm.FormID = "";
> //** ERROR **: file method-to-ir.c: line 7306 (mono_method_to_ir2):
> assertion failed: (!callvirt_this_arg)
> //aborting...
> browseForm.DoInit("", ' ', ' ');
> }
> }
> partial class RidG : Rid
> {
> }
> partial class RidG : IRid
> {
> }
> public partial class Rid : EntityBase, INotifyPropertyChanged
> {
> public event PropertyChangedEventHandler PropertyChanged;
> protected virtual void OnPropertyChanged(string propertyName)
> {
> if (PropertyChanged != null)
> {
> PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
> }
> }
> }
> public class DokG : Dok
> {
> }
> public partial class Dok : DokBase, INotifyPropertyChanged
> {
> public event PropertyChangedEventHandler PropertyChanged;
> protected virtual void OnPropertyChanged(string propertyName)
> {
> }
> }
> public abstract class DokBase : EntityBase, IDok
> {
> }
> public interface IRid
> {
> }
> public abstract class EntityBase
> {
> }
> public interface IDok
> {
> }
> abstract partial class BrowseForm : BaseForm, IPickListForm
> {
> internal virtual void DoInit(string formSource, char formType, char
> formSubtype) { }
> }
> interface IPickListForm
> {
> }
> partial class BaseForm : Form
> {
> public string FormName;
> public string FormID;
> }
> sealed class DocumentForm<TList, TDoc, TRow> : BrowseForm, IGridHostForm
> where TList : class
> where TDoc : DokBase, IDok, INotifyPropertyChanged, new()
> where TRow : EntityBase, IRid, new()
> {
> internal override void DoInit(string formSource, char formType, char
> formSubtype)
> {
> MessageBox.Show("Test");
> }
> }
> interface IGridHostForm
> {
> }
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20081204/d247b80f/attachment-0001.html 


More information about the Mono-list mailing list