• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ParameterAttributes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: RuntimeParameter

 /// <summary>
 /// Initializes a new instance of the <see cref="RuntimeParameter"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="position">The position.</param>
 /// <param name="attributes">The attributes.</param>
 public RuntimeParameter(string name, int position, ParameterAttributes attributes)
 {
     this.token = (HeapIndexToken)0;
     this.attributes = attributes;
     this.name = name;
     this.position = position;
 }
开发者ID:davidleon,项目名称:MOSA-Project,代码行数:13,代码来源:RuntimeParameter.cs


示例2: ParameterInfoMirror

		internal ParameterInfoMirror (MethodMirror method, int pos, TypeMirror type, string name, ParameterAttributes attrs) : base (method.VirtualMachine, 0) {
			this.method = method;
			this.pos = pos;
			this.type = type;
			this.name = name;
			this.attrs = attrs;
		}
开发者ID:0xb1dd1e,项目名称:debugger-libs,代码行数:7,代码来源:ParameterInfoMirror.cs


示例3: RoutineParameter

 public RoutineParameter(string name, SqlType type, ParameterDirection direction, ParameterAttributes attributes)
 {
     Attributes = attributes;
     Direction = direction;
     Type = type;
     Name = name;
 }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:RoutineParameter.cs


示例4: DefineParameter

 /*******************
 *
 * This is setting the parameter information
 *
 ********************/
 /// <include file='doc\ConstructorBuilder.uex' path='docs/doc[@for="ConstructorBuilder.DefineParameter"]/*' />
 public ParameterBuilder DefineParameter(
     int         iSequence, 
     ParameterAttributes attributes, 
     String      strParamName)           // can be NULL string
 {
     return m_methodBuilder.DefineParameter(iSequence, attributes, strParamName);
 }
开发者ID:ArildF,项目名称:masters,代码行数:13,代码来源:constructorbuilder.cs


