本文整理汇总了C#中ArgBuilder类的典型用法代码示例。如果您正苦于以下问题:C# ArgBuilder类的具体用法?C# ArgBuilder怎么用?C# ArgBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArgBuilder类属于命名空间,在下文中一共展示了ArgBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MapParameters
internal void MapParameters(bool reduceByRef) {
if (reduceByRef) {
_returnArgs = new List<int>();
if (CompilerHelpers.GetReturnType(_method) != typeof(void)) {
_returnArgs.Add(-1);
}
}
BitArray specialParameters = _resolver.MapSpecialParameters(this);
if (_instanceBuilder == null) {
_instanceBuilder = new NullArgBuilder();
}
for (int infoIndex = 0; infoIndex < _parameterInfos.Length; infoIndex++) {
if (!IsSpecialParameter(specialParameters, infoIndex)) {
if (reduceByRef) {
MapParameterReduceByRef(_parameterInfos[infoIndex]);
} else {
MapParameter(_parameterInfos[infoIndex]);
}
}
}
_returnBuilder = MakeReturnBuilder(specialParameters);
}
示例2: KeywordArgBuilder
public KeywordArgBuilder(ArgBuilder builder, int kwArgCount, int kwArgIndex)
: base(builder.ParameterInfo) {
Debug.Assert(BuilderExpectsSingleParameter(builder));
_builder = builder;
Debug.Assert(kwArgIndex < kwArgCount);
_kwArgCount = kwArgCount;
_kwArgIndex = kwArgIndex;
}
示例3: MethodTarget
internal MethodTarget(MethodBinder binder, MethodBase method, int parameterCount, ArgBuilder instanceBuilder, IList<ArgBuilder> argBuilders, ReturnBuilder returnBuilder) {
this._binder = binder;
this._method = method;
this._parameterCount = parameterCount;
this._instanceBuilder = instanceBuilder;
this._argBuilders = argBuilders;
this._returnBuilder = returnBuilder;
//argBuilders.TrimExcess();
}
示例4: MethodCandidate
internal MethodCandidate(OverloadResolver resolver, MethodBase method, List<ParameterWrapper> parameters, ParameterWrapper paramsDict,
ReturnBuilder returnBuilder, ArgBuilder instanceBuilder, IList<ArgBuilder> argBuilders) {
Assert.NotNull(resolver, method, instanceBuilder, returnBuilder);
Assert.NotNullItems(parameters);
Assert.NotNullItems(argBuilders);
_resolver = resolver;
_method = method;
_instanceBuilder = instanceBuilder;
_argBuilders = argBuilders;
_returnBuilder = returnBuilder;
_parameters = parameters;
_paramsDict = paramsDict;
_paramsArrayIndex = ParameterWrapper.IndexOfParamsArray(parameters);
parameters.TrimExcess();
}
示例5: Starg
/// <summary>
/// Starg
/// </summary>
/// <param name="arg"></param>
public void Starg(ArgBuilder arg)
{
Check.Require(arg, "arg");
this.Starg(arg.Index);
}
示例6: LdargAddress
/// <summary>
/// LdargAddress ���ز�����ַ��ILû�����ָ������ݲ��������ͷֱ���ò�ͬ��ILָ�
/// ������Ϊֵ����ʱ��ͨ������Ldargaָ����ز�����ַ
/// ���β�Ϊֵ����ʱ��ֱ�ӵ���Ldarg���ز���
/// </summary>
/// <param name="argBuilder"></param>
public void LdargAddress(ArgBuilder argBuilder)
{
Check.Require(argBuilder, "argBuilder");
if (argBuilder.ArgType.IsValueType)
{
this.Ldarga(argBuilder);
}
else
{
this.Ldarg(argBuilder);
}
}
示例7: Ldarga
/// <summary>
/// Ldarga ���� Ldarga(int) ����
/// </summary>
/// <param name="argBuilder"></param>
public void Ldarga(ArgBuilder argBuilder)
{
Check.Require(argBuilder, "argBuilder");
this.Ldarga(argBuilder.Index);
}
示例8: InitArgs
void InitArgs(Type objType)
{
xmlWriterArg = ilg.GetArg(0);
contextArg = ilg.GetArg(2);
dataContractArg = ilg.GetArg(3);
objectLocal = ilg.DeclareLocal(objType, "objSerialized");
ArgBuilder objectArg = ilg.GetArg(1);
ilg.Load(objectArg);
// Copy the data from the DataTimeOffset object passed in to the DateTimeOffsetAdapter.
// DateTimeOffsetAdapter is used here for serialization purposes to bypass the ISerializable implementation
// on DateTimeOffset; which does not work in partial trust.
if (objType == Globals.TypeOfDateTimeOffsetAdapter)
{
ilg.ConvertValue(objectArg.ArgType, Globals.TypeOfDateTimeOffset);
ilg.Call(XmlFormatGeneratorStatics.GetDateTimeOffsetAdapterMethod);
}
else
{
ilg.ConvertValue(objectArg.ArgType, objType);
}
ilg.Stloc(objectLocal);
}
示例9: IsStartElement
void IsStartElement(ArgBuilder nameArg, ArgBuilder nsArg)
{
ilg.Call(xmlReaderArg, XmlFormatGeneratorStatics.IsStartElementMethod2, nameArg, nsArg);
}
示例10: Ldarg
internal void Ldarg(ArgBuilder arg) {
Ldarg(arg.Index);
}
示例11: InitArgs
private void InitArgs(Type objType)
{
this.xmlWriterArg = this.ilg.GetArg(0);
this.contextArg = this.ilg.GetArg(2);
this.dataContractArg = this.ilg.GetArg(3);
this.objectLocal = this.ilg.DeclareLocal(objType, "objSerialized");
ArgBuilder arg = this.ilg.GetArg(1);
this.ilg.Load(arg);
if (objType == Globals.TypeOfDateTimeOffsetAdapter)
{
this.ilg.ConvertValue(arg.ArgType, Globals.TypeOfDateTimeOffset);
this.ilg.Call(XmlFormatGeneratorStatics.GetDateTimeOffsetAdapterMethod);
}
else
{
this.ilg.ConvertValue(arg.ArgType, objType);
}
this.ilg.Stloc(this.objectLocal);
}
示例12: InitArgs
private void InitArgs(Type objType)
{
_xmlWriterArg = _ilg.GetArg(0);
_contextArg = _ilg.GetArg(2);
_dataContractArg = _ilg.GetArg(3);
_objectLocal = _ilg.DeclareLocal(objType, "objSerialized");
ArgBuilder objectArg = _ilg.GetArg(1);
_ilg.Load(objectArg);
// Copy the data from the DataTimeOffset object passed in to the DateTimeOffsetAdapter.
// DateTimeOffsetAdapter is used here for serialization purposes to bypass the ISerializable implementation
// on DateTimeOffset; which does not work in partial trust.
if (objType == Globals.TypeOfDateTimeOffsetAdapter)
{
_ilg.ConvertValue(objectArg.ArgType, Globals.TypeOfDateTimeOffset);
_ilg.Call(XmlFormatGeneratorStatics.GetDateTimeOffsetAdapterMethod);
}
//Copy the KeyValuePair<K,T> to a KeyValuePairAdapter<K,T>.
else if (objType.GetTypeInfo().IsGenericType && objType.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePairAdapter)
{
ClassDataContract dc = (ClassDataContract)DataContract.GetDataContract(objType);
_ilg.ConvertValue(objectArg.ArgType, Globals.TypeOfKeyValuePair.MakeGenericType(dc.KeyValuePairGenericArguments));
_ilg.New(dc.KeyValuePairAdapterConstructorInfo);
}
else
{
_ilg.ConvertValue(objectArg.ArgType, objType);
}
_ilg.Stloc(_objectLocal);
}
示例13: BuilderExpectsSingleParameter
/// <summary>
/// The underlying builder should expect a single parameter as KeywordArgBuilder is responsible
/// for calculating the correct parameter to use
/// </summary>
/// <param name="builder"></param>
internal static bool BuilderExpectsSingleParameter(ArgBuilder builder) {
return (((SimpleArgBuilder)builder).Index == 0);
}
示例14: VariantBuilder
internal VariantBuilder(VarEnum targetComType, ArgBuilder builder) {
_targetComType = targetComType;
_argBuilder = builder;
}
示例15: Ldarga
internal void Ldarga(ArgBuilder argBuilder) {
Ldarga(argBuilder.Index);
}