Visual Studio 2010 vs. MonoDevelop Resource file problem

Status
Not open for further replies.

stahlwerk

Smack-Fu Master, in training
98
I've got a problem with custom controls that exceeds my knowledge of the way Visual Studio handles resources. So my hope is for a little help from this multimind of ars.

My project is using OpenTK for cg-related computations, and to facilitate input of Vector and Matrix values, I created a couple of custom controls. Keeping with the Windows.Forms controls, I exposed the current value of the control as a property called Value, which gets initialized in the constructor, like so:
Code:
Matrix4 value;
public Matrix4 Value
{
     get { return GetMatrix(); } // reads the form values and puts them in a Matrix4
     set {
         this.value = value;
         refillControl(); // does what it says ;-)
     }
}

// constructor initializes Value to default
public MatrixControl()
{
      value = Matrix4.Identity;
      InitializeComponent();   
}

Now, somehow VS insist on initializing the control.Value property again in the parent form's InitializeComponent() method.

Code:
…
this.matrixControl.Value = ((OpenTK.Matrix4)(resources.GetObject("matrixControl.Value")));
…

And here's where the problems start: I cross-develop the same project on a MacBook using MonoDevelop. Since adding the Matrix-Control to the project, building fails with the following error message (please mind that I do reference OpenTK 1.0.0.0 in the project):

/.../NodeLightsControl.resx: Error: Error: Invalid ResX input.
Position: Line 126, Column 5.
Inner exception: Couldn't find assembly 'OpenTK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4'

The resource itself is a binary encoded blob. Here's the relevant part in the resx file:

Code:
 <data name="matrixControl.Value" mimetype="application/x-microsoft.net.object.binary.base64">
    <value>
        AAEAAAD/////AQAAAAAAAAAMAgAAAElPcGVuVEssIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0
        cmFsLCBQdWJsaWNLZXlUb2tlbj1iYWQxOTlmZTg0ZWIzZGY0BQEAAAAOT3BlblRLLk1hdHJpeDQEAAAA
        BFJvdzAEUm93MQRSb3cyBFJvdzMEBAQEDk9wZW5USy5WZWN0b3I0AgAAAA5PcGVuVEsuVmVjdG9yNAIA
        AAAOT3BlblRLLlZlY3RvcjQCAAAADk9wZW5USy5WZWN0b3I0AgAAAAIAAAAF/f///w5PcGVuVEsuVmVj
        dG9yNAQAAAABWAFZAVoBVwAAAAALCwsLAgAAAAAAgD8AAAAAAAAAAAAAAAAB/P////3///8AAAAAAACA
        PwAAAAAAAAAAAfv////9////AAAAAAAAAAAAAIA/AAAAAAH6/////f///wAAAAAAAAAAAAAAAAAAgD8L
</value>
  </data>

Now here are my questions:
What can I do to keep the VS designer from trying to initialize the Value property? I have the suspicion that I'm working against some fundamental design decision here, so what is the best practice of exposing a default Value of a custom control?
If that's not possible, how can I make the mono resx compiler recognize the OpenTK dll reference?

Thanks for your time and in advance for your help.
 
Status
Not open for further replies.