Пример #1
0
        public void SetFieldValue(byte fieldNum, int fieldArrayIndex, Object value, String subfieldName)
        {
            Field    testField = new Field(this.GetField(fieldNum));
            Subfield subfield  = testField.GetSubfield(subfieldName);

            if ((subfield != null) && !(subfield.CanMessageSupport(this)))
            {
                return;
            }

            Field field = GetField(fieldNum);

            if (field == null)
            {
                // We normally won't have fields attached to our skeleton message,
                // as we add values we need to add the fields too based on the mesg,field
                // combo in the profile.
                field = new Field(Profile.GetMessage(this.MessageNumber).GetField(fieldNum));
                if (field.Num == Fit.FieldNumInvalid)
                {
                    // If there was no info in the profile our FieldNum will get set to invalid,
                    // at least preserve FieldNum while we know it
                    field.Num = fieldNum;
                }
                SetField(field);
            }
            field.SetValue(fieldArrayIndex, value, subfieldName);
        }
Пример #2
0
        public object GetFieldValue(byte fieldNum, int fieldArrayIndex, ushort subFieldIndex)
        {
            Field field = GetField(fieldNum);

            if (field == null)
            {
                return(null);
            }

            if (subFieldIndex == Fit.SubfieldIndexActiveSubfield)
            {
                return(field.GetValue(fieldArrayIndex, GetActiveSubFieldIndex(fieldNum)));
            }
            else
            {
                Subfield subfield = field.GetSubfield(subFieldIndex);

                if ((subfield == null) || (subfield.CanMessageSupport(this)))
                {
                    var q = field.GetValue(fieldArrayIndex, subFieldIndex);
                    return(q);
                }
                else
                {
                    return(null);
                }
            }
        }
Пример #3
0
        public int GetNumFieldValues(byte fieldNum, ushort subfieldIndex)
        {
            Field field = GetField(fieldNum);

            if (field == null)
            {
                return(0);
            }

            if (subfieldIndex == Fit.SubfieldIndexActiveSubfield)
            {
                return(field.GetNumValues());
            }

            Subfield subfield = field.GetSubfield(subfieldIndex);

            if ((subfield == null) || (subfield.CanMessageSupport(this)))
            {
                return(field.GetNumValues());
            }
            else
            {
                return(0);
            }
        }
Пример #4
0
        public void SetFieldValue(String name, int fieldArrayIndex, Object value)
        {
            Field    testField = new Field(this.GetField(name));
            Subfield subfield  = testField.GetSubfield(name);

            if ((subfield != null) && !(subfield.CanMessageSupport(this)))
            {
                return;
            }

            Field field = GetField(name, false);

            if (field == null)
            {
                field = new Field(Profile.GetMessage(this.MessageNumber).GetField(name));
                SetField(field);
            }

            field.SetValue(fieldArrayIndex, value, name);
        }
Пример #5
0
        public object GetFieldValue(string name, int fieldArrayIndex)
        {
            Field field = GetField(name, false);

            if (field == null)
            {
                return(null);
            }

            Subfield subfield = field.GetSubfield(name);

            if ((subfield == null) || (subfield.CanMessageSupport(this)))
            {
                return(field.GetValue(fieldArrayIndex, name));
            }
            else
            {
                return(null);
            }
        }
Пример #6
0
        public object GetFieldValue(byte fieldNum, int fieldArrayIndex, string subfieldName)
        {
            Field field = GetField(fieldNum);

            if (field == null)
            {
                return(null);
            }

            Subfield subfield = field.GetSubfield(subfieldName);

            if ((subfield == null) || (subfield.CanMessageSupport(this)))
            {
                return(field.GetValue(fieldArrayIndex, subfieldName));
            }
            else
            {
                return(null);
            }
        }
Пример #7
0
        public int GetNumFieldValues(byte fieldNum, string subfieldName)
        {
            Field field = GetField(fieldNum);

            if (field == null)
            {
                return(0);
            }

            Subfield subfield = field.GetSubfield(subfieldName);

            if ((subfield == null) || (subfield.CanMessageSupport(this)))
            {
                return(field.GetNumValues());
            }
            else
            {
                return(0);
            }
        }