@@ -29,6 +29,7 @@ public string DefaultIndex
2929 public bool UsesPrettyResponses { get ; private set ; }
3030
3131 public Func < Type , string > DefaultTypeNameInferrer { get ; private set ; }
32+ public Action < ConnectionStatus > ConnectionStatusHandler { get ; private set ; }
3233 public FluentDictionary < Type , string > DefaultIndices { get ; private set ; }
3334 public FluentDictionary < Type , string > DefaultTypeNames { get ; private set ; }
3435 public NameValueCollection QueryStringParameters { get ; private set ; }
@@ -49,6 +50,7 @@ public ConnectionSettings(Uri uri, NameValueCollection queryStringParamaters)
4950 this . DefaultTypeNameInferrer = this . LowerCaseAndPluralizeTypeNameInferrer ;
5051 this . DefaultIndices = new FluentDictionary < Type , string > ( ) ;
5152 this . DefaultTypeNames = new FluentDictionary < Type , string > ( ) ;
53+ this . ConnectionStatusHandler = this . ConnectionStatusDefaultHandler ;
5254 this . QueryStringParameters = queryStringParamaters ;
5355 }
5456
@@ -119,13 +121,25 @@ private string LowerCaseAndPluralizeTypeNameInferrer(Type type)
119121 return Inflector . MakePlural ( type . Name ) . ToLower ( ) ;
120122 }
121123
124+ private void ConnectionStatusDefaultHandler ( ConnectionStatus status )
125+ {
126+ return ;
127+ }
128+
122129 public ConnectionSettings SetDefaultTypeNameInferrer ( Func < Type , string > defaultTypeNameInferrer )
123130 {
124131 defaultTypeNameInferrer . ThrowIfNull ( "defaultTypeNameInferrer" ) ;
125132 this . DefaultTypeNameInferrer = defaultTypeNameInferrer ;
126133 return this ;
127134 }
128135
136+ public ConnectionSettings SetConnectionStatusHandler ( Action < ConnectionStatus > handler )
137+ {
138+ handler . ThrowIfNull ( "handler" ) ;
139+ this . ConnectionStatusHandler = handler ;
140+ return this ;
141+ }
142+
129143 public ConnectionSettings MapDefaultTypeIndices ( Action < FluentDictionary < Type , string > > mappingSelector )
130144 {
131145 mappingSelector . ThrowIfNull ( "mappingSelector" ) ;
0 commit comments