Exemple #1
0
        /// <summary>
        /// Creates a new instance of the source tracker.
        /// </summary>
        /// <param name="settings">Source settings object describing the source configuration</param>
        /// <returns>Newly created source instance</returns>
        public ISource Create( SourceSettings settings )
        {
            ISource     source = CreateSource( settings );

            if( NoUpdates )
            {
                source = new ReadOnlySourceDecorator( source );
            }

            if( LogLevel != SyncLogLevel.None )
            {
                LoggingSourceConfig     loggingConfig = new LoggingSourceConfig();

                loggingConfig.IsInputLogged = ( LogLevel >= SyncLogLevel.Verbose );
                loggingConfig.IsOutputLogged = ( LogLevel >= SyncLogLevel.PrintActions );

                source = new LoggingSourceDecorator( source,
                                                     Console.Out,
                                                     loggingConfig );
            }

            return source;
        }
Exemple #2
0
        private ISource CreateSource( SourceSettings settings )
        {
            Type settingsType = settings.GetType();

            if( settingsType == typeof( GitHub.SourceSettings ) )
            {
                return new GitHub.Source( (GitHub.SourceSettings)settings );
            }
            else if( settingsType == typeof( Trello.SourceSettings ) )
            {
                return new Trello.SourceNormalizer(
                            new Trello.Source( (Trello.SourceSettings)settings ) );
            }
            else
            {
                throw new ApplicationException( string.Format(
                    "Unknown settings type: {0}", settingsType.Name ) );
            }
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the HttpRequest
 /// </summary>
 /// <param name="settings">Settings of the source to which the request is to be sent</param>
 public HttpRequest( SourceSettings settings )
 {
     this.SourceSettings = settings;
 }
Exemple #4
0
 /// <summary>
 /// Creates a new instance of the SourceSettings class using another instance as the source
 /// of values.
 /// </summary>
 /// <param name="other">Existing instance to be used as the source</param>
 public SourceSettings( SourceSettings other )
 {
     this.GetAllIncludesClosedIssues = other.GetAllIncludesClosedIssues;
 }