public static void RunExample() { Console.WriteLine("Strategy Pattern:"); var context = new StrategyContext(); context.SetContextStrategy(new StrategyA()); context.ContextInterface(); }
private void ListBox_MouseDoubleClick_1(object sender, MouseButtonEventArgs e) { try { string name = ((e.Source as ListBox).SelectedItems[0] as Label).Content.ToString(); if (!string.IsNullOrEmpty(name)) { StrategyContext ct = new StrategyContext(name); ct.ShowWind(); } } catch { throw; } }