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


C# FieldMap.GetGroup方法代码示例

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


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

示例1: AddGetGroupTest

        public void AddGetGroupTest()
        {
            Group g1 = new Group(100, 200);
            Group g2 = new Group(100, 201);
            FieldMap fm = new FieldMap();
            fm.AddGroup(g1);
            fm.AddGroup(g2);
            Assert.That(fm.GetGroup(1, 100), Is.EqualTo(g1));
            Assert.That(fm.GetGroup(2, 100), Is.EqualTo(g2));

            Assert.Throws(typeof(FieldNotFoundException),
                delegate { fieldmap.GetGroup(0, 101); });
            Assert.Throws(typeof(FieldNotFoundException),
                delegate { fieldmap.GetGroup(3, 100); });
            Assert.Throws(typeof(FieldNotFoundException),
                delegate { fieldmap.GetGroup(1, 101); });
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:17,代码来源:FieldMapTests.cs

示例2: AddGroupKeepTypeTest

        public void AddGroupKeepTypeTest()
        {
            // bug found during issue 56 - Group object was losing type after being added
            FieldMap fm = new FieldMap();
            QuickFix.FIX42.News.LinesOfTextGroup linesGroup = new QuickFix.FIX42.News.LinesOfTextGroup();
            linesGroup.Text = new QuickFix.Fields.Text("foo");
            fm.AddGroup(linesGroup);

            var rvGroup = fm.GetGroup(1, Tags.LinesOfText);
            Assert.IsInstanceOf<QuickFix.FIX42.News.LinesOfTextGroup>(rvGroup);
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:11,代码来源:FieldMapTests.cs

示例3: Iterate

        public void Iterate(FieldMap map, string msgType)
        {
            DataDictionary.CheckHasNoRepeatedTags(map);

            // check non-group fields
            int lastField = 0;
            foreach (KeyValuePair<int, Fields.IField> kvp in map)
            {
                Fields.IField field = kvp.Value;
                if (lastField != 0 && field.Tag == lastField)
                    throw new RepeatedTag(lastField);
                CheckHasValue(field);

                if (null != this.Version && this.Version.Length > 0)
                {
                    CheckValidFormat(field);

                    if (ShouldCheckTag(field))
                    {
                        CheckValidTagNumber(field.Tag);
                        CheckValue(field);
                        if (!Message.IsHeaderField(field.Tag, this) && !Message.IsTrailerField(field.Tag, this))
                        {
                            CheckIsInMessage(field, msgType);
                            CheckGroupCount(field, map, msgType);
                        }
                    }
                }
                lastField = field.Tag;
            }

            // check contents of each group
            foreach (int groupTag in map.GetGroupTags())
            {
                for (int i = 1; i <= map.GroupCount(groupTag); i++)
                {
                    Group g = map.GetGroup(i, groupTag);
                    DDGrp ddg = this.Messages[msgType].GetGroup(groupTag);
                    IterateGroup(g, ddg, msgType);
                }
            }
        }
开发者ID:KITSOlgaLosynska,项目名称:quickfixn,代码行数:42,代码来源:DataDictionary.cs

示例4: toXMLFields

        public string toXMLFields(FieldMap fields, int space)
        {
            StringBuilder s = new StringBuilder();
            string name = string.Empty;

            // fields
            foreach (var f in fields)
            {
                
               s.Append("<field ");
               if ((dataDictionary_ != null) && ( dataDictionary_.FieldsByTag.ContainsKey(f.Key)))
               {
                   s.Append("name=\"" + dataDictionary_.FieldsByTag[f.Key].Name + "\" ");
               }
               s.Append("number=\"" + f.Key.ToString() + "\">");
               s.Append("<![CDATA[" + f.Value.ToString() + "]]>");
               s.Append("</field>");

            }
            // now groups
            List<int> groupTags = fields.GetGroupTags();
            foreach (int groupTag in groupTags)
            {
                for (int counter = 1; counter <= fields.GroupCount(groupTag); counter++)
                {
                    s.Append("<group>");
                    s.Append( toXMLFields( fields.GetGroup(counter, groupTag), space+1));
                    s.Append("</group>");
                }
            }
            
            return s.ToString();
        }
开发者ID:baffled,项目名称:quickfixn,代码行数:33,代码来源:Message.cs


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