File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,14 +119,28 @@ public void DumpPropsToFile(string path, object obj) {
119119 string value ;
120120
121121 foreach ( PropertyInfo pInfo in pInfos ) {
122- try { name = pInfo . Name ; } catch ( Exception ex ) { name = ex . Message ; }
123- try { value = pInfo . GetValue ( obj , null ) . ToString ( ) ; } catch ( Exception ex ) { value = ex . Message ; }
124- objprops += name + " = " + value + nuline ;
122+ name = pInfo . Name ;
123+
124+ try {
125+ value = pInfo . GetValue ( obj , null ) . ToString ( ) ;
126+ objprops += name + " = " + value + nuline ;
127+ } catch ( Exception ex ) {
128+ value = GetParams ( pInfo . GetIndexParameters ( ) ) ;
129+ objprops += name + ":" + nuline + value + nuline ;
130+ }
125131 }
126132
127133 File . AppendAllText ( path , objprops + nuline ) ;
128134 }
129135
136+ public string GetParams ( ParameterInfo [ ] paramsInfo ) {
137+ string result = "\t Length: " + paramsInfo . Length + "\r \n " ;
138+ foreach ( ParameterInfo paramInfo in paramsInfo ) {
139+ result += "\t " + paramInfo . ToString ( ) + "\r \n " ;
140+ }
141+ return result ;
142+ }
143+
130144 public void DeleteLog ( string path ) {
131145 path = ValidateRelativePath ( path + ".log" ) ;
132146 if ( path == null )
You can’t perform that action at this time.
0 commit comments