예제 #1
0
파일: Context.cs 프로젝트: radtek/Gradual
 public ScalarValue Lookup(string dictionary, Group group, QName key)
 {
     if (group.HasTypeReference())
     {
         currentApplicationType = group.TypeReference;
     }
     return(GetDictionary(dictionary).Lookup(group, key, currentApplicationType));
 }
예제 #2
0
 public void  Store(Group group, QName applicationType, QName key, ScalarValue value_Renamed)
 {
     if (!dictionary.ContainsKey(group.TypeReference))
     {
         dictionary[group.TypeReference] = new System.Collections.Generic.Dictionary <QName, ScalarValue>();
     }
     dictionary[group.TypeReference][key] = value_Renamed;
 }
 public ScalarValue Lookup(Group template, QName key, QName applicationType)
 {
     if (table.ContainsKey(template))
     {
         return (table[template]).ContainsKey(key) ? table[template][key] : ScalarValue.UNDEFINED;
     }
     return ScalarValue.UNDEFINED;
 }
예제 #4
0
파일: Context.cs 프로젝트: radtek/Gradual
 public void  Store(string dictionary, Group group, QName key, ScalarValue valueToEncode)
 {
     if (group.HasTypeReference())
     {
         currentApplicationType = group.TypeReference;
     }
     GetDictionary(dictionary).Store(group, currentApplicationType, key, valueToEncode);
 }
 public void Store(Group group, QName applicationType, QName key, ScalarValue value_Renamed)
 {
     if (!dictionary.ContainsKey(group.TypeReference))
     {
         dictionary[group.TypeReference] = new System.Collections.Generic.Dictionary<QName, ScalarValue>();
     }
     dictionary[group.TypeReference][key]=value_Renamed;
 }
예제 #6
0
 public ScalarValue Lookup(Group template, QName key, QName applicationType)
 {
     if (table.ContainsKey(template))
     {
         return((table[template]).ContainsKey(key) ? table[template][key] : ScalarValue.UNDEFINED);
     }
     return(ScalarValue.UNDEFINED);
 }
예제 #7
0
        public void  Store(Group group, QName applicationType, QName key, ScalarValue valueToEncode)
        {
            if (!table.ContainsKey(group))
            {
                table[group] = new System.Collections.Generic.Dictionary <QName, ScalarValue>();
            }

            table[group][key] = valueToEncode;
        }
        public ScalarValue Lookup(Group template, QName key, QName applicationType)
        {
            if (!table.ContainsKey(key))
            {
                return ScalarValue.UNDEFINED;
            }

            return  table[key];
        }
        public void Store(Group group, QName applicationType, QName key, ScalarValue valueToEncode)
        {
            if (!table.ContainsKey(group))
            {
                table[group] = new System.Collections.Generic.Dictionary<QName,ScalarValue>();
            }

            table[group][key] = valueToEncode;
        }
예제 #10
0
        public ScalarValue Lookup(Group template, QName key, QName applicationType)
        {
            if (!table.ContainsKey(key))
            {
                return(ScalarValue.UNDEFINED);
            }

            return(table[key]);
        }
예제 #11
0
        public void  GroupStart(Group group)
        {
            var traceGroup = new TraceGroup(group);

            if (!(stack.Count == 0))
            {
                ((TraceGroup)stack[stack.Count - 1]).AddGroup(traceGroup);
            }
            stack.Add(traceGroup);
        }
 public ScalarValue Lookup(Group template, QName key, QName applicationType)
 {
     if (dictionary.ContainsKey(template.TypeReference))
     {
         var applicationTypeMap = (System.Collections.IDictionary) dictionary[template.TypeReference];
         if (applicationTypeMap.Contains(key))
             return (ScalarValue) applicationTypeMap[key];
     }
     return ScalarValue.UNDEFINED;
 }
예제 #13
0
 public ScalarValue Lookup(Group template, QName key, QName applicationType)
 {
     if (dictionary.ContainsKey(template.TypeReference))
     {
         var applicationTypeMap = (System.Collections.IDictionary)dictionary[template.TypeReference];
         if (applicationTypeMap.Contains(key))
         {
             return((ScalarValue)applicationTypeMap[key]);
         }
     }
     return(ScalarValue.UNDEFINED);
 }
예제 #14
0
 public static Message Convert(Group group, Message groupMsg, ConversionContext context)
 {
     SetNameAndId(group, groupMsg);
     var instructions = new SequenceValue(SessionControlProtocol_1_1.TEMPLATE_DEFINITION.GetSequence("Instructions"));
     int i = group is MessageTemplate?1:0;
     Field[] fields = group.FieldDefinitions;
     for (; i < fields.Length; i++)
     {
         Field field = fields[i];
         FieldInstructionConverter converter = context.GetConverter(field);
         if (converter == null)
             throw new System.SystemException("No converter found for type " + field.GetType());
         FieldValue value_Renamed = converter.Convert(field, context);
         instructions.Add(new[]{value_Renamed});
     }
     groupMsg.SetFieldValue("Instructions", instructions);
     return groupMsg;
 }
