Пример #1
0
        public void Update(AMedia media)
        {
            var mi = _mediaLibrary.Find(m => m.title == media.title);

            mi = media;
            Save();
        }
Пример #2
0
        public XDoc Media(
            [DekiExtParam("media uri")] XUri source,
            [DekiExtParam("media width (default: player dependent)", true)] float?width,
            [DekiExtParam("media height (default: player dependent)", true)] float?height,
            [DekiExtParam("auto-start media on load (default: false)", true)] bool?start
            )
        {
            // determine the media type
            AMedia media = null;

            media = media ?? YouTubeVideo.New(source);
            media = media ?? GoogleVideo.New(source);
            media = media ?? ViddlerVideo.New(source);
            media = media ?? VeohVideo.New(source);
            media = media ?? UStreamVideo.New(source);
            media = media ?? KalturaVideo.New(source, Config);
            media = media ?? WindowsMedia.New(source);
            media = media ?? UnknownMedia.New(source);
            if (media != null)
            {
                media.Width    = width;
                media.Height   = height;
                media.AutoPlay = start ?? false;
                return(media.AsXDoc());
            }
            return(XDoc.Empty);
        }
Пример #3
0
 public bool Execute(ButtonDelegate button, AMedia media)
 {
     media.ResultEvent += ResultHandler;
     //media.ResultEvent += ResultHandlerJames;
     return(button());
     //System.Console.WriteLine(button());
     //button();h
 }
Пример #4
0
        public void Execute(ButtonDelegate button, AMedia media)
        {
            // Console.WriteLine(media);
            // button();
            // System.Console.WriteLine(button());

            media.ResultEvent += ResultHandler;
            button();
        }
 public void ResultHandler(AMedia media)
 {
     System.Console.WriteLine("{0} is playing...", media.Title);
 }
 public bool Execute(ButtonDelegate button, AMedia media)
 {
     media.ResultEvent += ResultHandler; //Here, we invoke the event
     return(button());
 }
Пример #7
0
 public void Execute(string command, AMedia media)
 {
     Console.WriteLine(media);
 }
Пример #8
0
 public bool Execute(ButtonDelegate button, AMedia media)
 {
     media.ResultEvent += ResultHandler;
     return(button());
 }
Пример #9
0
 public void Execute(ButtonDelegate button, AMedia media)
 {
     media.ResultEvent += ResultHandler; //this works because the signature of ResultHandler fits the requirements of ResultEvent (returns nothing and takes AMedia as argument)
     button();
 }
Пример #10
0
 public void Stop(AMedia m)
 {
     System.Console.WriteLine("Stopping '{0}'", m.Title);
 }
Пример #11
0
 public void ResultHandlerJames(AMedia media)
 {
     System.Console.WriteLine("Count = {0}", count);
     count++;
 }
Пример #12
0
        public static void openImage(string filePath)
        {
            AMedia media = MediaGenerator.getInstanceOf(MediaType.IMAGE);

            media.Play(filePath);
        }
Пример #13
0
        public static void playVideo(string filePath)
        {
            AMedia media = MediaGenerator.getInstanceOf(MediaType.VIDEO);

            media.Play(filePath);
        }
Пример #14
0
        public static void playMusic(string filePath)
        {
            AMedia media = MediaGenerator.getInstanceOf(MediaType.MUSIC);

            media.Play(filePath);
        }
Пример #15
0
 public void Play(AMedia m)
 {
     System.Console.WriteLine("Playing '{0}'", m.Title);
 }
Пример #16
0
 public void Add(AMedia media)
 {
     _mediaLibrary.Add(media);
 }
Пример #17
0
 public void Execute(ButtonDelegate button, AMedia media)
 {
     media.ResultEvent += ResultHandler;
     button();
 }
Пример #18
0
 public void Delete(AMedia media)
 {
     var mi = _mediaLibrary.Find(m => m.Title == media.Title);
 }