Exemplo n.º 1
0
 protected virtual void OnVideoEncoded(Video video)
 {
     //VideoEncoded?.Invoke(this, EventArgs.Empty); // VideoEncoded? kontrolü subscrible olup olmadığını kontror eder.
     VideoEncoded?.Invoke(this, new VideoEventArgs {
         Video = video
     });
 }
Exemplo n.º 2
0
 protected virtual void OnVideoEncoded(Video video)
 {
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });
 }
Exemplo n.º 3
0
 protected virtual void OnVideoEncoded(Video video) //event publisher method
 {
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         video = video
     });
 }
Exemplo n.º 4
0
 protected virtual void VideoEncodingCompleted(Video _video)
 {
     //wait till the implemenation is done
     VideoEncoded?.Invoke(this, new VideoEncodedEventArgs()
     {
         MyVideo = _video
     });
 }
Exemplo n.º 5
0
 protected virtual void OnVideoEncoded(Video video)
 {
     // sprawdźmy czy ktoś subskrybuje event!
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });                                                               // source + dodatkowe argumenty
 }
Exemplo n.º 6
0
 //to raise an event we need to create a method that is responsible for it
 protected virtual void OnVideoEncoded(Video video)
 {
     //job of this method would be to notify all the subscribers
     // if there are subs, then VideoEncoded will not be null
     VideoEncoded?.Invoke(this, new VideoEventArgs {
         video = video
     });
 }
Exemplo n.º 7
0
 protected virtual void OnVideoEncoded(Video video)
 {
     //if (VideoEncoded != null) same as this
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });
 }
Exemplo n.º 8
0
        protected virtual void OnVideoEncoded(Video video)
        {
            //VideoEncoded?.Invoke(this, EventArgs.Empty);

            VideoEncoded?.Invoke(this, new VideoEventArgs {
                Video = video
            });
        }
 // convention eventpublisher - protected, virtual, void , name - On+NameOfAnEvent
 protected virtual void OnVideoEncoded(Video video)
 {
     // pointer to the method.
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });
 }
Exemplo n.º 10
0
 protected virtual void OnVideoEncoded(Video video)
 {
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });
     // if (VideoEncoded != null) VideoEncoded(this, new VideoEventArgs() {Video = video});
     // above two lines are the same
 }
Exemplo n.º 11
0
 // 3
 protected virtual void OnVideoEncoded(Video video) // 3- Raise the event
 {
     //if(VideoEncoded != null) // check if there are subscribers (event handlers)
     //    VideoEncoded(this, EventArgs.Empty);
     // OR
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });
 }
Exemplo n.º 12
0
        protected virtual void OnVideoEncoded(Video video)
        {
            //if the list of subscribers is not empty (null) then notify the subscribers
            //VideoEncoded?.Invoke(this, EventArgs.Empty);

            VideoEncoded?.Invoke(this, new VideoEventArgs()
            {
                Video = video
            });
        }
Exemplo n.º 13
0
 protected virtual void OnVideoCoded(Video video)
 {
     if (VideoEncoded != null)
     {
         VideoEncoded.Invoke(this, new VideoEventArgs()
         {
             Video = video
         });
     }
 }
Exemplo n.º 14
0
 //step 3. Raise and Event, so this method is responsible to raise the event
 // as per the .net naming conventions the event handler method should be protected, virtual, void and should begin wiht On
 //protected  virtual  void OnVideoEncoded()
 protected virtual void OnVideoEncoded(Video video)
 {
     //if(VideoEncoded != null) VideoEncoded(this,EventArgs.Empty) --OldWay
     //VideoEncoded?.Invoke(this, EventArgs.Empty);//this means the current class is the source of publishing the event
     //Sending Custom Data
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         video = video
     });                                                                //
 }
Exemplo n.º 15
0
 protected virtual void OnVideoEncoded(Video video)
 {
     /*
      * if (VideoEncoded != null)
      *  VideoEncoded(this, EventArgs.Empty);
      */
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });
 }
Exemplo n.º 16
0
        // 3- Raise the event
        protected virtual void OnVideoEncoded(Video video)
        {
            //if ( VideoEncoded != null )
            //    VideoEncoded(this, EventArgs.Empty);

            // Refactored into this
            VideoEncoded?.Invoke(this, new VideoEventArgs()
            {
                Video = video
            });
        }
Exemplo n.º 17
0
 protected virtual void OnVideoEncoded(Video video)
 {
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         Video = video
     });                                                                 //same as following lines
     //if(VideoEncoded != null)
     //{
     //    VideoEncoded(this, VideoEventArgs.Empty);
     //}
 }
Exemplo n.º 18
0
        public void EncodeVideo(Video video)
        {
            Video encryptedVideo = new Video();

            encryptedVideo.Artist = video.Title;
            encryptedVideo.Title  = video.Artist;

            //Simulating the encoding Logic Video
            Thread.Sleep(3000);

            VideoEncoded?.Invoke(video);
        }
Exemplo n.º 19
0
 protected virtual void OnVideoEncoded(Video v)
 {
     // The old way
     //if (VideoEncoded != null)
     //{
     //    VideoEncoded(this, new VideoEventArgs() { video = v });
     //}
     VideoEncoded?.Invoke(this, new VideoEventArgs()
     {
         video = v
     });
 }
Exemplo n.º 20
0
        protected virtual void OnVideoEncoded(Video video)
        {
            //if (VideoEncoded != null)
            //{
            //    VideoEncoded(this, EventArgs.Empty);
            //}
            var vEvents = new VideoEventArgs {
                Clip = video
            };

            VideoEncoded?.Invoke(this, vEvents); // see: http://bit.ly/2ujCs1F
        }
Exemplo n.º 21
0
        }                                                  // raising the event here

        protected virtual void OnVideoEncoded(Video video) // this method invoke the event
        {
            //if (VideoEncoded != null)  // check to see if there are any subscribers to this event(VideoEncoded)
            //    VideoEncoded(this,EventArgs.Empty); // if not null than call event

            //VideoEncoded?.Invoke(this, EventArgs.Empty);
            // videoEncoded behind the scnene is a list of pointers to diff methods

            VideoEncoded?.Invoke(this, new VideoEventArgs()
            {
                Video = video
            });                                                                 // reference to the video
        }
Exemplo n.º 22
0
        // 2 - On[what-happend?]
        public void OnVideoEncoded(Video video)
        {
            //VideoEventArgs { Video = video }
            // shortcut for:
            //VideoEventArgs v = new VideoEventArgs();
            //v.Video = video;

            if (VideoEncoded != null)
            {
                VideoEncoded.Invoke(this, new VideoEventArgs {
                    Video = video
                });
            }
        }
Exemplo n.º 23
0
        protected virtual void OnVideoEncoded(Video video)
        {
            VideoEncoded?.Invoke(this, new VideoEventArgs()
            {
                Video = video
            });

            // Same Code Below

            /* if (VideoEncoded != null)
             * {
             *  VideoEncoded(this, EventArgs.Empty);
             * }
             */
        }
Exemplo n.º 24
0
        // In .NET the convention is that events sould be:
        // Protected
        // Virtual
        // Void
        // And always append "On" + Name of event
        protected virtual void OnVideoEncoded(Video video)
        {
            // This way is just fine but it can be shortened by using the nullable char (?)

            /*
             * if (VideoEncoded != null)
             *   {
             *       VideoEncoded.Invoke(this, EventArgs.Empty);
             *   }
             */
            // Here we used the nullable keyword (?)
            VideoEncoded?.Invoke(this, new VideoEventArgs()
            {
                Video = video
            });
        }
Exemplo n.º 25
0
        // This is the method that raises the event
        // Will notify all subscribers of this event
        protected virtual void OnVideoEncoded(Video video)
        {
            // the source of this event, or the publisher of this event, is
            // this class / object. So we pass "this" as the first argument
            // Exemplo abaixo usando EventArgs com invoke
            // VideoEncoded?.Invoke(this, EventArgs.Empty);

            // Exemplo abaixo usando EventArgs com um if
            // if (VideoEncoded != null)
            //   VideoEncoded(this, EventArgs.Empty);,

            // Exemplo abaixo passando um objeto de Video como parametroa
            VideoEncoded?.Invoke(this, new VideoEventArgs()
            {
                Video = video
            });
        }
Exemplo n.º 26
0
 protected virtual void OnVideoEncoded(string title)
 {
     VideoEncoded?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 27
0
 /// <summary>
 /// 3- To raise an event, we need a method that is responsible for that
 /// Acc. to .NET convention, your event publisher methods should be protected, virtual and void (also it doesn't make any sense to keep this method in public interface)
 /// Naming convention => Start with On + Name of the event
 /// </summary>
 protected virtual void OnVideoEncoded()
 {
     // First check if there are any subscribers in this event
     VideoEncoded?.Invoke(this, EventArgs.Empty); //Short for if(VideoEncoded != null) { VideoEncoded(this, EventArgs.Empty)
 }
Exemplo n.º 28
0
 public virtual void OnVideoEncoded(IVideo video)
 {
     VideoEncoded?.Invoke(this, new VideoEventArgs {
         Video = video
     });
 }
Exemplo n.º 29
0
 protected virtual void OnVideoEncoded(Video video)
 {
     VideoEncoded?.Invoke(video);
 }
Exemplo n.º 30
0
 private void OnVideoEncoded(RunDataEventArgs data)
 {
     VideoEncoded?.Invoke(this, data);
 }