IKVM11
11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
ConditionalInstruction.cs
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2010 Jeroen Frijters
3
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
7
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
11
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
19
20
Jeroen Frijters
21
jeroen@frijters.net
22
23
*/
24
25
using
System
;
26
using
System.Linq;
27
using
System.Xml.Linq;
28
29
using
IKVM.Runtime
;
30
31
namespace
IKVM.Tools.Importer.MapXml
32
{
33
34
[
Instruction
(
"conditional"
)]
35
public
sealed
class
ConditionalInstruction
:
Instruction
36
{
37
43
public
static
new
ConditionalInstruction
Read
(XElement element)
44
{
45
var inst =
new
ConditionalInstruction
();
46
Load
(inst, element);
47
return
inst;
48
}
49
55
public
static
void
Load
(
ConditionalInstruction
inst, XElement element)
56
{
57
Load
((
Instruction
)inst, element);
58
inst.Framework = (string)element.Attribute(
"framework"
);
59
inst.Code = element.Elements(
MapXmlSerializer
.
NS
+
"code"
).Select(
InstructionList
.
Read
).FirstOrDefault();
60
}
61
62
public
string
Framework
{
get
;
set
; }
63
64
public
InstructionList
Code
{
get
;
set
; }
65
66
internal
override
void
Generate(
CodeGenContext
context,
CodeEmitter
ilgen)
67
{
68
if
(Environment.Version.ToString().StartsWith(
Framework
))
69
{
70
Code
.Generate(context, ilgen);
71
}
72
}
73
74
}
75
76
}
IKVM.Runtime.CodeEmitter
Definition
CodeEmitter.cs:102
IKVM.Tools.Importer.MapXml.CodeGenContext
Definition
CodeGenContext.cs:33
IKVM.Tools.Importer.MapXml.ConditionalInstruction
Definition
ConditionalInstruction.cs:36
IKVM.Tools.Importer.MapXml.ConditionalInstruction.Code
InstructionList Code
Definition
ConditionalInstruction.cs:64
IKVM.Tools.Importer.MapXml.ConditionalInstruction.Framework
string Framework
Definition
ConditionalInstruction.cs:62
IKVM.Tools.Importer.MapXml.ConditionalInstruction.Load
static void Load(ConditionalInstruction inst, XElement element)
Loads the XML element into the instance.
Definition
ConditionalInstruction.cs:55
IKVM.Tools.Importer.MapXml.ConditionalInstruction.Read
static new ConditionalInstruction Read(XElement element)
Reads the XML element into a new instance.
Definition
ConditionalInstruction.cs:43
IKVM.Tools.Importer.MapXml.InstructionList
Definition
InstructionList.cs:34
IKVM.Tools.Importer.MapXml.InstructionList.Read
static InstructionList Read(XElement element)
Reads the XML element into a new InstructionList instance.
Definition
InstructionList.cs:41
IKVM.Tools.Importer.MapXml.Instruction
Base class for MapXML instruction instances.
Definition
Instruction.cs:15
IKVM.Tools.Importer.MapXml.MapXmlSerializer
Provides the ability to serialize MapXML.
Definition
MapXmlSerializer.cs:14
IKVM.Tools.Importer.MapXml.MapXmlSerializer.NS
static XNamespace NS
Definition
MapXmlSerializer.cs:16
Instruction
IKVM.Runtime.ClassFile.Method.Instruction Instruction
Definition
compiler.cs:44
IKVM.Runtime
Definition
Accessor.cs:5
IKVM.Runtime.LoadMode.Load
@ Load
IKVM.Tools.Importer.MapXml
Definition
Add.cs:30
System
Definition
HexConverter.cs:9
src
IKVM.Tools.Importer
MapXml
ConditionalInstruction.cs
Generated by
1.12.0