Last active
December 17, 2015 16:59
-
-
Save 7sharp9/5642813 to your computer and use it in GitHub Desktop.
Example of record construction syntax for multiple constructors
This file contains 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
[ProjectFileTypeDefinition(Name)] | |
public class HtmlProjectFileType : KnownProjectFileType | |
{ | |
public new const string Name = "HTML"; | |
public const string HTML_EXTENSION = ".html"; | |
public const string HTM_EXTENSION = ".htm"; | |
public new static readonly HtmlProjectFileType Instance; | |
private HtmlProjectFileType() : base(Name, "Html", new[] {HTML_EXTENSION, HTM_EXTENSION}) { } | |
protected HtmlProjectFileType(string name) : base(name) { } | |
protected HtmlProjectFileType(string name, string presentableName) : base(name, resentableName) { } | |
protected HtmlProjectFileType(string name, string presentableName, IEnumerable<string> extensions) : base(name, presentableName, extensions) { } | |
} |
This file contains 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
[<Literal>]let Name = "F#" | |
[<Literal>]let PresentableName = "FSHARP" | |
[<Literal>]let FS_EXTENSION = ".fs" | |
[<ProjectFileTypeDefinition(Name)>] | |
type FSharpProjectFileType = | |
inherit KnownProjectFileType | |
new() = {inherit KnownProjectFileType(Name, PresentableName, [|FS_EXTENSION|]) } | |
new(name) = {inherit KnownProjectFileType(name) } | |
new(name, presentableName) = { inherit KnownProjectFileType(name, presentableName) } | |
new(name, presentableName, extensions) = { inherit KnownProjectFileType(name, presentableName, extensions) } | |
[<DefaultValue>] static val mutable private instance: FSharpProjectFileType | |
static member Instance with get() = FSharpProjectFileType() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment