예제 #1
0
        public override System.Object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, System.Object [] args)
        {
            if (!f.HasTag(XMLCTOR_TAG))
            {
                return(base.ExecIdCall(f, cx, scope, thisObj, args));
            }
            int id = f.MethodId;

            switch (id)
            {
            case Id_defaultSettings: {
                lib.SetDefaultSettings();
                IScriptable obj = cx.NewObject(scope);
                WriteSetting(obj);
                return(obj);
            }

            case Id_settings: {
                IScriptable obj = cx.NewObject(scope);
                WriteSetting(obj);
                return(obj);
            }

            case Id_setSettings: {
                if (args.Length == 0 || args [0] == null || args [0] == Undefined.Value)
                {
                    lib.SetDefaultSettings();
                }
                else if (args [0] is IScriptable)
                {
                    ReadSettings((IScriptable)args [0]);
                }
                return(Undefined.Value);
            }
            }
            throw new System.ArgumentException(System.Convert.ToString(id));
        }
예제 #2
0
        public static void Init(IScriptable scope, bool zealed)
        {
            XMLLib impl = new XMLLib(scope);

            impl.SetDefaultSettings();
            impl.BindToScope(scope);

            impl.xmlPrototype = XML.CreateEmptyXml(impl);
            impl.xmlPrototype.ExportAsJSClass(zealed);

            impl.xmlListPrototype = new XMLList(impl);
            impl.xmlListPrototype.ExportAsJSClass(zealed);


            impl.qnamePrototype = new QName(impl);
            impl.qnamePrototype.ExportAsJSClass(zealed);

            impl.namespacePrototype = new Namespace(impl);
            impl.namespacePrototype.ExportAsJSClass(zealed);
        }
예제 #3
0
        public static void Init (IScriptable scope, bool zealed)
        {
            XMLLib impl = new XMLLib (scope);
            impl.SetDefaultSettings ();
            impl.BindToScope (scope);

            impl.xmlPrototype = XML.CreateEmptyXml (impl);
            impl.xmlPrototype.ExportAsJSClass (zealed);

            impl.xmlListPrototype = new XMLList (impl);
            impl.xmlListPrototype.ExportAsJSClass (zealed);


            impl.qnamePrototype = new QName (impl);
            impl.qnamePrototype.ExportAsJSClass (zealed);

            impl.namespacePrototype = new Namespace (impl);
            impl.namespacePrototype.ExportAsJSClass (zealed);
        }