@@ -38,33 +38,24 @@ protected override JavaScriptValue Main(JavaScriptValue callee, bool isConstruct
38
38
class JSBrowserWindowInstance : AbstractJSModule
39
39
{
40
40
private JToken options ;
41
- // I don't really like putting this here, I think we should probably have a class that contains all our constants
42
- private const int defaultWindowWidth = 800 , defaultWindowHeight = 600 ;
43
41
private Dictionary < string , List < Tuple < JavaScriptValue , JavaScriptValue > > > listeners = new Dictionary < string , List < Tuple < JavaScriptValue , JavaScriptValue > > > ( ) ;
44
42
45
43
public JSBrowserWindowInstance ( JToken options ) : base ( "BrowserWindowInstance" )
46
44
{
45
+ const int defaultWindowWidth = 800 , defaultWindowHeight = 600 ;
46
+ int width = 0 , height = 0 ;
47
47
this . options = options ;
48
48
49
49
AttachMethod ( LoadURL , "loadURL" ) ;
50
50
AttachMethod ( On , "on" ) ;
51
51
52
- if ( this . options != null )
53
- {
54
- int width = 0 , height = 0 ;
55
-
56
- Int32 . TryParse ( options [ "width" ] . ToString ( ) , out width ) ;
57
- Int32 . TryParse ( options [ "height" ] . ToString ( ) , out height ) ;
52
+ Int32 . TryParse ( options [ "width" ] . ToString ( ) , out width ) ;
53
+ Int32 . TryParse ( options [ "height" ] . ToString ( ) , out height ) ;
58
54
59
- if ( width <= 0 ) width = defaultWindowWidth ;
60
- if ( height <= 0 ) height = defaultWindowHeight ;
55
+ if ( width <= 0 ) width = defaultWindowWidth ;
56
+ if ( height <= 0 ) height = defaultWindowHeight ;
61
57
62
- App . NewWindow ( width , height ) ;
63
- }
64
- else
65
- {
66
- App . NewWindow ( defaultWindowWidth , defaultWindowHeight ) ;
67
- }
58
+ App . NewWindow ( width , height ) ;
68
59
}
69
60
protected JavaScriptValue LoadURL ( JavaScriptValue callee , bool isConstructCall , JavaScriptValue [ ] arguments , ushort argumentCount , IntPtr callbackData )
70
61
{
0 commit comments