Ejemplo n.º 1
0
 public TLocalChannel(TLocalChannel localChannel)
     : this()
 {
     Name        = localChannel.Name;
     StoragePath = localChannel.StoragePath;
     Channel     = new TChannel(localChannel.Channel);
 }
Ejemplo n.º 2
0
        public void Load(string storageName)
        {
            try {
                Trace.Indent();
                XDocument DocumentToRead;
                try {
                    DocumentToRead = XDocument.Load(Path.Combine(StoragePath, storageName));
                } catch (Exception ex) {
                    Trace.WriteLine(string.Format("Unable to read Channel \"{0}\" : {1} ", StorageName, ex.Message));
                    if (LoadCompleted != null)
                    {
                        LoadCompleted(this, EventArgs.Empty);
                    }
                    return;
                }

                Channel = new TChannel(DocumentToRead.Root.SafeReadElement("channel"));
                if (LoadCompleted != null)
                {
                    LoadCompleted(this, EventArgs.Empty);
                }
            } finally {
                Trace.Unindent();
            }
        }
Ejemplo n.º 3
0
        private void Channel_DownloadCompleted(object sender, ItemsDownloadedEventArgs e)
        {
            TChannel CurrentChannel = sender as TChannel;

            CurrentChannel.DownloadCompleted -= new EventHandler <ItemsDownloadedEventArgs>(Channel_DownloadCompleted);
            Save();
            if (DownloadCompleted != null)
            {
                ItemsDownloadedEventArgs Args = new ItemsDownloadedEventArgs(e.RawData, e.ResponseHeaders, e.Data);
                DownloadCompleted(this, Args);
            }
        }
Ejemplo n.º 4
0
 public TChannel(TChannel channel)
     : this()
 {
     Name            = channel.Name;
     Title           = channel.Title;
     Link            = new TUri(channel.Link);
     Description     = channel.Description;
     Category        = channel.Category;
     Language        = channel.Language;
     Copyright       = channel.Copyright;
     LastBuildDate   = channel.LastBuildDate;
     Picture         = new TChannelImage(channel.Picture);
     Items           = new TItemCollection(channel.Items);
     ChannelEncoding = channel.ChannelEncoding;
 }
Ejemplo n.º 5
0
 public TLocalChannel(TOpmlOutline opmlOutline)
     : this()
 {
     Name    = opmlOutline.Title;
     Channel = new TChannel(opmlOutline);
 }
Ejemplo n.º 6
0
 public TLocalChannel()
 {
     Name        = "";
     StoragePath = "";
     Channel     = new TChannel();
 }