-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kathleen Dollard
committed
Nov 27, 2014
1 parent
0259ac2
commit 1a00f35
Showing
30 changed files
with
571 additions
and
226 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
72 changes: 72 additions & 0 deletions
72
RoslynDom/ExpressionImplementations/RDomLambdaMultiLineExpression.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,72 @@ | ||
using Microsoft.CodeAnalysis; | ||
using RoslynDom.Common; | ||
using System.ComponentModel.DataAnnotations; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace RoslynDom | ||
{ | ||
public class RDomLambdaMultiLineExpression : RDomBaseExpression, ILambdaMultiLineExpression | ||
{ | ||
private RDomCollection<IParameter> _parameters; | ||
private RDomCollection<IStatementAndDetail> _statements; | ||
|
||
public RDomLambdaMultiLineExpression(IDom parent, string initialExpressionString, | ||
string initialExpressionLanguage) | ||
: base(parent, initialExpressionString, initialExpressionLanguage, ExpressionType.Lambda) | ||
{ } | ||
|
||
public RDomLambdaMultiLineExpression(SyntaxNode rawItem, IDom parent, SemanticModel model) | ||
: base(rawItem, parent, model) | ||
{ Initialize(); } | ||
|
||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", | ||
"CA1811:AvoidUncalledPrivateCode", Justification = "Called via Reflection")] | ||
internal RDomLambdaMultiLineExpression(RDomLambdaMultiLineExpression oldRDom) | ||
: base(oldRDom) | ||
{ | ||
_parameters = oldRDom.Parameters.Copy(this); | ||
_statements = oldRDom.StatementsAll.Copy(this); | ||
} | ||
|
||
private void Initialize() | ||
{ | ||
_parameters = new RDomCollection<IParameter>(this); | ||
_statements = new RDomCollection<IStatementAndDetail>(this); | ||
} | ||
|
||
public override IEnumerable<IDom> Children | ||
{ | ||
get | ||
{ | ||
var list = base.Children.ToList(); | ||
list.AddRange(_statements); | ||
return list; | ||
} | ||
} | ||
|
||
private IReferencedType _returnType; | ||
[Required] | ||
public IReferencedType ReturnType | ||
{ | ||
get { return _returnType; } | ||
set { SetProperty(ref _returnType, value); } | ||
} | ||
|
||
public RDomCollection<IParameter> Parameters | ||
{ get { return _parameters; } } | ||
|
||
public RDomCollection<IStatementAndDetail> StatementsAll | ||
{ get { return _statements; } } | ||
|
||
public IEnumerable<IStatement> Statements | ||
{ get { return _statements.OfType<IStatement>().ToList(); } } | ||
|
||
public bool HasBlock | ||
{ | ||
get { return true; } | ||
set { } | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
RoslynDom/ExpressionImplementations/RDomLambdaSingleExpression.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,56 @@ | ||
using Microsoft.CodeAnalysis; | ||
using RoslynDom.Common; | ||
using System.ComponentModel.DataAnnotations; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace RoslynDom | ||
{ | ||
public class RDomLambdaSingleExpression : RDomBaseExpression, ILambdaSingleExpression | ||
{ | ||
private RDomCollection<IParameter> _parameters; | ||
|
||
public RDomLambdaSingleExpression(IDom parent, string initialExpressionString, | ||
string initialExpressionLanguage) | ||
: base(parent, initialExpressionString, initialExpressionLanguage, ExpressionType.Lambda) | ||
{ } | ||
|
||
public RDomLambdaSingleExpression(SyntaxNode rawItem, IDom parent, SemanticModel model) | ||
: base(rawItem, parent, model) | ||
{ Initialize(); } | ||
|
||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", | ||
"CA1811:AvoidUncalledPrivateCode", Justification = "Called via Reflection")] | ||
internal RDomLambdaSingleExpression(RDomLambdaSingleExpression oldRDom) | ||
: base(oldRDom) | ||
{ | ||
_parameters = oldRDom.Parameters.Copy(this); | ||
} | ||
|
||
private void Initialize() | ||
{ | ||
_parameters = new RDomCollection<IParameter>(this); | ||
} | ||
|
||
private IExpression _expression; | ||
[Required] | ||
public IExpression Expression | ||
{ | ||
get { return _expression; } | ||
set { SetProperty(ref _expression, value); } | ||
} | ||
|
||
private IReferencedType _returnType; | ||
[Required] | ||
public IReferencedType ReturnType | ||
{ | ||
get { return _returnType; } | ||
set { SetProperty(ref _returnType, value); } | ||
} | ||
|
||
|
||
public RDomCollection<IParameter > Parameters | ||
{ get { return _parameters ; } } | ||
|
||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
RoslynDom/ExpressionImplementations/RDomOtherExpression.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,24 @@ | ||
using Microsoft.CodeAnalysis; | ||
using RoslynDom.Common; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace RoslynDom | ||
{ | ||
public class RDomOtherExpression : RDomBaseExpression, IOtherExpression | ||
{ | ||
public RDomOtherExpression(IDom parent, string initialExpressionString, | ||
string initialExpressionLanguage, ExpressionType expressionType) | ||
: base(parent, initialExpressionString, initialExpressionLanguage, expressionType) | ||
{ } | ||
|
||
public RDomOtherExpression(SyntaxNode rawItem, IDom parent, SemanticModel model) | ||
: base(rawItem, parent, model) | ||
{ } | ||
|
||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", | ||
"CA1811:AvoidUncalledPrivateCode", Justification = "Called via Reflection")] | ||
internal RDomOtherExpression(RDomOtherExpression oldRDom) | ||
: base(oldRDom) | ||
{ } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd"> | ||
<metadata> | ||
<id>RoslynDom</id> | ||
<version>1.0.18-alpha</version> | ||
<title>RoslynDom</title> | ||
<authors>Kathleen</authors> | ||
<owners>Kathleen</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>Description</description> | ||
<copyright>Copyright © 2014</copyright> | ||
<dependencies> | ||
<dependency id="Microsoft.CodeAnalysis.Workspaces.Common" version="1.0.0-beta1-20141031-01" /> | ||
<dependency id="Unity" version="3.5.1405-prerelease" /> | ||
<dependency id="System.Reflection.Metadata" version="1.0.17-beta" /> | ||
</dependencies> | ||
</metadata> | ||
</package> |
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
Oops, something went wrong.