Exemplo n.º 1
0
        public static void RunExample()
        {
            Console.WriteLine("Strategy Pattern:");
            var context = new StrategyContext();

            context.SetContextStrategy(new StrategyA());
            context.ContextInterface();
        }
Exemplo n.º 2
0
 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; }
 }