-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from sveinungf/dev/src-gen-cellvalueconverter
Source generator - CellValueConverter
- Loading branch information
Showing
53 changed files
with
1,103 additions
and
474 deletions.
There are no files selected for viewing
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
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
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
12 changes: 12 additions & 0 deletions
12
SpreadCheetah.SourceGenerator.CSharp8Test/Models/RemoveDashesValueConverter.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using SpreadCheetah.SourceGeneration; | ||
|
||
namespace SpreadCheetah.SourceGenerator.CSharp8Test.Models | ||
{ | ||
internal class RemoveDashesValueConverter : CellValueConverter<string> | ||
{ | ||
public override DataCell ConvertToDataCell(string value) | ||
{ | ||
return new DataCell(value.Replace("-", "")); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
SpreadCheetah.SourceGenerator.CSharp8Test/Models/UpperCaseValueConverter.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using SpreadCheetah.SourceGeneration; | ||
|
||
namespace SpreadCheetah.SourceGenerator.CSharp8Test.Models | ||
{ | ||
public class UpperCaseValueConverter : CellValueConverter<string> | ||
{ | ||
public override DataCell ConvertToDataCell(string value) | ||
{ | ||
return new DataCell(value.ToUpperInvariant()); | ||
} | ||
} | ||
} |
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
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
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
14 changes: 14 additions & 0 deletions
14
...napshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
Diagnostics: [ | ||
{ | ||
Id: SPCH1008, | ||
Title: Attribute combination not supported, | ||
Severity: Error, | ||
WarningLevel: 0, | ||
Location: : (7,19)-(7,27), | ||
MessageFormat: Having both the {0} and the {1} attributes on a property is not supported, | ||
Message: Having both the CellValueConverter and the CellValueTruncate attributes on a property is not supported, | ||
Category: SpreadCheetah.SourceGenerator | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
.../G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
Diagnostics: [ | ||
{ | ||
Id: SPCH1007, | ||
Title: Invalid attribute type argument, | ||
Severity: Error, | ||
WarningLevel: 0, | ||
Location: : (5,5)-(5,54), | ||
MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, | ||
Message: Type 'MyNamespace.DecimalValueConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter<decimal>, | ||
Category: SpreadCheetah.SourceGenerator | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
...erator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
Diagnostics: [ | ||
{ | ||
Id: SPCH1007, | ||
Title: Invalid attribute type argument, | ||
Severity: Error, | ||
WarningLevel: 0, | ||
Location: : (5,5)-(5,54), | ||
MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, | ||
Message: Type 'MyNamespace.DecimalValueConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter<string>, | ||
Category: SpreadCheetah.SourceGenerator | ||
} | ||
] | ||
} |
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
Oops, something went wrong.