Пример #1
0
        private static void Introduction2()
        {
            var html = @"<hello description=""i'm runtime-attribute"" yuyu=""fatty liver"">Runtime-Tag</hello>";
            var tag  = Meow.Load(html)
                       .Resolve <RuntimeTag>()
                       .Single();

            // hello
            var tagName = tag.TagName;

            // 'Runtime-Tag'
            var content = tag.Content;

            // 'i'm runtime-attribute'
            var description = tag.DynamicAttributes.Description;

            //Just for access attributes.
            dynamic attributes = tag;

            //'fatty liver'
            var yuyu = attributes.yuyu;

            Console.WriteLine(tagName);
            Console.WriteLine(content);
            Console.WriteLine(description);
            Console.WriteLine(yuyu);
        }
Пример #2
0
        private static void Introduction1()
        {
            var html =
                @"
<!Doctype html>
<html>
    <head>
        <title>I am Viyrex.</title>
    </head>
    <body>
        <p class=""introduction"">I'm Viyrex, A student from Taiwan.<br>My motto is 'No pain, no gain'.<br>If you want to contact me , <a href=""https://github.com/0x0001F36D"">Here</a> is my Github page. Have fun coding!
        </p>
    </body>
<html>
";

            var meow = Meow.Load(html);

            // 'I am Viyrex.'
            var title = meow.Resolve <Title>().Single().Content;

            // 'https://github.com/0x0001F36D'
            var github = meow.Resolve <A>().Single().Href;

            Console.WriteLine(title);
            Console.WriteLine(github);
        }
Пример #3
0
        static void Main(string[] args)
        {
            Meow meow = new Meow();
            Cat  Ani  = new Cat(meow);

            Ani.Meow();

            Bark bark = new Bark();
            Dog  Mel  = new Dog(bark);

            Mel.Bark();
        }
Пример #4
0
        public List <Meow> GetMockup()
        {
            var MyArray = new List <Meow>();
            var meow1   = new Meow()
            {
                Name = "แมวพิมพ์", Age = 60, Sex = "Female"
            };
            var meow2 = new Meow()
            {
                Name = "กังพิมพ์", Age = 30, Sex = "Male"
            };
            var meow3 = new Meow()
            {
                Name = "Sakamoto", Age = 20, Sex = "Male"
            };

            MyArray.Add(meow1);
            MyArray.Add(meow2);
            MyArray.Add(meow3);

            return(MyArray);
        }
Пример #5
0
        static void Main(string[] args)
        {
            Flight         flight   = new Flight();
            Run            run      = new Run();
            Swimming       swimming = new Swimming();
            Meow           meow     = new Meow();
            Сrack          crack    = new Сrack();
            Twitter        twitter  = new Twitter();
            List <IAnimal> list     = new List <IAnimal>();

            list.Add(new Cat <Run, Twitter>());
            list.Add(new Herring <Swimming, Swimming>());
            list.Add(new Sparrow <Run, Twitter>());
            foreach (IAnimal rec in list)
            {
                try
                {
                    rec.Motion();
                }
                catch (BeingNotProperty ex)
                {
                    log = LogManager.GetCurrentClassLogger();
                    log.Error("У данного существа нет такого свойства!" + rec.GetType().ToString(), ex);
                }

                try
                {
                    rec.Vocalize();
                }
                catch (BeingNotProperty ex)
                {
                    log = LogManager.GetCurrentClassLogger();
                    log.Error("у данного существа нет такого свойства!" + rec.GetType().ToString(), ex);
                }
            }

            Console.ReadKey();
        }
Пример #6
0
        static void Main()
        {
            Console.WriteLine("Seasons\n");
            for (Seasons s = Seasons.Season; s <= Seasons.Season3; s++)
            {
                Console.WriteLine(s);
            }
            Console.WriteLine("BRAT\n");

            for (Brat b = Brat.brat; b <= Brat.brat4; b++)
            {
                Console.WriteLine(b);
            }

            for (Meow meow = Meow.meow; meow <= Meow.Meow; meow++)
            {
                Console.WriteLine(meow);
            }

            for (WOW WOW = WOW.WOW; WOW <= WOW.W0W; WOW++)
            {
                Console.WriteLine(WOW);
            }

            for (Groups group = Groups.PKS115; group <= Groups.PKS315; group++)
            {
                Console.WriteLine(group);
            }

            Test MyStruct_obj = new Test();

            MyStruct_obj.a = 2;
            MyStruct_obj.p = 2.5;
            MyStruct_obj.b = 5;

            MyStruct_obj.Show();
        }
Пример #7
0
 void Start()
 {
     speakBehavior = new Meow();
     moveBehavior  = new Walk();
 }
Пример #8
0
 public Cat()
 {
     Sound = new Meow();
 }