コード例 #1
0
 public StaticTemplateReference(StaticTemplateReference other)
     : base(other)
 {
     _template = (MessageTemplate)other._template.Clone();
 }
コード例 #2
0
ファイル: Group.cs プロジェクト: shariqkudcs/openfastdotnet
        private static void Init(Field[] inFields,
                                 out Field[] fieldDefinitions,
                                 out Field[] fields,
                                 out Dictionary<Field, int> fieldIndexMap,
                                 out Dictionary<QName, Field> fieldNameMap,
                                 out Dictionary<string, Scalar> introspectiveFieldMap,
                                 out bool usesPresenceMapRenamedField,
                                 out StaticTemplateReference[] staticTemplateReferences)
        {
            if (inFields == null) throw new ArgumentNullException("inFields");

            var expandedFields = new List<Field>();
            var references = new List<StaticTemplateReference>();

            foreach (Field t in inFields)
            {
                var currentTemplate = t as StaticTemplateReference;
                if (currentTemplate != null)
                {
                    Field[] referenceFields = currentTemplate.Template.Fields;
                    for (int j = 1; j < referenceFields.Length; j++)
                        expandedFields.Add(referenceFields[j]);
                    references.Add(currentTemplate);
                }
                else
                    expandedFields.Add(t);
            }

            fieldDefinitions = inFields;
            fields = expandedFields.ToArray();
            fieldIndexMap = ConstructFieldIndexMap(fields);
            fieldNameMap = Util.ToSafeDictionary(fields, f => f.QName);
            introspectiveFieldMap = ConstructInstrospectiveFields(fields);
            usesPresenceMapRenamedField = fields.Any(t => t.UsesPresenceMapBit);
            staticTemplateReferences = references.ToArray();
        }
コード例 #3
0
 public StaticTemplateReference(StaticTemplateReference other)
     : base(other)
 {
     _template = (MessageTemplate) other._template.Clone();
 }