Exemplo n.º 1
0
 internal SnapHttpFeed([NotNull] SnapHttpFeed httpFeed)
 {
     if (httpFeed == null)
     {
         throw new ArgumentNullException(nameof(httpFeed));
     }
     Source = httpFeed.Source;
 }
Exemplo n.º 2
0
 public SnapsHttpFeed([NotNull] SnapHttpFeed feed) : this(new SnapsHttpFeed
 {
     Source = feed.Source
 })
 {
     if (feed == null)
     {
         throw new ArgumentNullException(nameof(feed));
     }
 }
Exemplo n.º 3
0
        internal SnapsChannel([NotNull] SnapChannel snapChannel)
        {
            if (snapChannel == null)
            {
                throw new ArgumentNullException(nameof(snapChannel));
            }
            Name     = snapChannel.Name;
            PushFeed = new SnapsNugetFeed(snapChannel.PushFeed);

            UpdateFeed = snapChannel.UpdateFeed switch
            {
                SnapNugetFeed snapNugetFeed => new SnapsNugetFeed(snapNugetFeed),
                SnapHttpFeed snapHttpFeed => new SnapsHttpFeed(snapHttpFeed),
                _ => throw new NotSupportedException($"Unknown update feed type: {snapChannel.UpdateFeed?.GetType()}.")
            };
        }
Exemplo n.º 4
0
        internal SnapChannel([NotNull] SnapChannel channel)
        {
            if (channel == null)
            {
                throw new ArgumentNullException(nameof(channel));
            }
            Name     = channel.Name;
            PushFeed = new SnapNugetFeed(channel.PushFeed);
            Current  = channel.Current;

            UpdateFeed = channel.UpdateFeed switch
            {
                SnapNugetFeed snapNugetFeed => new SnapNugetFeed(snapNugetFeed),
                SnapHttpFeed snapHttpFeed => new SnapHttpFeed(snapHttpFeed),
                _ => throw new NotSupportedException(channel.UpdateFeed?.GetType().ToString())
            };
        }