예제 #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());
            }
        }