예제 #1
0
 void VerifyMethods()
 {
     if (_MethodsByName == null)
     {
         _MethodsByName = new JsObject <JsArray <MethodInfo> >();
         _Methods       = new JsExtendedArray();
         FillMethods(_JsType.definition);
         FillMethods(_JsType.staticDefinition);
         var baseType = BaseType;
         if (baseType != null)
         {
             var methods = baseType.GetMethods();
             foreach (var me in methods)
             {
                 if (_JsType.definition != null && _JsType.definition.hasOwnProperty(me.As <JsImplMethodInfo>().JsName))
                 {
                     continue;
                 }
                 if (_JsType.staticDefinition != null && _JsType.staticDefinition.hasOwnProperty(me.As <JsImplMethodInfo>().JsName))
                 {
                     continue;
                 }
                 var list = _MethodsByName[me.As <JsImplMethodInfo>()._Name];
                 if (list == null)
                 {
                     list = new JsArray <MethodInfo>();
                     _MethodsByName[me.As <JsImplMethodInfo>()._Name] = list;
                 }
                 list.push(me);
                 _Methods.push(me);
             }
         }
     }
 }
예제 #2
0
파일: Enum.cs 프로젝트: fjgandrade/sharpkit
        /// <summary>
        /// Retrieves an array of the values of the constants in a specified enumeration.
        /// </summary>
        /// <param name="enumType">Type of the enum.</param>
        /// <returns>An array that contains the values of the constants in enumType.</returns>
        /// <exception cref="ArgumentNullException"><para>enumType</para> is null.</exception>
        public static object[] GetValues(Type enumType)
		{
            if (enumType == null) throw new ArgumentNullException("enumType");

            var jsType = enumType.As<JsImplType>()._JsType;
			var array = new JsExtendedArray();
			foreach (var p in jsType.staticDefinition)
				array.push(jsType.staticDefinition[p]);
			return array.As<object[]>();
		}
예제 #3
0
파일: Enum.cs 프로젝트: fjgandrade/sharpkit
		public static object[] GetValues(Type type)
		{
			var jsType = type.As<JsImplType>()._JsType;
			var array = new JsExtendedArray();
			foreach (var p in jsType.staticDefinition)
			{
				array.push(jsType.staticDefinition[p]);
			}
			return array.As<object[]>();
		}
예제 #4
0
파일: Enum.cs 프로젝트: fjgandrade/sharpkit
		public static string[] GetNames(Type type)
		{
			var jsType = type.As<JsImplType>()._JsType;
			var array = new JsExtendedArray();
			foreach (var p in jsType.staticDefinition)
			{
				array.push(p);
			}
			return array.As<string[]>();
		}
예제 #5
0
        public static object[] GetValues(Type type)
        {
            var jsType = type.As <JsImplType>()._JsType;
            var array  = new JsExtendedArray();

            foreach (var p in jsType.staticDefinition)
            {
                array.push(jsType.staticDefinition[p]);
            }
            return(array.As <object[]>());
        }
예제 #6
0
        public static string[] GetNames(Type type)
        {
            var jsType = type.As <JsImplType>()._JsType;
            var array  = new JsExtendedArray();

            foreach (var p in jsType.staticDefinition)
            {
                array.push(p);
            }
            return(array.As <string[]>());
        }
예제 #7
0
        /// <summary>
        /// Retrieves an array of the values of the constants in a specified enumeration.
        /// </summary>
        /// <param name="enumType">Type of the enum.</param>
        /// <returns>An array that contains the values of the constants in enumType.</returns>
        /// <exception cref="ArgumentNullException"><para>enumType</para> is null.</exception>
        public static object[] GetValues(Type enumType)
        {
            if (enumType == null)
            {
                throw new ArgumentNullException("enumType");
            }

            var jsType = enumType.As <JsImplType>()._JsType;
            var array  = new JsExtendedArray();

            foreach (var p in jsType.staticDefinition)
            {
                array.push(jsType.staticDefinition[p]);
            }
            return(array.As <object[]>());
        }
예제 #8
0
        void VerifyConstructors()
        {
            if (_Constructors == null)
            {
                VerifyMethods();
                _Constructors = new JsExtendedArray();
                for (int i = 0; i < _JsType.ctors.As <JsArray>().length; i++)
                {
                    JsObject         ctorMeta   = _JsType.ctors[i.As <string>()].As <JsObject>();
                    string           ctorName   = ctorMeta["name"].As <string>();
                    JsArray <string> ctorParams = ctorMeta["parameters"].As <JsArray <string> >();
                    JsFunction       ctorFunc   = ctorMeta["_type"].As <JsObject>()[ctorName].As <JsFunction>();

                    var method = new JsImplConstructorInfo(ctorName, ctorFunc, ctorParams);
                    method._DeclaringType = this;
                    //method.JsName = funcName;
                    //method.JsFunction = func;
                    _Constructors.push(method);
                }
            }
        }
예제 #9
0
 void VerifyMethods()
 {
     if (_MethodsByName == null)
     {
         _MethodsByName = new JsObject();
         _Methods       = new JsExtendedArray();
         FillMethods(_JsType.definition);
         FillMethods(_JsType.staticDefinition);
         var baseType = BaseType;
         if (baseType != null)
         {
             foreach (var pe in baseType.GetMethods())
             {
                 if (_MethodsByName[pe._Name] == null)
                 {
                     _MethodsByName[pe._Name] = pe;
                     _Methods.push(pe);
                 }
             }
         }
     }
 }