예제 #1
0
        public JSAutoCompartment(IntPtr context, IntPtr obj)
        {
            if (context == IntPtr.Zero)
            {
                throw new ArgumentNullException("context");
            }
            if (obj == IntPtr.Zero)
            {
                throw new ArgumentNullException("obj");
            }

            _obj = new AutoJSContext.JSObjectWrapper(IntPtr.Zero)
            {
                JSObject = obj
            };
            _cx = context;

            EnterCompartment();
        }
예제 #2
0
        public JSAutoCompartment(AutoJSContext context, nsISupports comObject)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (context.ContextPointer == IntPtr.Zero)
            {
                throw new ArgumentException("context has Null ContextPointer");
            }
            if (context == null)
            {
                throw new ArgumentNullException("comObject");
            }

            _obj = context.ConvertCOMObjectToJSObject(comObject, false);
            _cx  = context.ContextPointer;

            EnterCompartment();
        }