File tree Expand file tree Collapse file tree
CompressedFileViewer/PluginInfrastructure Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,15 +171,17 @@ private void _initNativeStruct()
171171 private void _readNativeStruct ( )
172172 {
173173 if ( _ptrSciTextRange != nint . Zero )
174- _sciTextRange = ( Sci_TextRange ) Marshal . PtrToStructure ( _ptrSciTextRange , typeof ( Sci_TextRange ) ) ! ;
174+ _sciTextRange = Marshal . PtrToStructure < Sci_TextRange > ( _ptrSciTextRange ) ! ;
175175 }
176176
177177 public void Dispose ( )
178178 {
179179 if ( ! _disposed )
180180 {
181- if ( _sciTextRange . lpstrText != nint . Zero ) Marshal . FreeHGlobal ( _sciTextRange . lpstrText ) ;
182- if ( _ptrSciTextRange != nint . Zero ) Marshal . FreeHGlobal ( _ptrSciTextRange ) ;
181+ if ( _sciTextRange . lpstrText != nint . Zero )
182+ Marshal . FreeHGlobal ( _sciTextRange . lpstrText ) ;
183+ if ( _ptrSciTextRange != nint . Zero )
184+ Marshal . FreeHGlobal ( _ptrSciTextRange ) ;
183185 _disposed = true ;
184186 }
185187 }
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public class FuncItems : IDisposable
5050 public FuncItems ( )
5151 {
5252 Items = [ ] ;
53- _sizeFuncItem = Marshal . SizeOf ( typeof ( FuncItem ) ) ;
53+ _sizeFuncItem = Marshal . SizeOf < FuncItem > ( ) ;
5454 _shortCutKeys = [ ] ;
5555 }
5656
Original file line number Diff line number Diff line change @@ -3027,7 +3027,7 @@ private void _initNativeStruct()
30273027 private void _readNativeStruct ( )
30283028 {
30293029 if ( _ptrSciTextToFind != nint . Zero )
3030- _sciTextToFind = ( Sci_TextToFind ) Marshal . PtrToStructure ( _ptrSciTextToFind , typeof ( Sci_TextToFind ) ) ! ;
3030+ _sciTextToFind = Marshal . PtrToStructure < Sci_TextToFind > ( _ptrSciTextToFind ) ! ;
30313031 }
30323032
30333033 private void _freeNativeString ( )
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public static nint GetName()
4040 [ UnmanagedCallersOnly ( EntryPoint = "beNotified" , CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
4141 public static void BeNotified ( nint notifyCode )
4242 {
43- ScNotification notification = ( ScNotification ) Marshal . PtrToStructure ( notifyCode , typeof ( ScNotification ) ) ! ;
43+ ScNotification notification = Marshal . PtrToStructure < ScNotification > ( notifyCode ) ! ;
4444 if ( notification . Header . Code == ( uint ) NppMsg . NPPN_TBMODIFICATION )
4545 {
4646 PluginBase . _funcItems . RefreshItems ( ) ;
You can’t perform that action at this time.
0 commit comments