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
// Listing 11-1. Creating a RandomTicker that defines, publishes, and triggers an event | |
open System | |
open System.Timers | |
type RandomTicker(approxInterval) = | |
let timer = new Timer() | |
let rnd = new System.Random(99) | |
let tickEvent = new Event<float> () | |
let chooseInterval() : float = | |
approxInterval + approxInterval / 4.0 - float(rnd.Next((int)(approxInterval / 2.0))) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ConsoleApplication2 | |
{ | |
class SomeStringObject | |
{ | |
public string S { get; private set; } | |
public SomeStringObject(string s) { this.S = s; } |
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
<MultiDataTrigger.Conditions> | |
<Condition Binding="{Binding XXX}" Value="YYY"/> | |
<!-- Doesn't work --> | |
<Condition Binding="{Binding DataContext.ZZZ, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBox}}" Value="KKK"/> | |
</MultiDataTrigger.Conditions> | |
<MultiDataTrigger.Conditions> | |
<!-- works --> | |
<Condition Binding="{Binding DataContext.ZZZ, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBox}}" Value="KKK"/> | |
</MultiDataTrigger.Conditions> |
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
<Window x:Class="VMTreeBuilder.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"> | |
<Grid> | |
<TreeView x:Name="tv" ItemsSource="{Binding}"> | |
<TreeView.ItemTemplate> | |
<HierarchicalDataTemplate ItemsSource="{Binding Children}"> | |
<TextBlock Text="{Binding Value}"/> | |
</HierarchicalDataTemplate> |
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
foo () | |
{ | |
dirs=`find . -type d -name "*$1*"` | |
files=`find . -type f -name "*$1*"` | |
echo "Dirs:" | |
echo ${dirs} | |
echo "Files:" | |
echo ${files} | |
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
using System.Linq; | |
using System.Windows; | |
using System.Windows.Documents; | |
using System.Windows.Media; | |
namespace WpfApplication1 | |
{ | |
public class RepetitionAdorner : Adorner | |
{ | |
private int count; |