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


C# ExtractValue类代码示例

本文整理汇总了C#中ExtractValue的典型用法代码示例。如果您正苦于以下问题:C# ExtractValue类的具体用法?C# ExtractValue怎么用?C# ExtractValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CheckType

        public CheckType(ObjectTranslator translator)
        {
            this.translator = translator;

            extractValues.Add(typeof(object).TypeHandle.Value.ToInt64(), new ExtractValue(getAsObject));
            extractValues.Add(typeof(sbyte).TypeHandle.Value.ToInt64(), new ExtractValue(getAsSbyte));
            extractValues.Add(typeof(byte).TypeHandle.Value.ToInt64(), new ExtractValue(getAsByte));
            extractValues.Add(typeof(short).TypeHandle.Value.ToInt64(), new ExtractValue(getAsShort));
            extractValues.Add(typeof(ushort).TypeHandle.Value.ToInt64(), new ExtractValue(getAsUshort));
            extractValues.Add(typeof(int).TypeHandle.Value.ToInt64(), new ExtractValue(getAsInt));
            extractValues.Add(typeof(uint).TypeHandle.Value.ToInt64(), new ExtractValue(getAsUint));
            extractValues.Add(typeof(long).TypeHandle.Value.ToInt64(), new ExtractValue(getAsLong));
            extractValues.Add(typeof(ulong).TypeHandle.Value.ToInt64(), new ExtractValue(getAsUlong));
            extractValues.Add(typeof(double).TypeHandle.Value.ToInt64(), new ExtractValue(getAsDouble));
            extractValues.Add(typeof(char).TypeHandle.Value.ToInt64(), new ExtractValue(getAsChar));
            extractValues.Add(typeof(float).TypeHandle.Value.ToInt64(), new ExtractValue(getAsFloat));
            extractValues.Add(typeof(decimal).TypeHandle.Value.ToInt64(), new ExtractValue(getAsDecimal));
            extractValues.Add(typeof(bool).TypeHandle.Value.ToInt64(), new ExtractValue(getAsBoolean));
            extractValues.Add(typeof(string).TypeHandle.Value.ToInt64(), new ExtractValue(getAsString));
            extractValues.Add(typeof(LuaFunction).TypeHandle.Value.ToInt64(), new ExtractValue(getAsFunction));
            extractValues.Add(typeof(LuaTable).TypeHandle.Value.ToInt64(), new ExtractValue(getAsTable));            

            extractValues.Add(typeof(Vector3).TypeHandle.Value.ToInt64(), new ExtractValue(getAsVector3));

            extractValues.Add(typeof(Vector2).TypeHandle.Value.ToInt64(), new ExtractValue(getAsVector2));
            extractValues.Add(typeof(Quaternion).TypeHandle.Value.ToInt64(), new ExtractValue(getAsQuaternion));
            extractValues.Add(typeof(Color).TypeHandle.Value.ToInt64(), new ExtractValue(getAsColor));
            extractValues.Add(typeof(Vector4).TypeHandle.Value.ToInt64(), new ExtractValue(getAsVector4));
            extractValues.Add(typeof(Ray).TypeHandle.Value.ToInt64(), new ExtractValue(getAsRay));
            extractValues.Add(typeof(Bounds).TypeHandle.Value.ToInt64(), new ExtractValue(getAsBounds));
                    

            extractNetObject = new ExtractValue(getAsNetObject);
        }
开发者ID:neutra,项目名称:uLuaGameFramework,代码行数:34,代码来源:CheckType.cs

