コード例 #1
0
        static void Main(string[] args)
        {
            MamaSearcher mamaSearcher = new MamaSearcher();

            mamaSearcher.Subscribe("abc", ShowPatternInfo);
            mamaSearcher.PerformSearch("oooabc");
        }
コード例 #2
0
        static void Main(string[] args)
        {
            MamaSearcher mamaSearcher = new MamaSearcher();

            mamaSearcher.Subscribe("A", APattern);
            mamaSearcher.Subscribe("A", AAnotherPattern);
            mamaSearcher.PerformSearch("AB");
        }
コード例 #3
0
        static void Main(string[] args)
        {
            MamaSearcher mamaSearcher = new MamaSearcher();

            mamaSearcher.Subscribe("l", PrintArgs);
            mamaSearcher.Subscribe("r", PrintArgs);

            mamaSearcher.PerformSearch("lior");
        }
コード例 #4
0
        static void Main(string[] args)
        {
            Action <int, string> a  = ActionToPerform;
            MamaSearcher         ms = new MamaSearcher();

            ms.Subscribe("a", a);
            ms.Subscribe("b", a);
            ms.PerformSearch("kjhdb");
        }
コード例 #5
0
        static void Main(string[] args)
        {
            MamaSearcher ms = new MamaSearcher();

            ms.Subscribe("abc", ActionsToPerform.PrintIndexAtContent);
            ms.Subscribe("yuval", ActionsToPerform.PrintIndexAtContent);
            ms.Subscribe("assa", ActionsToPerform.PrintIndexAtContent);
            ms.Subscribe("amit", ActionsToPerform.PrintIndexAtContent);
            ms.PerformSearch("amitassa");
        }
コード例 #6
0
        static void Main(string[] args)
        {
            Action <int, string> FirstAction  = Output;
            Action <int, string> SecondAction = MagicFound;

            Dictionary <string, Action <int, string> > stock = new Dictionary <string, Action <int, string> >()
            {
                { "yasha", SecondAction }, { "b", FirstAction }
            };

            MamaSearcher mamaSearcher = new MamaSearcher(stock);

            mamaSearcher.PerformSearch("my name is yasha");
            mamaSearcher.PerformSearch("my name is bob");
        }