Add a script scratchpad for experimenting
This commit is contained in:
Родитель
78d9192585
Коммит
f4525bf983
|
@ -96,5 +96,6 @@
|
|||
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" />
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="scratchpad.fsx" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,19 @@
|
|||
#r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll"
|
||||
open MonoTouch.UIKit
|
||||
open System
|
||||
open System.Reflection
|
||||
|
||||
module TypeExt =
|
||||
type Type with
|
||||
member x.GetVirtualMethods() =
|
||||
x.GetMethods (BindingFlags.Instance ||| BindingFlags.Public ||| BindingFlags.DeclaredOnly)
|
||||
|> Array.filter (fun m -> m.IsVirtual)
|
||||
|
||||
let vc = typeof<UIViewController>
|
||||
let meths =
|
||||
vc.GetMethods (BindingFlags.Instance ||| BindingFlags.Public ||| BindingFlags.DeclaredOnly)
|
||||
|> Array.filter (fun m -> m.IsVirtual && (*not*) (m.ReturnType = typeof<Void>) )
|
||||
meths.Length
|
||||
|
||||
open TypeExt
|
||||
typeof<UIViewController>.GetVirtualMethods() |> Array.map (fun m-> m.Name + " : " + m.ReturnType.FullName )
|
Загрузка…
Ссылка в новой задаче