示例2: CheckType

        public CheckType(ObjectTranslator translator)
        {
            this.translator = translator;

            extractValues.Add(typeof(object).TypeHandle.Value.ToInt64(), new ExtractValue(getAsObject));
            extractValues.Add(typeof(sbyte).TypeHandle.Value.ToInt64(), new ExtractValue(getAsSbyte));
            extractValues.Add(typeof(byte).TypeHandle.Value.ToInt64(), new ExtractValue(getAsByte));
            extractValues.Add(typeof(short).TypeHandle.Value.ToInt64(), new ExtractValue(getAsShort));
            extractValues.Add(typeof(ushort).TypeHandle.Value.ToInt64(), new ExtractValue(getAsUshort));
            extractValues.Add(typeof(int).TypeHandle.Value.ToInt64(), new ExtractValue(getAsInt));
            extractValues.Add(typeof(uint).TypeHandle.Value.ToInt64(), new ExtractValue(getAsUint));
            extractValues.Add(typeof(long).TypeHandle.Value.ToInt64(), new ExtractValue(getAsLong));
            extractValues.Add(typeof(ulong).TypeHandle.Value.ToInt64(), new ExtractValue(getAsUlong));
            extractValues.Add(typeof(double).TypeHandle.Value.ToInt64(), new ExtractValue(getAsDouble));
            extractValues.Add(typeof(char).TypeHandle.Value.ToInt64(), new ExtractValue(getAsChar));
            extractValues.Add(typeof(float).TypeHandle.Value.ToInt64(), new ExtractValue(getAsFloat));
            extractValues.Add(typeof(decimal).TypeHandle.Value.ToInt64(), new ExtractValue(getAsDecimal));
            extractValues.Add(typeof(bool).TypeHandle.Value.ToInt64(), new ExtractValue(getAsBoolean));
            extractValues.Add(typeof(string).TypeHandle.Value.ToInt64(), new ExtractValue(getAsString));
            extractValues.Add(typeof(LuaFunction).TypeHandle.Value.ToInt64(), new ExtractValue(getAsFunction));
            extractValues.Add(typeof(LuaTable).TypeHandle.Value.ToInt64(), new ExtractValue(getAsTable));
            extractValues.Add(typeof(LuaUserData).TypeHandle.Value.ToInt64(), new ExtractValue(getAsUserdata));

            extractNetObject = new ExtractValue(getAsNetObject);
        }
开发者ID:haiweizhang,项目名称:kopiluainterface,代码行数:25,代码来源:CheckType.cs

示例3: CheckType

 public CheckType(ObjectTranslator translator)
 {
     this.translator=translator;
     extractSbyte=new ExtractValue(this.getAsSbyte);
     extractByte=new ExtractValue(this.getAsByte);
     extractShort=new ExtractValue(this.getAsShort);
     extractUshort=new ExtractValue(this.getAsUshort);
     extractInt=new ExtractValue(this.getAsInt);
     extractUint=new ExtractValue(this.getAsUint);
     extractLong=new ExtractValue(this.getAsLong);
     extractUlong=new ExtractValue(this.getAsUlong);
     extractDouble=new ExtractValue(this.getAsDouble);
     extractChar=new ExtractValue(this.getAsChar);
     extractFloat=new ExtractValue(this.getAsFloat);
     extractDecimal=new ExtractValue(this.getAsDecimal);
     extractBoolean=new ExtractValue(this.getAsBoolean);
     extractString=new ExtractValue(this.getAsString);
     extractFunction=new ExtractValue(this.getAsFunction);
     extractTable=new ExtractValue(this.getAsTable);
     extractUserdata=new ExtractValue(this.getAsUserdata);
     extractObject=new ExtractValue(this.getAsObject);
 }
开发者ID:mentaldease,项目名称:bastionlandscape,代码行数:22,代码来源:CheckType.cs

示例4: CheckType

		public CheckType (ObjectTranslator translator)
		{
			this.translator = translator;
			extractValues.Add(GetExtractDictionaryKey(typeof(object)), new ExtractValue(GetAsObject));
			extractValues.Add(GetExtractDictionaryKey(typeof(sbyte)), new ExtractValue(GetAsSbyte));
			extractValues.Add(GetExtractDictionaryKey(typeof(byte)), new ExtractValue(GetAsByte));
			extractValues.Add(GetExtractDictionaryKey(typeof(short)), new ExtractValue(GetAsShort));
			extractValues.Add(GetExtractDictionaryKey(typeof(ushort)), new ExtractValue(GetAsUshort));
			extractValues.Add(GetExtractDictionaryKey(typeof(int)), new ExtractValue(GetAsInt));
			extractValues.Add(GetExtractDictionaryKey(typeof(uint)), new ExtractValue(GetAsUint));
			extractValues.Add(GetExtractDictionaryKey(typeof(long)), new ExtractValue(GetAsLong));
			extractValues.Add(GetExtractDictionaryKey(typeof(ulong)), new ExtractValue(GetAsUlong));
			extractValues.Add(GetExtractDictionaryKey(typeof(double)), new ExtractValue(GetAsDouble));
			extractValues.Add(GetExtractDictionaryKey(typeof(char)), new ExtractValue(GetAsChar));
			extractValues.Add(GetExtractDictionaryKey(typeof(float)), new ExtractValue(GetAsFloat));
			extractValues.Add(GetExtractDictionaryKey(typeof(decimal)), new ExtractValue(GetAsDecimal));
			extractValues.Add(GetExtractDictionaryKey(typeof(bool)), new ExtractValue(GetAsBoolean));
			extractValues.Add(GetExtractDictionaryKey(typeof(string)), new ExtractValue(GetAsString));
			extractValues.Add(GetExtractDictionaryKey(typeof(char[])), new ExtractValue (GetAsCharArray));
			extractValues.Add(GetExtractDictionaryKey(typeof(LuaFunction)), new ExtractValue(GetAsFunction));
			extractValues.Add(GetExtractDictionaryKey(typeof(LuaTable)), new ExtractValue(GetAsTable));
			extractValues.Add(GetExtractDictionaryKey(typeof(LuaUserData)), new ExtractValue(GetAsUserdata));
			extractNetObject = new ExtractValue (GetAsNetObject);		
		}
