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


C# IGroup.addNonstandardSegment方法代码示例

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


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

示例1: ParseReps

        //param childIndexName may have an integer on the end if >1 sibling with same name (e.g. NTE2)
        private void ParseReps(System.Xml.XmlElement groupElement, IGroup groupObject, System.String messageName, System.String childName, System.String childIndexName)
        {
            System.Collections.IList reps = GetChildElementsByTagName(groupElement, MakeGroupElementName(messageName, childName));
            log.Debug("# of elements matching " + MakeGroupElementName(messageName, childName) + ": " + reps.Count);

            if (groupObject.IsRepeating(childIndexName))
            {
                for (int i = 0; i < reps.Count; i++)
                {
                    ParseRep((System.Xml.XmlElement)reps[i], groupObject.GetStructure(childIndexName, i));
                }
            }
            else
            {
                if (reps.Count > 0)
                {
                    ParseRep((System.Xml.XmlElement)reps[0], groupObject.GetStructure(childIndexName, 0));
                }

                if (reps.Count > 1)
                {
                    System.String newIndexName = groupObject.addNonstandardSegment(childName);
                    for (int i = 1; i < reps.Count; i++)
                    {
                        ParseRep((System.Xml.XmlElement)reps[i], groupObject.GetStructure(newIndexName, i - 1));
                    }
                }
            }
        }
开发者ID:snosrap,项目名称:nhapi,代码行数:30,代码来源:DefaultXMLParser.cs

示例2: newSegment

 /// <summary> Sets the next position to a new segment of the given name, within the 
 /// given group. 
 /// </summary>
 private void newSegment(IGroup parent, System.String name)
 {
     log.Info("MessageIterator creating new segment: " + name);
     parent.addNonstandardSegment(name);
     next_Renamed_Field = new Position(parent, parent.Names[parent.Names.Length - 1], 0);
 }
开发者ID:snosrap,项目名称:nhapi,代码行数:9,代码来源:MessageIterator.cs

示例3: Parse

        /// <summary> Populates the given group object with data from the given group element, ignoring 
        /// any unrecognized nodes.  
        /// </summary>
        private void Parse(IGroup groupObject, System.Xml.XmlElement groupElement)
        {
            System.String[] childNames = groupObject.Names;
            System.String messageName = groupObject.Message.GetStructureName();

            System.Xml.XmlNodeList allChildNodes = groupElement.ChildNodes;
            System.Collections.ArrayList unparsedElementList = new System.Collections.ArrayList();
            for (int i = 0; i < allChildNodes.Count; i++)
            {
                System.Xml.XmlNode node = allChildNodes.Item(i);
                System.String name = node.Name;
                if (System.Convert.ToInt16(node.NodeType) == (short)System.Xml.XmlNodeType.Element && !unparsedElementList.Contains(name))
                {
                    unparsedElementList.Add(name);
                }
            }

            //we're not too fussy about order here (all occurances get parsed as repetitions) ...
            for (int i = 0; i < childNames.Length; i++)
            {
                SupportClass.ICollectionSupport.Remove(unparsedElementList, childNames[i]);
                ParseReps(groupElement, groupObject, messageName, childNames[i], childNames[i]);
            }

            for (int i = 0; i < unparsedElementList.Count; i++)
            {
                System.String segName = (System.String)unparsedElementList[i];
                System.String segIndexName = groupObject.addNonstandardSegment(segName);
                ParseReps(groupElement, groupObject, messageName, segName, segIndexName);
            }
        }
开发者ID:snosrap,项目名称:nhapi,代码行数:34,代码来源:DefaultXMLParser.cs


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