예제 #1
0
        protected override Array DecodeImproper(byte[] bytes)
        {
            string s = TransferSyntax.ToString(bytes);

            s = s.TrimEnd(null);
            string[]          multiValue = ToImproperMultiValue(s);
            Type.PersonName[] personName = new Type.PersonName[multiValue.Length];
            for (int i = 0; i < personName.Length; i++)
            {
                string item = multiValue[i];
                personName[i] = new Type.PersonName(item);
            }
            return(personName);
        }
예제 #2
0
        protected override Array DecodeProper(byte[] bytes)
        {
            string s = TransferSyntax.ToString(bytes);

            if (s.Length < 64 * 5)
            {
                s = s.TrimEnd(null);
                string[]          multiValue = ToProperMultiValue(s);
                Type.PersonName[] personName =
                    new Type.PersonName[multiValue.Length];
                for (int i = 0; i < personName.Length; i++)
                {
                    string item = multiValue[i];
                    personName[i] = new Type.PersonName(item);
                }
                return(personName);
            }
            else
            {
                throw new EncodingException(
                          "A value of max. 64 * 5 characters is only allowed.",
                          Tag, Name + "/s", s);
            }
        }