开发者ID:wilcomega,项目名称:Unity3D-NLua,代码行数:24,代码来源:CheckType.cs

示例5: IsParamsArray

		private bool IsParamsArray (LuaState luaState, int currentLuaParam, ParameterInfo currentNetParam, out ExtractValue extractValue)
		{
			extractValue = null;

			if (currentNetParam.GetCustomAttributes (typeof(ParamArrayAttribute), false).Length > 0) {
				LuaTypes luaType;

				try {
					luaType = LuaLib.LuaType (luaState, currentLuaParam);
				} catch (Exception ex) {
					Debug.WriteLine ("Could not retrieve lua type while attempting to determine params Array Status.");
					Debug.WriteLine (ex.Message);
					extractValue = null;
					return false;
				}

				if (luaType == LuaTypes.Table) {
					try {
						extractValue = translator.typeChecker.GetExtractor (typeof(LuaTable));
					} catch (Exception/* ex*/) {
						Debug.WriteLine ("An error occurred during an attempt to retrieve a LuaTable extractor while checking for params array status.");
					}

					if (extractValue != null) {
						return true;
					}
				} else {
					var paramElementType = currentNetParam.ParameterType.GetElementType ();

					try {
						extractValue = translator.typeChecker.CheckLuaType (luaState, currentLuaParam, paramElementType);
					} catch (Exception/* ex*/) {
						Debug.WriteLine (string.Format ("An error occurred during an attempt to retrieve an extractor ({0}) while checking for params array status.", paramElementType.FullName));
					}

					if (extractValue != null) {
						return true;
					}
				}
			}

			Debug.WriteLine ("Type wasn't Params object.");
			return false;
		}
开发者ID:hanbim520,项目名称:UFLua,代码行数:44,代码来源:Metatables.cs

示例6: IsTypeCorrect

		/// <summary>
		/// CP: Fix for operator overloading failure
		/// Returns true if the type is set and assigns the extract value
		/// </summary>
		/// <param name="luaState"></param>
		/// <param name="currentLuaParam"></param>
		/// <param name="currentNetParam"></param>
		/// <param name="extractValue"></param>
		/// <returns></returns>
		private bool IsTypeCorrect (LuaState luaState, int currentLuaParam, ParameterInfo currentNetParam, out ExtractValue extractValue)
		{
			try {
				return (extractValue = translator.typeChecker.CheckLuaType (luaState, currentLuaParam, currentNetParam.ParameterType)) != null;
			} catch {
				extractValue = null;
				Debug.WriteLine ("Type wasn't correct");
				return false;
			}
		}
开发者ID:hanbim520,项目名称:UFLua,代码行数:19,代码来源:Metatables.cs

示例7: _IsTypeCorrect

 private bool _IsTypeCorrect(IntPtr luaState, int currentLuaParam, ParameterInfo currentNetParam, out ExtractValue extractValue)
 {
     try
     {
         ExtractValue value2;
         extractValue = value2 = this.translator.typeChecker.checkType(luaState, currentLuaParam, currentNetParam.ParameterType);
         return (value2 != null);
     }
     catch
     {
         extractValue = null;
         return false;
     }
 }
开发者ID:Evangileon,项目名称:LuaInterface,代码行数:14,代码来源:MetaFunctions.cs

