コード例 #1
0
 private void BookWasRemoved(object o, LibEventArgs args)
 {
     if (_preferedGenre == Genre.Fantastic && args.Genre != Genre.Fantastic)
     {
         Console.WriteLine("{0}: I'm not going to read \"{1}\"", _name, args.Title);
     }
 }
コード例 #2
0
ファイル: Student.cs プロジェクト: dmitriy1024/HW_Events
 private void BookWasRemoved(object o, LibEventArgs args)
 {
     if(_preferedGenre == Genre.Fantastic && args.Genre != Genre.Fantastic)
     {
         Console.WriteLine("{0}: I'm not going to read \"{1}\"", _name, args.Title);
     }
 }
コード例 #3
0
ファイル: Library.cs プロジェクト: dmitriy1024/HW_Events
        protected virtual void OnBookRemoved(LibEventArgs args)
        {
            EventHandler<LibEventArgs> tmp = Volatile.Read(ref BookRemoved);

            if (tmp != null)
            {
                tmp(this, args);
            }
        }
コード例 #4
0
ファイル: Library.cs プロジェクト: dmitriy1024/HW_Events
        protected virtual void OnBookRemoved(LibEventArgs args)
        {
            EventHandler <LibEventArgs> tmp = Volatile.Read(ref BookRemoved);

            if (tmp != null)
            {
                tmp(this, args);
            }
        }
コード例 #5
0
        private void NewBook(object o, LibEventArgs args)
        {
            if (args.Genre == Genre.Computer && _preferedGenre == Genre.Computer)
            {
                Console.WriteLine("{0}: I'm going to go to the library. Trere is a new computer book!", _name);
            }

            if (args.Genre == Genre.Fantastic && _preferedGenre == Genre.Fantastic)
            {
                Console.WriteLine("{0}: I want a home delivery of a new fantastic book!", _name);
            }
        }
コード例 #6
0
ファイル: Student.cs プロジェクト: dmitriy1024/HW_Events
        private void NewBook(object o, LibEventArgs args)
        {
            if(args.Genre == Genre.Computer && _preferedGenre == Genre.Computer)
            {
                Console.WriteLine("{0}: I'm going to go to the library. Trere is a new computer book!", _name);
            }

            if(args.Genre == Genre.Fantastic && _preferedGenre == Genre.Fantastic)
            {
                Console.WriteLine("{0}: I want a home delivery of a new fantastic book!", _name);
            }
        }