This file contains hidden or 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
| //WPF part | |
| <ItemsControl ItemsSource="{Binding companyList}"> | |
| <ItemsControl.ItemTemplate> | |
| <DataTemplate> | |
| <RadioButton Command="{Binding Path= DataContext.ChooseCompanyCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" CommandParameter="{Binding CompanyID}" GroupName="Company" Content="{Binding CompanyName}"/> | |
| </DataTemplate> | |
| </ItemsControl.ItemTemplate> | |
| </ItemsControl> | |
| //ViewModel |
This file contains hidden or 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
| void Method (int a = 0, int b = 0, int c = 0, int d = 0) { ... } | |
| Method (d:3); | |
| //a=0, b=0, c=0, d=3 |
This file contains hidden or 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
| static IEnumerable<int> Fibs (int fibCount) | |
| { | |
| for (int i = 0, prevFib = 1, curFib = 1; i < fibCount; i++) | |
| { | |
| yield return prevFib; | |
| int newFib = prevFib+curFib; | |
| prevFib = curFib; | |
| curFib = newFib; | |
| } | |
| } |
This file contains hidden or 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
| var actress = new { Name = "Rosario", Surname="Dawson", Age = 34 }; | |
| //OR | |
| int Age= 34; | |
| var actress = new { Name = "Rosario", Surname="Dawson", Age }; |
This file contains hidden or 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
| GOOGLE: intitle:"index.of" (mp3) BAND_NAME -html -htm -php -jsp | |
| BING: BAND_NAME contains:mp3 intitle:"index of" |
This file contains hidden or 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
| StreamReader reader = new StreamReader(PathToFile); | |
| while (!reader.EndOfStream) | |
| { | |
| string line = reader.ReadLine(); | |
| } |
This file contains hidden or 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
| INSERT INTO user(mail, adress) VALUES('someone@mail.net','Unknown'); | |
| select LAST_INSERT_ID(); |
This file contains hidden or 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
| DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") |
This file contains hidden or 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
| <DockPanel LastChildFill="True" Grid.Column="1" Grid.Row="1" Margin="0"> | |
| <Button ToolTip="Edit" DockPanel.Dock="Right" Width="Auto" Height="20" VerticalAlignment="Bottom" Content="Edit" Command="{Binding OpenTextEditorCommand}"/> | |
| <TextBox DockPanel.Dock="Left" Width="Auto" MinHeight="60" MaxHeight="100" Text="{Binding Model.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" HorizontalAlignment="Stretch" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" AcceptsReturn="True" ></TextBox> | |
| </DockPanel> |
This file contains hidden or 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
| window.Closing += (sender, args) => { | |
| if(Model.CanSave) | |
| if (MessageBox.Show("Save?", "Saving", MessageBoxButton.YesNo) == MessageBoxResult.Yes) | |
| { | |
| Model.Save(); | |
| } | |
| else | |
| { | |
| Model.Cancel(); | |
| } |