コード例 #1
0
 internal SnapChannel([NotNull] string channelName, bool current, [NotNull] SnapNugetFeed pushFeed, [NotNull] SnapFeed updateFeed)
 {
     Name       = channelName ?? throw new ArgumentNullException(nameof(channelName));
     PushFeed   = pushFeed ?? throw new ArgumentNullException(nameof(pushFeed));
     UpdateFeed = updateFeed ?? throw new ArgumentNullException(nameof(updateFeed));
     Current    = current;
 }
コード例 #2
0
 public SnapsNugetFeed([NotNull] SnapNugetFeed feed) : this(new SnapsNugetFeed
 {
     Name = feed.Name
 })
 {
     if (feed == null)
     {
         throw new ArgumentNullException(nameof(feed));
     }
 }
コード例 #3
0
 internal SnapNugetFeed([NotNull] SnapNugetFeed snapFeed)
 {
     if (snapFeed == null)
     {
         throw new ArgumentNullException(nameof(snapFeed));
     }
     Name            = snapFeed.Name;
     Source          = snapFeed.Source;
     Username        = snapFeed.Username;
     Password        = snapFeed.Password;
     ProtocolVersion = snapFeed.ProtocolVersion;
     ApiKey          = snapFeed.ApiKey;
 }
コード例 #4
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()}.")
            };
        }
コード例 #5
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())
            };
        }
コード例 #6
0
ファイル: SnapApp.cs プロジェクト: peters/snapx
        internal SnapChannel([NotNull] SnapChannel channel)
        {
            if (channel == null)
            {
                throw new ArgumentNullException(nameof(channel));
            }
            Name     = channel.Name;
            PushFeed = new SnapNugetFeed(channel.PushFeed);
            Current  = channel.Current;

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

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

            default:
                throw new NotSupportedException(channel.UpdateFeed?.GetType().ToString());
            }
        }