예제 #15
0
        public GroupValue(Group group, FieldValue[] values)
        {
            if (group == null)
            {
                throw new NullReferenceException();
            }

            this.group = group;
            this.values = values;

            for (var i = 0; i < group.FieldCount; i++)
            {
                if (!(group.GetField(i) is Scalar)) continue;
                var scalar = ((Scalar) group.GetField(i));
                if (scalar.Operator.Equals(Operator.CONSTANT) && !scalar.Optional)
                {
                    values[i] = scalar.DefaultValue;
                }
            }
        }
예제 #16
0
        public static Message Convert(Group group, Message groupMsg, ConversionContext context)
        {
            SetNameAndId(group, groupMsg);
            var instructions = new SequenceValue(SessionControlProtocol_1_1.TEMPLATE_DEFINITION.GetSequence("Instructions"));
            int i            = group is MessageTemplate?1:0;

            Field[] fields = group.FieldDefinitions;
            for (; i < fields.Length; i++)
            {
                Field field = fields[i];
                FieldInstructionConverter converter = context.GetConverter(field);
                if (converter == null)
                {
                    throw new System.SystemException("No converter found for type " + field.GetType());
                }
                FieldValue value_Renamed = converter.Convert(field, context);
                instructions.Add(new[] { value_Renamed });
            }
            groupMsg.SetFieldValue("Instructions", instructions);
            return(groupMsg);
        }
예제 #17
0
        public GroupValue(Group group, FieldValue[] values)
        {
            if (group == null)
            {
                throw new NullReferenceException();
            }

            this.group  = group;
            this.values = values;

            for (var i = 0; i < group.FieldCount; i++)
            {
                if (!(group.GetField(i) is Scalar))
                {
                    continue;
                }
                var scalar = ((Scalar)group.GetField(i));
                if (scalar.Operator.Equals(Operator.CONSTANT) && !scalar.Optional)
                {
                    values[i] = scalar.DefaultValue;
                }
            }
        }
예제 #18
0
 public ScalarValue Lookup(string dictionary, Group group, QName key)
 {
     if (group.HasTypeReference())
         currentApplicationType = group.TypeReference;
     return GetDictionary(dictionary).Lookup(group, key, currentApplicationType);
 }
예제 #19
0
 public GroupValue(Group group)
     : this(group, new FieldValue[group.FieldCount])
 {
 }
 public void GroupStart(Group group)
 {
     print(group);
     moveDown();
 }
 public static Operator GetOperator(Group group)
 {
     return (Operator) TEMPLATE_OPERATOR_MAP[group];
 }
 public TraceGroup(Group group)
 {
     this.group = group;
     nodes = new System.Collections.ArrayList(group.FieldCount);
 }
 public void GroupStart(Group group)
 {
     var traceGroup = new TraceGroup(group);
     if (!(stack.Count == 0))
     {
         ((TraceGroup) stack[stack.Count - 1]).AddGroup(traceGroup);
     }
     stack.Add(traceGroup);
 }
예제 #24
0
 public virtual FieldInstructionConverter GetConverter(Group group)
 {
     return(converterTemplateMap[group]);
 }
 public void Store(Group group, QName applicationType, QName key, ScalarValue value_Renamed)
 {
     table[key] = value_Renamed;
 }
예제 #26
0
 public TraceGroup(Group group)
 {
     this.group = group;
     nodes      = new System.Collections.ArrayList(group.FieldCount);
 }
 public static Operator GetOperator(Group group)
 {
     return((Operator)TEMPLATE_OPERATOR_MAP[group]);
 }
예제 #28
0
 public GroupValue(Group group) : this(group, new FieldValue[group.FieldCount])
 {
 }
예제 #29
0
 public void  Store(Group group, QName applicationType, QName key, ScalarValue value_Renamed)
 {
     table[key] = value_Renamed;
 }
예제 #30
0
 public void  GroupStart(Group group)
 {
     print(group);
     moveDown();
 }
 public virtual FieldInstructionConverter GetConverter(Group group)
 {
     return converterTemplateMap[group];
 }
예제 #32
0
 public void Store(string dictionary, Group group, QName key, ScalarValue valueToEncode)
 {
     if (group.HasTypeReference())
         currentApplicationType = group.TypeReference;
     GetDictionary(dictionary).Store(group, currentApplicationType, key, valueToEncode);
 }