27
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
var point = new Point { X = 5, Y = 10 };
8
int x1 = 0;
9
int y1 = 0;
10
(x1, y1) = point;
11
(int x2, int y2) = point;
12
int x3;
13
(x3, int y3) = point;
14
}
15
}
16
17
public struct Point
18
{
19
public int X {get; set;}
20
public int Y {get; set;}
21
22
public void Deconstruct(out int x, out int y)
23
{
24
x = X;
25
y = Y;
26
}
27
}
Cached Result
Environment version: 7.0.20
Type is type 1, value is ABC.
Type is type 3, value is DEF.
Type is type 1, value is GHI.
Type is type 3, value is JKL.
Type is type 3, value is MNO.
Deserialized and re-serialized XmlTest:
<?xml version="1.0" encoding="utf-16"?>
<xmltest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<type1>
<tekst>ABC</tekst>
</type1>
<type2>
<tekst>DEF</tekst>
</type2>
<type1>
<tekst>GHI</tekst>
</type1>
<type2>
<tekst>JKL</tekst>
</type2>
<type3>
<tekst>MNO</tekst>
</type3>
</xmltest>
Type is type 1, value is ABC.
Type is type 3, value is DEF.
Type is type 1, value is GHI.
Type is type 3, value is JKL.
Type is type 3, value is MNO.
Deserialized and re-serialized XmlTest:
<?xml version="1.0" encoding="utf-16"?>
<xmltest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<type1>
<tekst>ABC</tekst>
</type1>
<type2>
<tekst>DEF</tekst>
</type2>
<type1>
<tekst>GHI</tekst>
</type1>
<type2>
<tekst>JKL</tekst>
</type2>
<type3>
<tekst>MNO</tekst>
</type3>
</xmltest>