示例8: LuaMethodWrapper

		/*
		 * Constructs the wrapper for a known method name
		 */
		public LuaMethodWrapper(ObjectTranslator translator, IReflect targetType, string methodName, BindingFlags bindingType) 
		{
			this.translator=translator;
			this.methodName=methodName;
			this.targetType=targetType;
			if(targetType!=null)
				extractTarget=translator.typeChecker.getExtractor(targetType);
			this.bindingType=bindingType;
			members=targetType.UnderlyingSystemType.GetMember(methodName,MemberTypes.Method,bindingType|BindingFlags.Public|BindingFlags.NonPublic);
		}
开发者ID:viticm,项目名称:pap2,代码行数:13,代码来源:MethodWrapper.cs

示例9: LuaMethodWrapper

 public LuaMethodWrapper(ObjectTranslator translator, IReflect targetType, string methodName, BindingFlags bindingType)
 {
     this._LastCalledMethod = new MethodCache();
     this._Translator = translator;
     this._MethodName = methodName;
     this._TargetType = targetType;
     if (targetType != null)
     {
         this._ExtractTarget = translator.typeChecker.getExtractor(targetType);
     }
     this._BindingType = bindingType;
     this._Members = targetType.UnderlyingSystemType.GetMember(methodName, MemberTypes.Method, (bindingType | BindingFlags.Public) | BindingFlags.IgnoreCase);
 }
开发者ID:Evangileon,项目名称:LuaInterface,代码行数:13,代码来源:LuaMethodWrapper.cs

示例10: LuaMethodWrapper

		/*
		 * Constructs the wrapper for a known MethodBase instance
		 */
		public LuaMethodWrapper (ObjectTranslator translator, object target, ProxyType targetType, MethodBase method)
		{
			invokeFunction = new LuaNativeFunction (this.Call);
			_Translator = translator;
			_Target = target;

			if (targetType != null)
				_ExtractTarget = translator.typeChecker.GetExtractor (targetType);

			_Method = method;
			_MethodName = method.Name;
			_IsStatic = method.IsStatic;
		}
开发者ID:SD-J,项目名称:UnityLua,代码行数:16,代码来源:LuaMethodWrapper.cs

示例11: LuaMethodWrapper

        /// <summary>
        /// Constructs the wrapper for a known method name
        /// </summary>
        /// <param name="translator"></param>
        /// <param name="targetType"></param>
        /// <param name="methodName"></param>
        /// <param name="bindingType"></param>
        public LuaMethodWrapper(ObjectTranslator translator, IReflect targetType, string methodName, BindingFlags bindingType)
        {
            invokeFunction = new LuaNativeFunction(this.Call);

            _Translator = translator;
            _MethodName = methodName;

            if (targetType != null)
                _ExtractTarget = translator.typeChecker.GetExtractor(targetType);

            _BindingType = bindingType;
            //CP: Removed NonPublic binding search and added IgnoreCase
            _Members = targetType.UnderlyingSystemType.GetMember(methodName, MemberTypes.Method, bindingType | BindingFlags.Public | BindingFlags.IgnoreCase/*|BindingFlags.NonPublic*/);
        }
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:21,代码来源:LuaMethodWrapper.cs

示例12: LuaMethodWrapper

		/*
		 * Constructs the wrapper for a known MethodBase instance
		 */
		public LuaMethodWrapper (ObjectTranslator translator, object target, IReflect targetType, MethodBase method)
		{
			invokeFunction = new LuaNativeFunction (this.Call);
			_Translator = translator;
			_Target = target;

			if (targetType != null)
				_ExtractTarget = translator.typeChecker.GetExtractor (targetType);

			_Method = method;
			_MethodName = method.Name;

			if (method.IsStatic)
				_BindingType = BindingFlags.Static;
			else
				_BindingType = BindingFlags.Instance;
		}
开发者ID:ZoneBeat,项目名称:FAForeverMapEditor,代码行数:20,代码来源:LuaMethodWrapper.cs

示例13: LuaMethodWrapper

        /*
         * Constructs the wrapper for a known MethodBase instance
         */
        public LuaMethodWrapper(ObjectTranslator translator, object target, IReflect targetType, MethodBase method)
        {
            _Translator = translator;
            _Target = target;
            _TargetType = targetType;

            if(!targetType.IsNull())
                _ExtractTarget = translator.typeChecker.getExtractor(targetType);

            _Method = method;
            _MethodName = method.Name;

            if(method.IsStatic)
                _BindingType = BindingFlags.Static;
            else
                _BindingType = BindingFlags.Instance;
        }
开发者ID:rumkex,项目名称:LuaInterface,代码行数:20,代码来源:LuaMethodWrapper.cs


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