Open MovGP0 opened 9 years ago
Agreed, this particular case isn't matched by the current IL patterns. It looks like I need to flesh-out the unit tests and go over all the IL patterns.
I've added the pattern and your code works now. I've updated the NuGet package to 0.8.1. Thanks for your help and patience.
Is your issue resolved? Can I close this?
have not tried yet. will try later.
The issue still remains open:
using ...
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private NotifyTester _NotifyTester = new NotifyTester();
private AutoNotifyTester _AutoNotifyTester = new AutoNotifyTester();
public Form1()
{
InitializeComponent();
textBox1.DataBindings.Add(global::Name.Of(_NotifyTester.TestString), _NotifyTester, "testString", false, DataSourceUpdateMode.OnPropertyChanged);
textBox2.DataBindings.Add("Text", _NotifyTester, "TestString", false, DataSourceUpdateMode.OnPropertyChanged);
}
private void button1_Click(object sender, EventArgs e)
{
_NotifyTester.TestString = "Some value";
}
}
}
yields:
Error 2 Fody: An unhandled exception occurred:
Exception:
This usage of 'Name.Of' is not supported. Source: c:\Users\123456\Documents\Visual Studio 2012\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs - line 21
StackTrace:
at NameOf.Fody.ModuleWeaver.ProcessNameOfCallInstruction(Instruction instruction, ILProcessor ilProcessor) in c:\Users\nick.strupat\Documents\Visual Studio 2013\Projects\NameOf\NameOf.Fody\ModuleWeaver.cs:line 184
at NameOf.Fody.ModuleWeaver.ProcessMethod(MethodDefinition methodDefinition) in c:\Users\nick.strupat\Documents\Visual Studio 2013\Projects\NameOf\NameOf.Fody\ModuleWeaver.cs:line 69
at NameOf.Fody.ModuleWeaver.Execute() in c:\Users\nick.strupat\Documents\Visual Studio 2013\Projects\NameOf\NameOf.Fody\ModuleWeaver.cs:line 18
at lambda_method(Closure , Object )
at InnerWeaver.ExecuteWeavers() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 164
at InnerWeaver.Execute() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 82
Source:
NameOf.Fody
TargetSite:
Void ProcessNameOfCallInstruction(Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.ILProcessor)
WindowsFormsApplication1
When I try to compile the following code:
Then I get the following compiler error:
Apparently it is simply not implemented yet.