Exemplo n.º 1
0
 public SnapsNugetFeed([NotNull] SnapsNugetFeed feed)
 {
     if (feed == null)
     {
         throw new ArgumentNullException(nameof(feed));
     }
     Name = feed.Name;
 }
Exemplo n.º 2
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.º 3
0
        internal SnapsChannel([JetBrains.Annotations.NotNull] SnapChannel snapChannel)
        {
            if (snapChannel == null)
            {
                throw new ArgumentNullException(nameof(snapChannel));
            }
            Name     = snapChannel.Name;
            PushFeed = new SnapsNugetFeed(snapChannel.PushFeed);

            switch (snapChannel.UpdateFeed)
            {
            case SnapNugetFeed snapNugetFeed:
                UpdateFeed = new SnapsNugetFeed(snapNugetFeed);
                break;

            case SnapHttpFeed snapHttpFeed:
                UpdateFeed = new SnapsHttpFeed(snapHttpFeed);
                break;

            default:
                throw new NotSupportedException($"Unknown update feed type: {snapChannel.UpdateFeed?.GetType()}.");
            }
        }