@@ -29,6 +29,7 @@ public string DefaultIndex
29
29
public bool UsesPrettyResponses { get ; private set ; }
30
30
31
31
public Func < Type , string > DefaultTypeNameInferrer { get ; private set ; }
32
+ public Action < ConnectionStatus > ConnectionStatusHandler { get ; private set ; }
32
33
public FluentDictionary < Type , string > DefaultIndices { get ; private set ; }
33
34
public FluentDictionary < Type , string > DefaultTypeNames { get ; private set ; }
34
35
public NameValueCollection QueryStringParameters { get ; private set ; }
@@ -49,6 +50,7 @@ public ConnectionSettings(Uri uri, NameValueCollection queryStringParamaters)
49
50
this . DefaultTypeNameInferrer = this . LowerCaseAndPluralizeTypeNameInferrer ;
50
51
this . DefaultIndices = new FluentDictionary < Type , string > ( ) ;
51
52
this . DefaultTypeNames = new FluentDictionary < Type , string > ( ) ;
53
+ this . ConnectionStatusHandler = this . ConnectionStatusDefaultHandler ;
52
54
this . QueryStringParameters = queryStringParamaters ;
53
55
}
54
56
@@ -119,13 +121,25 @@ private string LowerCaseAndPluralizeTypeNameInferrer(Type type)
119
121
return Inflector . MakePlural ( type . Name ) . ToLower ( ) ;
120
122
}
121
123
124
+ private void ConnectionStatusDefaultHandler ( ConnectionStatus status )
125
+ {
126
+ return ;
127
+ }
128
+
122
129
public ConnectionSettings SetDefaultTypeNameInferrer ( Func < Type , string > defaultTypeNameInferrer )
123
130
{
124
131
defaultTypeNameInferrer . ThrowIfNull ( "defaultTypeNameInferrer" ) ;
125
132
this . DefaultTypeNameInferrer = defaultTypeNameInferrer ;
126
133
return this ;
127
134
}
128
135
136
+ public ConnectionSettings SetConnectionStatusHandler ( Action < ConnectionStatus > handler )
137
+ {
138
+ handler . ThrowIfNull ( "handler" ) ;
139
+ this . ConnectionStatusHandler = handler ;
140
+ return this ;
141
+ }
142
+
129
143
public ConnectionSettings MapDefaultTypeIndices ( Action < FluentDictionary < Type , string > > mappingSelector )
130
144
{
131
145
mappingSelector . ThrowIfNull ( "mappingSelector" ) ;
0 commit comments