.on "GetSystemType" that is.

 

Also doing this:

<?brail

import Boo.Lang

import Boo.Lang.Extensions

import System

h = FormHelper

sm = {

           bool:h.GetType().GetMethod("CheckBox") as duck,

           string:h.GetType().GetMethod("TextField") as duck

}

?>

 

Without as duck, there's an ambiguous exception, and with duck there's the:
"The name 'duck' does not denote a valid type. Did you mean
'System.Security.Cryptography.DES' ?"

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Henrik Feldt
Sent: den 31 maj 2009 04:43
To: [email protected]
Subject: RE: Problem using Brail

 

What's that syntax? If I have something like this;

                      public virtual Type GetSystemType()

                      {

                                 Type t;

                                 if (TryGetSystemType(out t)) return t;

                                 throw new
ApplicationException(string.Format("Unable to get system type for {0}",
_SettingDataType));

                      }

 

And this in the brail file:

sm[setting.GetSystemType](setting.Name)

 

I still get the "MethodNotFoundException".

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Ayende Rahien
Sent: den 31 maj 2009 04:14
To: [email protected]
Subject: Re: Problem using Brail

 

That wouldn't quite work, mostly because Boo's syntax support calling
methods with no params.

 

On Sun, May 31, 2009 at 3:45 AM, Henrik Feldt <[email protected]> wrote:

The best thing would be to only invoke
Brail.ExpandDuckTypedExpressions_WorkaroundForDuplicateVirtualMethods.GetPro
perty when there are () or ( . ) after a method body, wouldn't it, and
reference the method group otherwise?

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Henrik Feldt
Sent: den 31 maj 2009 03:42
To: [email protected]
Subject: Problem using Brail

 

This blows up:

 

<?brail

1: import System

2: h = FormHelper

3: settingMap = { "editor":h.TextArea } // there'll be more setting keys
coming here

4: output settingMap["editor"]("testing", {...@class:"wymeditor"}) ?>

 

With:

Method 'Castle.MonoRail.Framework.Helpers.FormHelper.TextArea' not found.

 

Stacktrace:

Line 137:                      if (null == type)
Line 138:                      {
Line 139:                             return
target.GetType().InvokeMember(name,
Line 140:
ResolveFlagsToUse(target.GetType(), GetPropertyBindingFlags),
Line 141:
null,

 

[MissingMethodException: Method
'Castle.MonoRail.Framework.Helpers.FormHelper.TextArea' not found.]

   System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags,
Binder binder, Object target, Object[] providedArgs, ParameterModifier[]
modifiers, CultureInfo culture, String[] namedParams) +2172

   System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
binder, Object target, Object[] args) +28

 
Castle.MonoRail.Views.Brail.ExpandDuckTypedExpressions_WorkaroundForDuplicat
eVirtualMethods.GetProperty(Object target, String name) in
ExpandDuckTypedExpressions_WorkaroundForDuplicateVirtualMethods.cs:139

   BrailView_test.Run() +67

   Castle.MonoRail.Views.Brail.BooViewEngine.RenderView(String templateName,
BrailBase view)

 

Problem:

It assumes I want to invoke the method without parameters (which obviously
doesn't exist), when I want a reference to it on line 3, so I can fold the
method invocations into a map and invoke them per type/key. Here is where I
would really love dynamic typing, because I don't know all combinations
before invocation. 

 

Any ideas about how to fix?

 

Cheers

 

 

 

 

 

 



 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to