Ejemplo n.º 1
0
        public TVOperations()
        {
            var catalog = new AggregateCatalog();

            catalog.Catalogs.Add(new DirectoryCatalog(Properties.Settings.Default.PluginsPath));

            //Create the CompositionContainer with the parts in the catalog
            container = new CompositionContainer(catalog);


            //Fill the imports of this object
            try
            {
                container.ComposeParts(this);
                pirateChannels = new IPirateChannel[channels.Length];
                for (int i = 0; i < channels.Length; i++)
                {
                    ImageBrush c = new ImageBrush();
                    c.ImageSource = new BitmapImage(new Uri(@"Images/" + channels[i].ChannelTV, UriKind.Relative));
                    IPirateChannel pc = new PirateChannel();
                    pc.Channel = c;
                    pc.Logo    = channels[i].ChannelLogo;

                    pirateChannels[i] = pc;
                }
            }
            catch (CompositionException compositionException)
            {
                Console.WriteLine(compositionException.ToString());
            }
        }
Ejemplo n.º 2
0
        public TVOperations()
        {
            IChannel[] channels = new IChannel[6] {
                null,
                new NBCChannel(),
                new FoxBusinessChannel(),
                new FoxSportsChannel(),
                new DiscoveryChannel(),
                new CartoonNetworkChannel()
            };
            pirateChannels = new IPirateChannel[6];
            for (int i = 1; i < channels.Length; i++)
            {
                ImageBrush c = new ImageBrush();
                c.ImageSource = new BitmapImage(new Uri(@"Images/" + channels[i].ChannelTV, UriKind.Relative));
                IPirateChannel pc = new PirateChannel();
                pc.Channel = c;
                pc.Logo    = channels[i].ChannelLogo;

                pirateChannels[i] = pc;
            }
        }