示例5: ParameterBuilder

		internal ParameterBuilder(ModuleBuilder moduleBuilder, int sequence, ParameterAttributes attribs, string name)
		{
			this.moduleBuilder = moduleBuilder;
			this.flags = (short)attribs;
			this.sequence = (short)sequence;
			this.nameIndex = name == null ? 0 : moduleBuilder.Strings.Add(name);
			this.name = name;
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:8,代码来源:ParameterBuilder.cs


示例6: ParameterInfo

 internal ParameterInfo(MethodInfo owner, string name, Type parameterType, int position)
 {
     this.MemberImpl = owner;
     this.NameImpl = name;
     this.ClassImpl = parameterType;
     this.PositionImpl = position;
     this.AttrsImpl = ParameterAttributes.None;
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:8,代码来源:ParameterInfo.cs


示例7: ParameterStructure

 public ParameterStructure(string name, ParameterAttributes attr, TypeStructure pt, CilStructure def)
 {
     Name = name;
     Attributes = attr;
     ParamType = pt;
     DefaultValue = def;
     AppendChild(DefaultValue);
 }
开发者ID:B-head,项目名称:Dreit-prototype,代码行数:8,代码来源:ParameterStructure.cs


示例8: ParameterBuilder

 internal ParameterBuilder(MethodBuilder methodBuilder, int sequence, ParameterAttributes attributes, string strParamName)
 {
     this.m_iPosition = sequence;
     this.m_strParamName = strParamName;
     this.m_methodBuilder = methodBuilder;
     this.m_strParamName = strParamName;
     this.m_attributes = attributes;
     this.m_pdToken = new ParameterToken(TypeBuilder.SetParamInfo(this.m_methodBuilder.GetModuleBuilder().GetNativeHandle(), this.m_methodBuilder.GetToken().Token, sequence, attributes, strParamName));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ParameterBuilder.cs


示例9: Parameter

 public ApiMethodBuilder Parameter(Type type, string name = "param", ParameterAttributes attributes = ParameterAttributes.None)
 {
     _parameters.Add(new ApiParameter
     {
       Type = type,
       Name = name,
       Attributes = attributes
     });
       return this;
 }
开发者ID:gitter-badger,项目名称:ApiCheck,代码行数:10,代码来源:ApiMethodBuilder.cs


示例10: ParameterBuilder

#pragma warning restore 169, 414
		
		internal ParameterBuilder (MethodBase mb, int pos, ParameterAttributes attributes, string strParamName) {
			name = strParamName;
			position = pos;
			attrs = attributes;
			methodb = mb;
			if (mb is DynamicMethod)
				table_idx = 0;
			else
				table_idx = mb.get_next_table_index (this, 0x08, true);
		}
开发者ID:robert-j,项目名称:mono-fork,代码行数:12,代码来源:ParameterBuilder.cs


示例11: StubParameterInfo

		public StubParameterInfo(int position, Type/*!*/ type, ParameterAttributes attributes, string name)
		{
			Debug.Assert(type != null);

#if !SILVERLIGHT
			this.ClassImpl = type;
			this.AttrsImpl = attributes;
			this.NameImpl = name;
			this.PositionImpl = position;
#endif
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:11,代码来源:ClrStubBuilder.cs


示例12: DefaultParameter

 public ApiMethodBuilder DefaultParameter(Type type, object defaultValue, string name = "param", ParameterAttributes attributes = ParameterAttributes.Optional | ParameterAttributes.HasDefault)
 {
     _parameters.Add(new ApiParameter
       {
     Type = type,
     Name = name,
     DefaultValue = defaultValue,
     Attributes = attributes
       });
       return this;
 }
开发者ID:gitter-badger,项目名称:ApiCheck,代码行数:11,代码来源:ApiMethodBuilder.cs


示例13: ParameterInfo

 private ParameterInfo(Signature signature, MetadataImport scope, int tkParamDef, int position, ParameterAttributes attributes, MemberInfo member)
 {
     this.PositionImpl = position;
     this.MemberImpl = member;
     this.m_signature = signature;
     this.m_tkParamDef = System.Reflection.MetadataToken.IsNullToken(tkParamDef) ? 0x8000000 : tkParamDef;
     this.m_scope = scope;
     this.AttrsImpl = attributes;
     this.ClassImpl = null;
     this.NameImpl = null;
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:11,代码来源:ParameterInfo.cs


示例14: RoutineParameter

        public RoutineParameter(string name, SqlType type, ParameterDirection direction, ParameterAttributes attributes)
        {
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");
            if (type == null)
                throw new ArgumentNullException("type");

            Attributes = attributes;
            Direction = direction;
            Type = type;
            Name = name;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:12,代码来源:RoutineParameter.cs


示例15: ParameterInfo

 // There is a single constructor that is used to create a Parameter.  This is
 //  only called from native so it can be private.
 /// <include file='doc\ParameterInfo.uex' path='docs/doc[@for="ParameterInfo.ParameterInfo1"]/*' />
 internal ParameterInfo(Type theClass, String name, int position, ParameterAttributes attributes) 
 {
     ClassImpl = theClass;
     NameImpl = name;
     PositionImpl = position;
     AttrsImpl = attributes;
     DefaultValueImpl = DBNull.Value;
     MemberImpl = null;
     
     _importer = (IntPtr)0;
     _token = 0;
 }
开发者ID:ArildF,项目名称:masters,代码行数:15,代码来源:parameterinfo.cs


示例16: ParameterInfo

		/*FIXME this constructor looks very broken in the position parameter*/
		internal ParameterInfo (ParameterInfo pinfo, Type type, MemberInfo member, int position) {
			this.ClassImpl = type;
			this.MemberImpl = member;
			if (pinfo != null) {
				this.NameImpl = pinfo.Name;
				this.PositionImpl = pinfo.Position - 1;	// ParameterInfo.Position is zero-based
				this.AttrsImpl = (ParameterAttributes) pinfo.Attributes;
			} else {
				this.NameImpl = null;
				this.PositionImpl = position - 1;
				this.AttrsImpl = ParameterAttributes.None;
			}
		}
开发者ID:Viewserve,项目名称:mono,代码行数:14,代码来源:ParameterInfo.cs


示例17: CheckSupport

    private void CheckSupport(ParameterAttributes parameterAttributes)
    {
      string warningTemplate = "Parameter '" + name + "' has unsupported attribute: '{0}'.";

      // in order to reduce output we warn only about important attributes which are not currently
      // supported:

      // TODO: support this: if ((parameterAttributes & ParameterAttributes.HasDefault) != 0) { Logger.Warning(warningTemplate, "HasDefault"); }
      // TODO: support this: if ((parameterAttributes & ParameterAttributes.HasFieldMarshal) != 0) { Logger.Warning(warningTemplate, "HasFieldMarshal"); }
      // TODO: support this: if ((parameterAttributes & ParameterAttributes.Lcid) != 0) { Logger.Warning(warningTemplate, "Lcid"); }
      // TODO: support this: if ((parameterAttributes & ParameterAttributes.Optional) != 0) { Logger.Warning(warningTemplate, "Optional"); }
      // TODO: support this: if ((parameterAttributes & ParameterAttributes.Retval) != 0) { Logger.Warning(warningTemplate, "Retval"); }
    }
开发者ID:PrintFleet,项目名称:ImmDoc.NET,代码行数:13,代码来源:MyParameterInfo.cs


示例18: ParameterBuilder

	// Constructor.
	internal ParameterBuilder(TypeBuilder type, MethodBase method,
							  int position, ParameterAttributes attributes,
							  String strParamName)
			{
				// Initialize the internal state.
				this.type = type;
				this.method = method;

				// Register this item to be detached later.
				type.module.assembly.AddDetach(this);

				// Create the parameter.
				lock(typeof(AssemblyBuilder))
				{
					this.privateData = ClrParameterCreate
						(((IClrProgramItem)method).ClrHandle,
						 position, attributes, strParamName);
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:20,代码来源:ParameterBuilder.cs


示例19: TestDefineParameter

        public void TestDefineParameter()
        {
            string name = "Assembly1";
            AssemblyName asmname = new AssemblyName();
            asmname.Name = name;
            AssemblyBuilder asmbuild = AssemblyBuilder.DefineDynamicAssembly(asmname, AssemblyBuilderAccess.Run);
            ModuleBuilder modbuild = TestLibrary.Utilities.GetModuleBuilder(asmbuild, "Module1");
            TypeBuilder tpbuild = modbuild.DefineType("C1", TypeAttributes.Public);

            Type[] paramTypes = new Type[] { typeof(string), typeof(object) };
            string[] paramNames = new string[] { "Param1", "Param2" };
            ParameterAttributes[] paramAttrs = new ParameterAttributes[] { ParameterAttributes.In, ParameterAttributes.Out };
            Type returnType = typeof(int);
            ParameterAttributes returnAttrs = ParameterAttributes.None;

            MethodBuilder methbuild = tpbuild.DefineMethod("meth1", MethodAttributes.Public | MethodAttributes.Static,
                                                            returnType, paramTypes);

            methbuild.DefineParameter(0, returnAttrs, "returnName");
            methbuild.DefineParameter(1, paramAttrs[0], paramNames[0]);
            methbuild.DefineParameter(2, paramAttrs[1], paramNames[1]);

            int expectedRet = 3;
            ILGenerator ilgen = methbuild.GetILGenerator();
            ilgen.Emit(OpCodes.Ldc_I4, expectedRet);
            ilgen.Emit(OpCodes.Ret);

            Type tp = tpbuild.CreateTypeInfo().AsType();

            ParameterInfo[] paramArray = methbuild.GetParameters();

            Assert.Equal("System.String Param1", paramArray[0].ToString());
            Assert.Equal("System.Object Param2", paramArray[1].ToString());
            // invoke method to verify it still works correctly
            MethodInfo mi = tp.GetMethod("meth1");
            int ret = (int)mi.Invoke(null, new object[] { "hello", new object() });
            Assert.Equal(expectedRet, ret);
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:38,代码来源:MethodBuilderDefineParameter.cs


示例20: DefineParameter_AllAttributes

        public void DefineParameter_AllAttributes()
        {
            ParameterAttributes[] attributes = new ParameterAttributes[]
            {
                ParameterAttributes.HasDefault,
                ParameterAttributes.HasFieldMarshal,
                ParameterAttributes.In,
                ParameterAttributes.None,
                ParameterAttributes.Optional,
                ParameterAttributes.Out,
                ParameterAttributes.Retval
            };

            TypeBuilder type = Helpers.DynamicType(TypeAttributes.Abstract);
            Type[] paramTypes = Enumerable.Repeat(typeof(int), attributes.Length).ToArray();
            MethodBuilder method = type.DefineMethod("TestMethod", TestMethodAttributes, typeof(void), paramTypes);

            for (int i = 1; i < attributes.Length; ++i)
            {
                ParameterBuilder parameter = method.DefineParameter(i, attributes[i], "TestParam");
                VerifyParameterBuilder(parameter, "TestParam", attributes[i], i);
            }
        }
开发者ID:ESgarbi,项目名称:corefx,代码行数:23,代码来源:MethodBuilderDefineParameter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ParameterCollection类代码示例发布时间:2022-05-24
下一篇:
C# Parameter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap