This repository was archived by the owner on Oct 16, 2020. It is now read-only.
File tree 2 files changed +6
-8
lines changed
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,12 @@ string GenerateField(CodeMemberField newField)
298
298
void CreateField ( CodeMemberField newField )
299
299
{
300
300
// insert new field below the last field or InitializeComponents()
301
- var field = FormsDesignerSecondaryDisplayBinding . GetLastField ( formClass , initializeComponents . BodyRegion . FileName ) ;
301
+ IField field = null ;
302
+ if ( formClass != null ) {
303
+ field = formClass . Fields . LastOrDefault ( f => string . Equals ( f . Region . FileName ,
304
+ initializeComponents . Region . FileName ,
305
+ StringComparison . OrdinalIgnoreCase ) ) ;
306
+ }
302
307
var bodyRegion = field != null ? field . BodyRegion : initializeComponents . BodyRegion ;
303
308
DocumentScript script = GetScript ( bodyRegion . FileName ) ;
304
309
string newline = DocumentUtilities . GetLineTerminator ( script . OriginalDocument , bodyRegion . BeginLine ) ;
Original file line number Diff line number Diff line change @@ -55,13 +55,6 @@ public static IMethod GetInitializeComponents(ITypeDefinition c)
55
55
}
56
56
return null ;
57
57
}
58
-
59
- public static IField GetLastField ( ITypeDefinition c , string fileNmae )
60
- {
61
- if ( c == null )
62
- return null ;
63
- return c . Fields . LastOrDefault ( field => field . BodyRegion . FileName == fileNmae ) ;
64
- }
65
58
66
59
public static bool BaseClassIsFormOrControl ( ITypeDefinition c )
67
60
{
You can’t perform that action at this time.
0 commit comments