@@ -73,7 +73,6 @@ namespace Microsoft.FSharp.Control
7373
7474let mutable multicast : 'Delegate = Unchecked.defaultof<_>
7575
76- #if ! FX_ NO_ DELEGATE_ CREATE_ DELEGATE_ FROM_ STATIC_ METHOD
7776static let mi , argTypes =
7877let instanceBindingFlags = BindingFlags.Instance||| BindingFlags.Public||| BindingFlags.NonPublic||| BindingFlags.DeclaredOnly
7978let mi = typeof< 'Delegate>. GetMethod( " Invoke" , instanceBindingFlags)
@@ -87,41 +86,31 @@ namespace Microsoft.FSharp.Control
8786( System.Delegate.CreateDelegate( typeof< EventWrapper< 'Delegate, 'Args>>, mi) :?> EventWrapper< 'Delegate, 'Args>)
8887else
8988null
90- #endif
9189
9290// For the multi-arg case, use a slower DynamicInvoke.
9391static let invokeInfo =
9492let instanceBindingFlags = BindingFlags.Instance||| BindingFlags.Public||| BindingFlags.NonPublic||| BindingFlags.DeclaredOnly
95- #if FX_ NO_ DELEGATE_ CREATE_ DELEGATE_ FROM_ STATIC_ METHOD
96- typeof< EventDelegee< 'Args>>. GetMethod( " Invoke" , instanceBindingFlags)
97- #else
9893let mi =
9994 typeof< EventDelegee< 'Args>>. GetMethods( instanceBindingFlags)
10095|> Seq.filter( fun mi -> mi.Name= " Invoke" && mi.GetParameters() .Length= argTypes.Length+ 1 )
10196|> Seq.exactlyOne
10297if mi.IsGenericMethodDefinitionthen
10398 mi.MakeGenericMethod argTypes
10499else
105- mi
106- #endif
107-
100+ mi
108101
109102member x.Trigger ( sender : obj , args : 'Args ) =
110103match box multicastwith
111104| null -> ()
112105| _ ->
113- #if ! FX_ NO_ DELEGATE_ CREATE_ DELEGATE_ FROM_ STATIC_ METHOD
114106match invokerwith
115107| null ->
116- #endif
117108let args = Array.append[| sender|] ( Microsoft.FSharp.Reflection.FSharpValue.GetTupleFields( box args))
118109 multicast.DynamicInvoke( args) |> ignore
119- #if ! FX_ NO_ DELEGATE_ CREATE_ DELEGATE_ FROM_ STATIC_ METHOD
120110| _ ->
121111// For the one-argument case, use an optimization that allows a fast call.
122112// CreateDelegate creates a delegate that is fast to invoke.
123113 invoker.Invoke( multicast, sender, args) |> ignore
124- #endif
125114
126115member x.Publish =
127116// Note, we implement each interface explicitly: this works around a bug in the CLR