This should be equivalent to your VB code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    let mutable mSourceText = None

    let extractSource() =
        mSourceText <- Some ""
        if System.IO.File.Exists file then
            try
                use sr = new StreamReader(file)
                mSourceText <- Some (sr.ReadToEnd())
            with _ -> ()

    member this.SourceText =
        match mSourceText with
        | None -> extractSource()
        | Some t -> t
By on 6/13/2017 12:45 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper