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


C# ProcessingContext.SetValue方法代码示例

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


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

示例1: BooleanLang

 internal static void BooleanLang(ProcessingContext context)
 {
     StackFrame topArg = context.TopArg;
     StackFrame topSequenceArg = context.TopSequenceArg;
     Value[] sequences = context.Sequences;
     while (topSequenceArg.basePtr <= topSequenceArg.endPtr)
     {
         NodeSequence sequence = sequences[topSequenceArg.basePtr++].Sequence;
         for (int i = 0; i < sequence.Count; i++)
         {
             string strA = context.PeekString(topArg.basePtr).ToUpperInvariant();
             QueryNode node = sequence.Items[i].Node;
             long currentPosition = node.Node.CurrentPosition;
             node.Node.CurrentPosition = node.Position;
             string strB = node.Node.XmlLang.ToUpperInvariant();
             node.Node.CurrentPosition = currentPosition;
             if ((strA.Length == strB.Length) && (string.CompareOrdinal(strA, strB) == 0))
             {
                 context.SetValue(context, topArg.basePtr++, true);
             }
             else if (((strB.Length > 0) && (strA.Length < strB.Length)) && (strB.StartsWith(strA, StringComparison.Ordinal) && (strB[strA.Length] == '-')))
             {
                 context.SetValue(context, topArg.basePtr++, true);
             }
             else
             {
                 context.SetValue(context, topArg.basePtr++, false);
             }
         }
         topSequenceArg.basePtr++;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:XPathFunction.cs

示例2: Eval

 internal override void Eval(ProcessingContext context)
 {
     StackFrame[] frameArray = new StackFrame[this.argCount];
     for (int i = 0; i < this.argCount; i++)
     {
         frameArray[i] = context[i];
     }
     StringBuilder builder = new StringBuilder();
     while (frameArray[0].basePtr <= frameArray[0].endPtr)
     {
         builder.Length = 0;
         for (int k = 0; k < this.argCount; k++)
         {
             builder.Append(context.PeekString(frameArray[k].basePtr));
         }
         context.SetValue(context, frameArray[this.argCount - 1].basePtr, builder.ToString());
         for (int m = 0; m < this.argCount; m++)
         {
             frameArray[m].basePtr++;
         }
     }
     for (int j = 0; j < (this.argCount - 1); j++)
     {
         context.PopFrame();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:ConcatFunction.cs

示例3: InvokeInternal

 internal override void InvokeInternal(ProcessingContext context, int argCount)
 {
     StackFrame topArg = context.TopArg;
     SeekableXPathNavigator contextNode = context.Processor.ContextNode;
     long currentPosition = contextNode.CurrentPosition;
     while (topArg.basePtr <= topArg.endPtr)
     {
         string str = context.PeekString(topArg.basePtr);
         NodeSequence val = context.CreateSequence();
         if (XPathMessageFunction.MoveToHeader(contextNode) && contextNode.MoveToFirstChild())
         {
             do
             {
                 long num2 = contextNode.CurrentPosition;
                 string str2 = XPathMessageFunctionActor.ExtractFromNavigator(contextNode);
                 contextNode.CurrentPosition = num2;
                 if (str2 == str)
                 {
                     val.Add(contextNode);
                 }
             }
             while (contextNode.MoveToNext());
         }
         context.SetValue(context, topArg.basePtr, val);
         topArg.basePtr++;
     }
     contextNode.CurrentPosition = currentPosition;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:XPathMessageFunctionHeadersWithActor.cs

示例4: InvokeInternal

 internal override void InvokeInternal(ProcessingContext context, int argCount)
 {
     StackFrame topArg = context.TopArg;
     while (topArg.basePtr <= topArg.endPtr)
     {
         string dateStr = context.PeekString(topArg.basePtr);
         context.SetValue(context, topArg.basePtr, Convert(dateStr));
         topArg.basePtr++;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:XPathMessageFunctionDateStr.cs

示例5: Eval

 internal override Opcode Eval(ProcessingContext context)
 {
     StackFrame topArg = context.TopArg;
     StackFrame secondArg = context.SecondArg;
     int basePtr = topArg.basePtr;
     for (int i = secondArg.basePtr; basePtr <= topArg.endPtr; i++)
     {
         NodeSequence otherSeq = context.Values[basePtr].Sequence;
         NodeSequence sequence = context.Values[i].Sequence;
         context.SetValue(context, i, sequence.Union(context, otherSeq));
         basePtr++;
     }
     context.PopFrame();
     return base.next;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:UnionOpcode.cs

示例6: InvokeInternal

 internal override void InvokeInternal(ProcessingContext context, int argCount)
 {
     StackFrame topArg = context.TopArg;
     Message contextMessage = context.Processor.ContextMessage;
     CorrelationDataMessageProperty property = null;
     CorrelationDataMessageProperty.TryGet(contextMessage, out property);
     while (topArg.basePtr <= topArg.endPtr)
     {
         string str;
         if ((property == null) || !property.TryGetValue(context.PeekString(topArg.basePtr), out str))
         {
             str = string.Empty;
         }
         context.SetValue(context, topArg.basePtr, str);
         topArg.basePtr++;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:XPathMessageFunctionCorrelationData.cs

示例7: Eval

 internal override Opcode Eval(ProcessingContext context)
 {
     Value[] values = context.Values;
     StackFrame topArg = context.TopArg;
     for (int i = topArg.basePtr; i <= topArg.endPtr; i++)
     {
         NodeSequence sequence = values[i].Sequence;
         NodeSequence val = context.CreateSequence();
         for (int j = 0; j < sequence.Count; j++)
         {
             NodeSequenceItem item = sequence[j];
             val.AddCopy(ref item);
         }
         val.Merge();
         context.SetValue(context, i, val);
     }
     return base.next;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:MergeOpcode.cs

示例8: InvokeInternal

 internal override void InvokeInternal(ProcessingContext context, int argCount)
 {
     StackFrame topArg = context.TopArg;
     while (topArg.basePtr <= topArg.endPtr)
     {
         string val = string.Empty;
         NodeSequence sequence = context.PeekSequence(topArg.basePtr);
         if (sequence.Count > 0)
         {
             NodeSequenceItem item = sequence[0];
             SeekableXPathNavigator node = item.Node.Node;
             long currentPosition = node.CurrentPosition;
             NodeSequenceItem item2 = sequence[0];
             node.CurrentPosition = item2.Node.Position;
             val = ExtractFromNavigator(node);
             node.CurrentPosition = currentPosition;
         }
         context.SetValue(context, topArg.basePtr, val);
         topArg.basePtr++;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:XPathMessageFunctionActor.cs

示例9: NodesetCount

 internal static void NodesetCount(ProcessingContext context)
 {
     StackFrame arg = context.TopArg;
     while (arg.basePtr <= arg.endPtr)
     {
         context.SetValue(context, arg.basePtr, context.PeekSequence(arg.basePtr).Count);
         arg.basePtr++;
     }
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:9,代码来源:QueryFunctions.cs

示例10: BooleanLang

        internal static void BooleanLang(ProcessingContext context)
        {
            StackFrame langArg = context.TopArg;
            StackFrame sequences = context.TopSequenceArg;
            Value[] sequenceBuffer = context.Sequences;

            while (sequences.basePtr <= sequences.endPtr)
            {
                NodeSequence sourceSeq = sequenceBuffer[sequences.basePtr++].Sequence;

                for (int item = 0; item < sourceSeq.Count; ++item)
                {
                    string lang = context.PeekString(langArg.basePtr).ToUpperInvariant();

                    QueryNode node = sourceSeq.Items[item].Node;
                    long pos = node.Node.CurrentPosition;
                    node.Node.CurrentPosition = node.Position;
                    string docLang = node.Node.XmlLang.ToUpperInvariant();
                    node.Node.CurrentPosition = pos;

                    if (lang.Length == docLang.Length && string.CompareOrdinal(lang, docLang) == 0)
                    {
                        context.SetValue(context, langArg.basePtr++, true);
                    }
                    else if (docLang.Length > 0 && lang.Length < docLang.Length && docLang.StartsWith(lang, StringComparison.Ordinal) && docLang[lang.Length] == '-')
                    {
                        context.SetValue(context, langArg.basePtr++, true);
                    }
                    else
                    {
                        context.SetValue(context, langArg.basePtr++, false);
                    }
                }

                sequences.basePtr++;
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:37,代码来源:QueryFunctions.cs

示例11: Eval

        internal override void Eval(ProcessingContext context)
        {
            Fx.Assert(context != null, "");

            StackFrame[] args = new StackFrame[argCount];
            for (int i = 0; i < this.argCount; ++i)
            {
                args[i] = context[i];
            }

            StringBuilder builder = new StringBuilder();
            while (args[0].basePtr <= args[0].endPtr)
            {
                builder.Length = 0;

                for (int i = 0; i < this.argCount; ++i)
                {
                    builder.Append(context.PeekString(args[i].basePtr));
                }

                context.SetValue(context, args[this.argCount - 1].basePtr, builder.ToString());
                for (int i = 0; i < this.argCount; ++i)
                {
                    args[i].basePtr++;
                }
            }

            for (int i = 0; i < this.argCount - 1; ++i)
            {
                context.PopFrame();
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:32,代码来源:QueryFunctions.cs

示例12: NormalizeSpace

        internal static void NormalizeSpace(ProcessingContext context)
        {
            StackFrame argStr = context.TopArg;

            StringBuilder builder = new StringBuilder();
            while (argStr.basePtr <= argStr.endPtr)
            {
                char[] whitespace = new char[] { ' ', '\t', '\r', '\n' };
                string str = context.PeekString(argStr.basePtr).Trim(whitespace);

                bool eatingWhitespace = false;
                builder.Length = 0;
                for (int i = 0; i < str.Length; ++i)
                {
                    char c = str[i];
                    if (XPathCharTypes.IsWhitespace(c))
                    {
                        if (!eatingWhitespace)
                        {
                            builder.Append(' ');
                            eatingWhitespace = true;
                        }
                    }
                    else
                    {
                        builder.Append(c);
                        eatingWhitespace = false;
                    }
                }

                context.SetValue(context, argStr.basePtr, builder.ToString());
                argStr.basePtr++;
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:34,代码来源:QueryFunctions.cs

示例13: InvokeInternal

        internal override void InvokeInternal(ProcessingContext context, int argCount)
        {
            StackFrame seqArg = context.TopArg;

            while (seqArg.basePtr <= seqArg.endPtr)
            {
                string actor = string.Empty;
                NodeSequence seq = context.PeekSequence(seqArg.basePtr);

                if (seq.Count > 0)
                {
                    SeekableXPathNavigator nav = seq[0].Node.Node;
                    long p = nav.CurrentPosition;
                    nav.CurrentPosition = seq[0].Node.Position;
                    actor = ExtractFromNavigator(nav);
                    nav.CurrentPosition = p;
                }

                context.SetValue(context, seqArg.basePtr, actor);

                seqArg.basePtr++;
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:23,代码来源:XPathMessageContext.cs

示例14: NumberSum

        internal static void NumberSum(ProcessingContext context)
        {
            StackFrame arg = context.TopArg;
            while (arg.basePtr <= arg.endPtr)
            {
                NodeSequence sequence = context.PeekSequence(arg.basePtr);
                double sum = 0.0;
                for (int item = 0; item < sequence.Count; ++item)
                {
                    sum += QueryValueModel.Double(sequence[item].StringValue());
                }

                context.SetValue(context, arg.basePtr, sum);
                arg.basePtr++;
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:16,代码来源:QueryFunctions.cs

示例15: NumberRound

        internal static void NumberRound(ProcessingContext context)
        {
            StackFrame arg = context.TopArg;

            while (arg.basePtr <= arg.endPtr)
            {
                double val = context.PeekDouble(arg.basePtr);
                context.SetValue(context, arg.basePtr, QueryValueModel.Round(context.PeekDouble(arg.basePtr)));
                arg.basePtr++;
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:11,代码来源:QueryFunctions.cs


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