This repository was archived by the owner on Oct 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner Expand file tree Collapse file tree 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)
298298 void CreateField ( CodeMemberField newField )
299299 {
300300 // 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+ }
302307 var bodyRegion = field != null ? field . BodyRegion : initializeComponents . BodyRegion ;
303308 DocumentScript script = GetScript ( bodyRegion . FileName ) ;
304309 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)
5555 }
5656 return null ;
5757 }
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- }
6558
6659 public static bool BaseClassIsFormOrControl ( ITypeDefinition c )
6760 {
You can’t perform that action at this time.
0 commit comments