当前位置: 首页>>代码示例>>C#>>正文


C# JsObject.DefineOwnProperty方法代码示例

本文整理汇总了C#中Jint.Native.JsObject.DefineOwnProperty方法的典型用法代码示例。如果您正苦于以下问题:C# JsObject.DefineOwnProperty方法的具体用法?C# JsObject.DefineOwnProperty怎么用?C# JsObject.DefineOwnProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jint.Native.JsObject的用法示例。


在下文中一共展示了JsObject.DefineOwnProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitPrototype

        public override void InitPrototype(IGlobal global)
        {
            Prototype = new JsObject() { Prototype = global.FunctionClass.Prototype };

            Prototype.DefineOwnProperty("constructor", this, PropertyAttributes.DontEnum);

            Prototype.DefineOwnProperty("toString", global.FunctionClass.New<JsDictionaryObject>(ToString2), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("toLocaleString", global.FunctionClass.New<JsDictionaryObject>(ToString2), PropertyAttributes.DontEnum);
        }
开发者ID:pusp,项目名称:o2platform,代码行数:9,代码来源:JsBooleanConstructor.cs

示例2: New

 /// <summary>
 /// Creates new JsObject, sets a [[Prototype]] to the Prototype parameter and a 'constructor' property to the specified function.
 /// </summary>
 /// <param name="constructor">JsFunction which is used as a constructor</param>
 /// <param name="Prototype">JsObjetc which is used as a prototype</param>
 /// <returns>new object</returns>
 public JsObject New(JsFunction constructor, JsObject Prototype)
 {
     JsObject obj = new JsObject(Prototype);
     obj.DefineOwnProperty(new ValueDescriptor(obj, CONSTRUCTOR, constructor) { Enumerable = false });
     return obj;
 }
开发者ID:925coder,项目名称:ravendb,代码行数:12,代码来源:JsObjectConstructor.cs

示例3: InitPrototype

        public override void InitPrototype(IGlobal global)
        {
            Prototype = new JsObject() { Prototype = global.FunctionClass.Prototype };
            Prototype.DefineOwnProperty("constructor", this, PropertyAttributes.DontEnum);

            #region Methods
            Prototype.DefineOwnProperty("toString", global.FunctionClass.New<JsArray>(ToStringImpl), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("toLocaleString", global.FunctionClass.New<JsArray>(ToLocaleStringImpl), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("concat", global.FunctionClass.New<JsObject>(Concat), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("join", global.FunctionClass.New<JsObject>(Join, 1), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("pop", global.FunctionClass.New<JsObject>(Pop), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("push", global.FunctionClass.New<JsObject>(Push, 1), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("reverse", global.FunctionClass.New<JsObject>(Reverse), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("shift", global.FunctionClass.New<JsObject>(Shift), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("slice", global.FunctionClass.New<JsObject>(Slice, 2), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("sort", global.FunctionClass.New<JsObject>(Sort), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("splice", global.FunctionClass.New<JsObject>(Splice, 2), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("unshift", global.FunctionClass.New<JsObject>(UnShift, 1), PropertyAttributes.DontEnum);

            #region ES5
            Prototype.DefineOwnProperty("indexOf", global.FunctionClass.New<JsObject>(IndexOfImpl, 1), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("lastIndexOf", global.FunctionClass.New<JsObject>(LastIndexOfImpl, 1), PropertyAttributes.DontEnum);
            #endregion

            #endregion
        }
开发者ID:Fedorm,项目名称:core-master,代码行数:26,代码来源:JsArrayConstructor.cs


注:本文中的Jint.Native.JsObject.DefineOwnProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。