Zdravim, tak zkouska uz je za nama a otazky byly vazne zajimave :-)
class Program{static void Main(string[] args){var n = new MyEnumerable();var list = from x in n where x > 1 select x;foreach (var i in list){Console.Write("g({0}) ", i);} }}
public class MyEnumerable : IEnumerable<int>{public IEnumerator<int> GetEnumerator(){Console.Write("1 ");yield return 1;Console.Write("2 ");yield return 2;Console.Write("3 ");yield return 3;}
IEnumerator IEnumerable.GetEnumerator(){return GetEnumerator();}}
Co bude na vystupu?
<Window x:Class="WPFZkouska.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <StackPanel><TextBlock Margin="10" Text="neco1" /><TextBlock Margin="10" Text="neco2" /></StackPanel></Window>
Do prazdneho mista zadejte kod, tak aby oba TextBlocky mely cervene pozadi.
(Tady se omlouvam, ale ten kod neni uplne presny)
<Window x:Class="WPFZkouska.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <StackPanel><Rectangle x:Name="ctverec" Fill="Red" Width="50" Height="50"><Rectangle.Style><Style><Style.Triggers><Trigger Property="Rectangle.IsMouseOver" Value="true"><Setter Property="Rectangle.Fill" Value="Green" /></Trigger></Style.Triggers></Style></Rectangle.Style></Rectangle></StackPanel></Window>
Jakou barvu bude mit ctverec po spusteni programu?
Jakou barvu bude mit ctverec po najeti mysi do ctverce?
Jakou barvu bude mit ctverec pote co mys opusti ctverec?
public class MyClass{int a;
int b;
public int A{get { return a; }set{if (value > 0)throw new ArgumentException();
a = value;}}
public int B{get { return b; }set { b = value; }}}
Do prazdnych mist vyplnte kod, tak aby trida byla serializovatelna pomoci nejakeho formateru a aby pri deserializaci nevznikaly chyby.
CLI/C++
tu si prilis nepamatuju, tak nekdo doplnte!