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

Andrus kobruleht2 at hot.ee
Thu Dec 4 14:20:59 EST 2008


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
{
}




More information about the Mono-list mailing list