This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace global | |
| open System | |
| open System.Collections.Generic | |
| open System.Threading.Tasks | |
| namespace ExploreCsharpEight | |
| type AsyncStreams() = | |
| member this.GenerateSequence() = | |
| do | |
| let mutable (i : int) = 0 | |
| while (i < 20) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace global | |
| namespace ConsumerVehicleRegistration | |
| type Car() = | |
| member val Passengers = Unchecked.defaultof<int> with get, set | |
| namespace CommercialRegistration | |
| type DeliveryTruck() = | |
| member val GrossWeightClass = Unchecked.defaultof<int> with get, set | |
| namespace LiveryRegistration | |
| type Taxi() = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace global | |
| open System | |
| open System.Linq | |
| namespace ExploreCsharpEight | |
| type IndicesAndRanges() = | |
| member val private words = [|"The"; "quick"; "brown"; "fox"; "jumped"; "over"; "the"; "lazy"; "dog"|] with get, set | |
| member this.Syntax_LastIndex() = | |
| Console.WriteLine (sprintf "The last word is %O" this.words.[(int (* ERROR UnknownPrefixOperator "^" *))]) | |
| 0 | |
| member this.Syntax_Range() = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open System.Drawing | |
| let (|RGB|) (col : System.Drawing.Color) = | |
| ( col.R, col.G, col.B ) | |
| let (|HSB|) (col : System.Drawing.Color) = | |
| ( col.GetHue(), col.GetSaturation(), col.GetBrightness() ) | |
| let printRGB (col: System.Drawing.Color) = | |
| match col with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Line 4 and 17 | |
| type MyType() = | |
| let mutable myInt1 = 10 | |
| [<DefaultValue>] val mutable myInt2 : int | |
| [<DefaultValue>] val mutable myString : string | |
| member this.SetValsAndPrint( i: int, str: string) = | |
| myInt1 <- i | |
| this.myInt2 <- i + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Microsoft.FSharp.Linq.QueryBuilder with | |
| [<CustomOperation("existsNot")>] | |
| member _.ExistsNot (source: QuerySource<'T, 'Q>, predicate) = | |
| Enumerable.Any (source.Source, Func<_,_>(predicate)) |> not |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Instance method definition. | |
| [ attributes ] | |
| member [inline] self-identifier.method-name parameter-list [ : return-type ] = | |
| method-body | |
| // Static method definition. | |
| [ attributes ] | |
| static member [inline] method-name parameter-list [ : return-type ] = | |
| method-body |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BufferClassDemo | |
| { | |
| // Display the array elements from right to left in hexadecimal. | |
| public static void DisplayArray( short[ ] arr ) | |
| { | |
| Console.Write( " arr:" ); | |
| for( int loopX = arr.Length - 1; loopX >= 0; loopX-- ) | |
| Console.Write( " {0:X4}", arr[ loopX ] ); | |
| Console.WriteLine( ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public override MethodInfo[] GetMethods(BindingFlags bindingAttr) | |
| { | |
| List<FlexMethodInfo> methods = new List<FlexMethodInfo>(); | |
| if (typeName == "Product") | |
| { | |
| methods.Add(new FlexMethodInfo("Concatenate", typeName)); | |
| methods.Add(new FlexMethFlexMethodInfo("Register", typeName)); | |
| return methods.ToArray(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FileStackRec | |
| { | |
| static void Main(string[] args) | |
| { | |
| // Specify the starting folder on the command line, or in | |
| // Visual Studio in the Project > Properties > Debug pane. | |
| TraverseTree(args[0]); | |
| Console.WriteLine("Press any key"); | |
| Console.ReadKey(); |