forked from space-wizards/RobustToolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
87 changed files
with
1,699 additions
and
835 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Reflection.Emit; | ||
using XamlX.Ast; | ||
using XamlX.Emit; | ||
using XamlX.IL; | ||
using XamlX.TypeSystem; | ||
|
||
namespace Robust.Build.Tasks | ||
{ | ||
internal class RXamlColorAstNode | ||
: XamlAstNode, IXamlAstValueNode, IXamlAstILEmitableNode | ||
{ | ||
private readonly IXamlMethod _method; | ||
private readonly string _color; | ||
|
||
public RXamlColorAstNode(IXamlLineInfo lineInfo, RXamlWellKnownTypes types, string color) : base(lineInfo) | ||
{ | ||
_color = color; | ||
Type = new XamlAstClrTypeReference(lineInfo, types.Color, false); | ||
_method = types.ColorFromXaml; | ||
} | ||
|
||
public IXamlAstTypeReference Type { get; } | ||
|
||
public XamlILNodeEmitResult Emit(XamlEmitContext<IXamlILEmitter, XamlILNodeEmitResult> context, IXamlILEmitter codeGen) | ||
{ | ||
codeGen.Ldstr(_color); | ||
codeGen.EmitCall(_method); | ||
|
||
return XamlILNodeEmitResult.Type(0, Type.GetClrType()); | ||
} | ||
} | ||
} |
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
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.